my $s = "foo1bar"; $s =~ /(\w+)\d(\w+)/; print "var1: $1\tvar2: $2\n"; my $p = "$2$1"; # works and prints "p is barfoo" # call script as "perl pmtest.pl $2$1" #my $p = "$ARGV[0]"; # doesn't work, prints "p is $2$1" print "p is $p\n";