[Israel.pm] A question of style - print()

Levenglick Dov-RM07994 DovL at freescale.com
Wed Oct 19 03:10:20 PDT 2005


Use the following:
print <<"EOF";
Here you type whatever you want, 
however you want it to appear (WYSIWYG)
On multiple or single lines. Because of the double
Quotes around EOF, any variable that you put here will be interpolated.
EOF


 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[ ] General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Propriety
[x] Personal Memorandum
 


-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Madani, Srikanth, VF-DE
Sent: Wednesday, October 19, 2005 11:55 AM
To: Perl in Israel
Subject: [Israel.pm] A question of style - print()


Hi all,

I had the idea to replace a set of consecutive print statements with a
single call to print, spread over multiple lines. I think this will
improve readability. This is to be used when the consecutive print
statements are logically related. An illustrative example follows.

Before:

print "\n$0: Warning - couldn't find alias $emails in $EmailAliases";
print "\nAlias $emails cannot be resolved - no email will be sent.\n";
print "\nPlease contact file owner to update your desired group in
$EmailAliases.\n";


After:

print "\n$0: Warning - couldn't find alias $emails in $EmailAliases",
        "\nAlias $emails cannot be resolved - no email will be sent.\n",
        "\nPlease contact file owner to update your desired group in
$EmailAliases.\n";



(The leading whitespace in the second two lines of "After" is a tab.)

Of course, I wouldn't group statements like:

print "\nProcess ding-dong ended at $time.\n";
print "\nProcess RPC23556Z has been invoked at $time\n";

as they seem to belong to different code fragments.

What do you think?

Regards,
Srikanth Madani

That is the true season of love, when we believe that we alone can love,
that no one could have loved so before us, and that no one will love
in the same way as us.
                -- Johann Wolfgang von Goethe

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list