Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: breaking long lines in my code

by Parham (Friar)
on Feb 08, 2002 at 05:07 UTC ( #144039=note: print w/ replies, xml ) Need Help??


in reply to breaking long lines in my code

i think the concatination method is the most elegant.

print "this is line 1, " . "this is line 2, " . "this is line 3";
would print: this is line 1, this is line 2, this is line 3 all on one single line. It breaks down your code very well without messing up your output.


Comment on Re: breaking long lines in my code
Download Code
Replies are listed 'Best First'.
Re: Re: breaking long lines in my code
by RSevrinsky (Scribe) on Feb 10, 2002 at 12:50 UTC
    I agree that concatenation is the best way to go (to handle scalars as well as prints, CGI.pm parameters, etc.). I found that, to get emacs to indent properly in circumstances like this, it worked best to surround the entire string in a NOP function call:

    print nop("this is line 1, " . "this is line 2, " . "this is line 3");

    In this case, nop() is as simple as it looks:

    sub nop { return join("", @_) }

    If anyone has a better way of handling the auto-indenting problem, I'm open to it.

    - Richie

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://144039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (15)
As of 2015-07-31 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls