Example:
use strict;
my $file = shift;
open(IN, $file) || die \"Unable to open $file\\n\";
open(OUT, \">$file.$$\") or die $!;
What is goin
You can read the documentation on shift. It is very clear. shift accepts an array and extracts the first element (actually removing it from the array). If you don't provide any array, it uses @ARGV (the arguments to the command line of the program) to read the data. If you're inside a function, it uses @_, namely, the parameters of the function.
Example:
my @array = (1, 2, 3);
my $value = shift @array;
print $value; # will print '1'