shift: defaults to shifting @ARGV
#!/usr/bin/perl -w use strict; sub version { print "version\n"; } my $option = shift; # defaults to shifting @ARGV version() if $option eq "-v" or $option eq "--version"; print "Hello, world.\n";