Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created June 19, 2015 12:06
Show Gist options
  • Save bessarabov/b076383bc5acb622f293 to your computer and use it in GitHub Desktop.
Save bessarabov/b076383bc5acb622f293 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
sub aa {
my $aa = 123 if not 1;
if (defined $aa) {
print $aa . "\n";
} else {
print "undef\n";
}
$aa = rand();
}
foreach (1..5) {
aa();
}
__END__
The output is something like:
undef
0.6073304606407
0.922599598623009
0.141934602326852
0.169187877417194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment