Quote:
add.pl Code:
use warnings; Code:
($a, $b) = @ARGV; Code:
C:\dir>add.pl Code:
C:\dir>add.pl |
'require' is like an include. You can't call the 'require'd code as an external program. Its one approach or the other.
You may find these links useful. http://perldoc.perl.org/ - Perl lang with lots of examples & tutorials http://www.perlmonks.org/?node=Tutorials |
Dear Chris,
Thank you for wonderrful links you've provided. I'm going through them. I hope i could find answer somewhere. Dear David and Chris, The program has some strange behaviour, that is what i wanted to understand. See for example if you put comment near print in add.pl Code:
use warnings; Code:
($a, $b) = @ARGV; Code:
Result is All i want is capture the result of addition.pl in $sum, becuase that i would be passing to some other perl script as input. Thank you very much for your patience in dealing with this issue. |
All(!) the output from the 2nd perl script is captured in $sum in the first script.
You're making this overly complex. Why not just put the addition in a subroutine in the first perl script? |
Quote:
To reiterate, if you capture the output of a script using the "qx" function, you will not see the output. Quote:
Code:
($a) = @ARGV; Code:
use warnings; Code:
($a, $b) = @ARGV; Code:
C:\blah>add |
I got it. Thanks a lot David.
|
Hi chris, the above question is just a part of big coding work, done by my colleague and i'm continuing the work. where i was missing output of some other script captured into a variable. so i wrote this simple program just for my undertanding, as this is my first perl program.
Yet to swim the big sea, i'm just at first tide.... Anyway thanks for your links which are helping me to learn the basic skills. |
All times are GMT -5. The time now is 06:17 AM. |