Add to the Beginning of an Array with Unshift in Perl
@ko="Hello";
unshift(@ko, "Hi");
print @ko;
Which Prints:
HiHello
-We created an array and named it ko because we like typing shorter names more than long ones.
-We stored Hello in our array.
-We used Perl's built-in unshift function to add to the beginning of our array.
-We put the thing to be unshifted (or added) in quotation marks.
-We used Perl's built-in print function.