As others suggested, you need to take care of the following two things as
- $arg shift @ARGV;
to
$arg = shift @ARGV;
- You are confused about the stdin, and the command line input.
Another thing which i understand is, you wanted the output to be fed as command line argument instead of input. For that you can use the "xargs" command as
./one.pl "one" | xargs ./two.pl
which will give your expected output.
Hope this helps.