in reply to unGodly problems with pop()
produces:use strict; my $rest = 'a b c d password'; my @rest = split(/ /, $rest); print "\@rest=@rest\n"; my $apass = pop @rest; print "PASS: $apass\n"; print "\@rest=@rest\n";
@rest=a b c d password PASS: password @rest=a b c d
update: And maybe you have a space at the end of your scalar, and so the last element is empty. You may want to print out the scalar first with something around it like print "($rest)\n" so you can see it.
|
|---|