in reply to Question on system function
If your abc program is perl also, use <STDIN> explicitly; not <>. In what follows echo.pl is your abc. kprasanna.pl is the script calling it.
echo.pl:
use strict; use warnings; my $arg = $ARGV[0]; my $line = <STDIN>; # bare <> won't work print "argument was $arg\ninputline was $line";
kprasanna.pl:
use strict; use warnings; my $file = $ARGV[0]; system "./echo.pl $file";
Running it:
Hope it helps.duper:~/pp carol$ ./kprasanna.pl a_filename hello kprasanna # typed in at terminal argument was a_filename inputline was hello kprasanna duper:~/pp carol$
|
|---|