-> -----Original Message-----
-> From: Chris Devers [mailto:[EMAIL PROTECTED]
-> Sent: Wednesday, July 13, 2005 5:44 AM
-> To: Perl
-> Cc: Perl Beginners List
-> Subject: Re: Pass a value to Perl script
-> 
-> 
-> On Tue, 12 Jul 2005, Perl wrote:
-> 
-> > I have this perl script which is taking value from an external 
-> > appliaction and then after processing it is passing back a 
-> value to 
-> > same application. But I was not able to figure out how can 
-> I define 
-> > the variable my $path (which is taking value from external 
-> app). what 
-> > should be the syntex. Can somebody help me to set the 
-> syntex of the 
-> > variable to accept value from app.

-> Try something like this:
->     sub get_value_from_other_app {
->         my $app   = '/path/to/app';
->         my $value = system( "$app" ) 


"system" will give the exit status of the application execution.. 
to get the actual output of the appln (i.e. stdout) , run the application 
putting it in back-quotes..
i.e.  my $value=`/path/to/app`

as for passing the output of the perl script back to the application, you can 
pipe the output.. 
e.g. my-perl-script.pl | /path/to/app

but from your post, i did not get exactly what you are trying to do, by 
accepting in a perl script a value from an application , and passing a value 
back.. are you trying to write a perl subroutine to becalled from some another 
application??


Dhanashri

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to