On Thu, Nov 13, 2003 at 02:37:03PM -0500, Richard Morse wrote:

> I'm thinking that it might make more sense (given the flow of the 
> program at this point which is a large variety of 'next unless' 
> statements) to write:
>       next unless my $val = $hash{$val};
> 
> However, I recall at a previous Boston.pm meeting there being a 
> discussion about issues with 'my' in conditional clauses.  I don't, 
> however, remember the details.  Is this usage of 'my' the one that 
> causes the problem?

No, that usage should be fine.  The problematic usage is when 'my' is in
the modified statement rather than the conditional, e.g.

my $val = $hash{$val} if $whatever;

If $whatever is false, then $val will retain its value from before instead
of being reinitialized.

Ronald

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to