Skip to content

Instantly share code, notes, and snippets.

@shoorick
Created September 15, 2011 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoorick/1219343 to your computer and use it in GitHub Desktop.
Save shoorick/1219343 to your computer and use it in GitHub Desktop.
Assigning @list in scalar context works as length @list
#!/usr/bin/perl -l
my @array = qw( alice bob charlie daddy elf );
print @array; # alicebobcharliedaddyelf
my $size = @array;
print $size; # 5, same as length @array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment