Thanks Pete, I actually thought about this, but
because of the format of my perl script, it'll get too
messy if I do this with a regex.  The thing is, If I
didn't have any other string other than the filename,
then this would have been really easy to do.  Ex:

$fileName = "File1";
$var = '$fileName';

$string = eval($var);  # $string now stores 'File1'.

But this won't work if $var='1>>$fileName'. I was
hoping there would be a simple way getting around this
without using any regexps.

Navid M.

 --- Pete Emerson <[EMAIL PROTECTED]> wrote: >
Your first perl script sends '1>>$filename' (single
> quotes, this is NOT a
> variable) ... and you want to replace '$filename'
> with the contents of the
> variable $filename?
> 
> If I have that correct, a regex will help:
> 
> my $string='1>>$filename'; # This is coming from
> your first perl script.
> my $filename='filename.txt';
> $string=~s/\$filename/$filename/; # Regex! Escape
> the $ ...
> print "$string\n";
> 
> Pete
>  

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to