mhinkle has asked for the wisdom of the Perl Monks concerning the following question:
All of the examples I find have no spaces between lines and I am getting older so its harder for me to see and thus understand, :( so I’d like to add spaces (newlines, whitespace) in my programs—is this acceptable?
I am including an example below of a program example I found and the way I have modified it to make it easier for me to understand and see.
Can someone tell me if these two scripts will produce the EXACT same results? Or if my modifications change the functionality of it?
Original:
#!/usr/bin/perl
@lines = `perldoc -u -f atan2;`;
foreach (@lines) {
s/\w<(^>+)>/\U$1/g;
print;
}
Modified:
#!/usr/bin/perl
@lines = `perldoc -u -f atan2;`;
foreach (@lines)
{
s/\w<(^>+)>/\U$1/g;
print;
}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Mr. BlindNewB question regarding spacing
by toolic (Bishop) on Oct 01, 2012 at 17:42 UTC | |
Re: Mr. BlindNewB question regarding spacing
by davido (Cardinal) on Oct 01, 2012 at 17:49 UTC | |
Re: Mr. BlindNewB question regarding spacing
by Fletch (Bishop) on Oct 01, 2012 at 17:43 UTC | |
Re: Mr. BlindNewB question regarding spacing
by Anonymous Monk on Oct 01, 2012 at 20:07 UTC | |
Re: Mr. BlindNewB question regarding spacing
by Anonymous Monk on Oct 01, 2012 at 18:12 UTC | |
Re: Mr. BlindNewB question regarding spacing
by GrandFather (Saint) on Oct 02, 2012 at 20:21 UTC |