Created
October 26, 2025 14:37
-
-
Save crmpicco/12cbf9db92591180d4b72ba1525b8f34 to your computer and use it in GitHub Desktop.
Perl Example usage of 'unshift' function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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