Hello

Years ago I used to work with FORTRAN, RPG GAP 2 and a smidgeon of basic.
Code was written one line at a time, the first section of code was Input data, the next section was calculations, the last section was output. (For example, in the sample of code below, the "while" line would have been written on one line instead of 3)

Why is it "good practice" to write PERL the way it is done?
Why is it that some code has no curly braces after print; whilst in others I sometimes see one or more curly braces after it? Will there be a time when print; will fail because there isn't a curly brace following it, even though an equal number of left & right braces precede it? I appreciate I have the right to lay out my code in any way I see fit, I would just like to see the reasoning.

An example of something confusing me is in the sample below
find sub {
      return unless -f;
      open my $FH, '<', $_ or die "Cannot open '$_' $!";
      while ( <$FH> ) {
          /\Q$string/ && print $REPORT "$File::Find::name\n" and
 return;
          }}, '/test';

Why isn't the last line
         }, '/test';}

Thanks
Brian

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to