Question : perl slice array
Answered by : charlesalexandre-roy
# Basic syntax:
my @array_slice = @your_array[start_index..end_index];
# Example usage:
# Define array
my @your_array = (2.3, 42, 'Word');
# Get 1st - 2nd elements (inclusive, zero-indexed)
my @array_slice = @your_array[1..2];
print "@array_slice\n";
--> 42 Word
Source : https://www.tutorialspoint.com/perl/perl_arrays.htm | Last Update : Thu, 10 Mar 22