in reply to Usage of Shift function in PERL

Your style of parameter checking is very cumbersome and will get unwieldly if you have more than one argument to parse. It's much more readable to write your parameter code like this:

#!/usr/bin/perl -w use strict; # usage: first parameter is user name # second parameter is message my ($user, $message) = @ARGV; print "Hello $user. Your message is: $message\n"; sub func { # note: $a and $b are bad variables to use, # as they are special variables used by sort() my ($c,$d) = @_; print $c,$d; return $c+$d; }; print func(10,10);

Update: Changed $a and $b in func