in reply to use of uninitialized value in concatenation

I think you want:

my $word=shift;

instead of:

my $word=$_;

Outside of a subroutine, shift removes the first element from the @ARGV array, which usually contains program arguments (like C and C++'s "argv" parameter to main()).