[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Is this fun? What's going on?



Am I having fun yet?

My replacement string (as in s{}{}) has reached hundreds of words and the
string itself is about 100 characters long...

Somewhere out in the 'real' world I thought I had discovered a way to store
the replacement string inside a $var once and then just refer to the $var -

my $var = "<A HREF=\"$1\">$1<>";

s{target\b} {$var}g;

But then the $1 is empty.  If I use q{} the $1 itself shows up.
MacPerl PerlFaq6 talks about {} delimiters when using s/// but it only says
that they are equiv. to qq{}...  Is there a way to store the replacement
string and then get it eval'ed during usage?

MacPerl PerlFaq7: Should I be looking at using 'closures' to obtain a
reference back to the $1 via some other method - like an anonymous
subroutine?

I was to the point where I am trying this hack @{[$1]}... I keep trying to
research using www.dejanews.com and M-J. Dominus' Interpolation site, but
there appears to be a problem with an Alter.Net router between FCCJ and the
rest of the free world :(

(Not sure if this e-mail will make it out...)
-Sneex-  :]

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe