pop
- pop removes the last element of an array and returns it:
@players = qw< Mario Luigi Toad Princess >; my $favorite_player = pop @players;
- Parens don't affect functionality here:
my $other_player = pop(@players);continued...
| CPU: Perl, Fall 2005 | Perl, Week 3: More Arrays, Context, Subroutines, Lexical Variables | #8 |
@players = qw< Mario Luigi Toad Princess >; my $favorite_player = pop @players;
my $other_player = pop(@players);continued...
| Copyright © 2005 Ian Langworth |