unshift array : unshift « Array « Perl






unshift array

    

#!/usr/bin/perl -w

use strict;

my @array = ();
unshift @array, "first";
print "Array is now: @array\n";
unshift @array, "second", "third";
print "Array is now: @array\n";

   
    
    
    
  








Related examples in the same category

1.unshift places data to the front of an array
2.The unshift function prepends LIST to the front of the array.
3.Using unshift to insert elements at the front of @array