Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

RE: Regarding style

by Fastolfe (Vicar)
on Oct 24, 2000 at 23:17 UTC ( [id://38177] : note . print w/replies, xml ) Need Help??

in reply to Regarding style

A few points:
  1. It's a "forward slash" or a "slash" (/), not a "backslash" (\).. I don't mean to be anal or nit-picky, but the mis-use of this word causes a lot of headaches.. "aych tee tee pee colon backslash backslash..." -- "no, forward-slash, not back-slash.." -- "the one underneath the vertical bar? ok"
  2. So long as the subroutine is declared before it is used (typically meaning that it has to appear in the source code above the point where it's called), this is true. Mainly it's a style thing.. Use whichever is best for you, but use it consistently.
  3. <> means something different than <STDIN> when @ARGV is non-empty. In this case it iterates through the files and operates on each one independently for data, which is probably not what you always want. It makes it easy to write scripts that operate on files if filenames are given, or STDIN if no filenames are provided.