[Melbourne-pm] Postfix conditionals and creating lexicals

Mathew Robertson mathew.blair.robertson at gmail.com
Wed Jul 11 20:10:37 PDT 2012


It is a static variable.

On 12 July 2012 09:00, Alfie John <alfiej at opera.com> wrote:

> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> sub foo {
>   my ( $bar ) =@_;
>
>   my $baz = $bar if $bar;
>   print "baz = $baz\n";
>
>   $baz = 42;
> }
>
> foo( 1 );
> foo( 1 );
> foo( 0 );
> foo( 0 );
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20120712/c9fb724c/attachment.html>


More information about the Melbourne-pm mailing list