Sam wrote:
>
> Rob wrote:
> >
> > Sam wrote:
> > > 1.  I wasn't clear on $_ in my email; that's being read elsewhere in
> > > program so it's already set by the time print_lines is called.
> >
> > You /mustn't/ use $_ like that. It's meant to be an 'it' in places like
>
> What? You want me to pass the line around in a variable! :-)

Yes. $_ is magical, and there's no excuse that I can think of for
assigning to it directly. If you have a tiny block that needs to use
the same value several times then use the idiom

  for ($thisvalue) {
    :
  }

Rob



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


Reply via email to