Dhanashri/ Chris

Yes!! exactly that is what I am trying to do. I am sorry for not making it
clear before.
here is the true picture. I have an APP which can run a perl script but just
before running the script I have a variable in that app which is holding a
value let say "c:\documents\test.pl"  also that value changes with every
record.
Now in my perl script I want to parse the string and just want to take the
file name which is "Test.pl" in my case and want to pass back (filename)
value of $base to that APP using STDOUT.
so far script is working fine If I am giving value to $path variable as a
constant (C:\documents\test.p) but I do not how can get the value of $path
which APP is passing to script?

Thanks



"Dhanashri Bhate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


-> -----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