This will return 1234#!/usr/bin/perl use strict; my @array = (1,2,3,4,5); my $arrayref = \@array; my @array2 = @{$arrayref}[0..$#{$arrayref}-1]; print @array2; print "\n"; exit;
In reply to Re: Trying to slice off all array elements but the last one
by ChrisR
in thread Trying to slice off all array elements but the last one
by talexb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |