Perl wrote:
> 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

Hi Dhanashri,

First, let me ask how your process is designed.  Does your 'APP' call
the perl script?  So you run the APP, the APP does stuff, then calls
your perl script, then returns to the APP and loops?  Correct?  Can you
tell us more about this 'APP'?  Windows or UNIX (or other)?  Is the
'APP' a script itself?

Also, have you checked out the File::Basename module?  Here is some
code:

#!/usr/bin/perl

use warnings;
use strict;
use File::Basename;

my $filename = shift;
my $base = basename $filename
print "The basename is $base\n";


This code produces the following:

# basenametest /tmp/this/is/a/test.p
The base name is test.p


Hope this was helpful.

--Errin

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


  • RE: Pass a value to... Larsen, Errin M HMMA/Information Technology Department

Reply via email to