On 26/07/2012 10:09, Shmuel Fomberg wrote:
> Hi Shlomo.
>  
>
>     > You probably know that the construct:
>     > my <variable> = <something> if <condition>;
>     > is problematic.
>
>     Why problematic (other than cases where programmer is
>     confused in order of execution)?
>
>
> Because if the condition is not true, the behavior is undefined. The
> variable was not 'really' declared, and using it afterward is on your
> own risk.
That's just because you're not initializing the variable before doing
it.  Always initialize variables.  Especially if there's even the
slightest chance that your code may ever live in an embedded interpreter
that's not constructed especially for the privilege of interpreting your
script once and only once.

  Yitzchak
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to