programming-examples/perl/Subroutine/Swap array value by using the sub range.pl
2019-11-15 12:59:38 +01:00

11 lines
170 B
Perl

#!/usr/bin/perl -w
use strict;
my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
print @months;
@months[3,4] = @months[4,3];
print @months;