Skip to content

Instantly share code, notes, and snippets.

@jonyesno
Created January 20, 2011 13:32
Show Gist options
  • Save jonyesno/787874 to your computer and use it in GitHub Desktop.
Save jonyesno/787874 to your computer and use it in GitHub Desktop.
Things that surprise me about Perl
#!/usr/bin/env perl
my @a = undef ;
if (@a) { print "YES!\n"; } else { print "NO\n"; }
my $a = undef ;
if ($a) { print "YES!\n"; } else { print "NO\n"; }
my @a = ();
if (@a) { print "YES!\n"; } else { print "NO\n"; }
__END__
[lemon@far ~] 0 $ /var/tmp/test.pl
YES!
NO
NO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment