Thomas, Mark - BLS CTR in
<[EMAIL PROTECTED]>:
> > > > > Jim Hill wrote:
> > > > > 
> > > > > > | $ini{section}{match} = '$1 $2';
> > > > > > ... however that just prints "$1 $2" as a literal string.
> > > > > 
> > > > > Hint: the above two lines of your post answer your own question.
> > > 
> > > Single quotes don't interpret variables. Double quotes do. 
> > 
> > Thanks but, afaict, there are no single quotes anywhere in the
> > script I posted although I do understand how it might look that way
> 
> If the one line from your script I quoted above doesn't have single
> quotes, I need to get my eyes checked.

Sorry, I should have been more explicit. The single quotes don't
get sucked into the hash; if you wanted quotes to be held in the
hash, you'd have to use ...

$ini{section}{match} = '\'$1 $2\'';

You can confirm that there's no quotes being returned by running
the code I supplied in my last message. In the inifile produced
by that code you should see ... 

[test]
regex=^.*? (..:..:..) .*? \((.*?)\) .*
match=$1 $2

... and, afaik, that's exactly what you get when you simulate
reading from an inifile into a hash via ...

$ini{section}{match} = '$1 $2';

Hence, there looks to be single quotes on the line in question
but, effectively, there isn't.

Hmm, thinking about the lack of quotes makes we wonder if the
following might do the trick ...

my $test = "\"".$ini{test}{match}."\"";
print eval $test;

... and, by golly, it does! Whoopee! 

Thanks for continuining to prod me, Mark.
-- 

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to