Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Concatnate long statement

by leocharre (Priest)
on Jul 04, 2007 at 13:07 UTC ( [id://624878]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Concatnate long statement
in thread Concatnate long statement

The following example has a statement per line.
#!/usr/bin/perl -w use strict; use warnings; use Time::Format 'time_format'; printf "Hello world, today is %s\n", time_format('mm dd yyyy',time); exit;
The following example has statements broken up into lines and is still valid:
#!/usr/bin/perl -w use strict; use warnings; use Time::Format 'time_format'; printf "Hello world, today is %s\n", time_format( 'mm dd yyyy', time ); exit;
The following example is still valid but has unnacceptable formatting for human beings:
#!/usr/bin/perl -w use strict; use warnings; use Time::Format 'time_format'; printf "Hello world, today is %s\n", time_format( 'mm dd yyyy', time) ; exit ;
The following example breaks:
#!/usr/bin/perl -w use strict; use warnings; use Time::Format 'time_format' printf "Hello world, today is %s\n", time_format('mm dd yyyy',time); exit;
Personally I use vim, set expandtab, and I break a long statement with new line and tab. If you foresee coding perl regularly, you need a copy of Perl Best Practices by Damian Conway.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found