help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printf formatting in Perl


From: Steve Bickerton
Subject: printf formatting in Perl
Date: Fri, 08 Sep 2006 15:51:19 -0400
User-agent: Mozilla Thunderbird 1.0.6-7.4.20060mdk (X11/20050322)

Hi All,

I'm afraid I'm being a bit picky here, but I'd like to find a way to change the indentation used by emacs for the printf command in a Perl script. When I use a printf statement which is longer than the line length, I'd prefer to put it on several lines, but subsequent lines don't come out indented with respect to the printf.

An example:

Example 1 (doesn't indent subsequent lines):

    printf STDOUT "This string fills a lot of the line: %.3f %.3f\n",
    $var1, $var2;


I've found a work-around by concatenating part of the string onto the subsequent line, like this:

Example 2 (does indent subsequent lines):

    printf STDOUT "This string fills a lot of the line: %.3f %.3f".
        "\n", $var1, $var2;


The indentation in example 2 is what I'm looking for, but without needing to concatenate. Suggestions?

regards,
steve


reply via email to

[Prev in Thread] Current Thread [Next in Thread]