in reply to Trying to slice off all array elements but the last one

#!/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;
This will return 1234