so I was looking for a simpler, array-manipulation method of extracting the last item from a variable length array.
This made me think of pop() as yet another approach to getting the right field from the array.
my $rec = 'a b c d e f 96'; my @a = split /\s+/, $rec; printf "ads = %s\n", pop @a;
--
Damon Allen Davison
http://www.allolex.net
In reply to Re: Non-regex Methods of Extracting the Last Field from a Record
by allolex
in thread Non-regex Methods of Extracting the Last Field from a Record
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |