Skip to content

Instantly share code, notes, and snippets.

@crmpicco
Created October 26, 2025 14:37
Show Gist options
  • Save crmpicco/12cbf9db92591180d4b72ba1525b8f34 to your computer and use it in GitHub Desktop.
Save crmpicco/12cbf9db92591180d4b72ba1525b8f34 to your computer and use it in GitHub Desktop.
Perl Example usage of 'unshift' function
#!/usr/bin/perl
# Craig R Morton
# Example usage of 'unshift' function
# Last_Edit: 13-Feb-2007
use strict;
my @myNames;
@myNames = ("Curly", "Moe");
# add 'Larry' to front of array
unshift(@myNames, "Larry");
# value of @myNames is now
# "Larry", "Curly", "Moe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment