Shift and Unshift : shift « Array « Perl
- Perl
- Array
- shift
Shift and Unshift
#!/usr/bin/perl
use warnings;
use strict;
my @array = ();
unshift(@array, "first");
print "Array is now: @array\n";
unshift @array, "second", "third";
print "Array is now: @array\n";
shift @array ;
print "Array is now: @array\n";
Related examples in the same category