Article View: comp.lang.misc
Article #7027Re: Metalanguages in environments where code is data.
From: Tom Christiansen
Date: Fri, 11 Nov 1994 18:51
Date: Fri, 11 Nov 1994 18:51
22 lines
2081 bytes
2081 bytes
:-> In comp.lang.perl, peter@nmti.com (Peter da Silva) writes:
:Um, OK, except my example used a quoted brace-bracketed string with variable
:interpolation deferred until a later point. Can you do deferred variable
:interpolation in Perl?
Sure; just use q{no interp on $var for now}, and then interpolate it later,
probably with things like
$string = q{no interp on $var for now};
.....
$newstring = eval qq{"$string"};
or if you know they're just simple variables, merely
$string =~ s/([\$\@]\w+)/$1/eeg; # check your electroencephalograph
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
There are many times when you want it to ignore the rest of the string just
like atof() does. Oddly enough, Perl calls atof(). How convenient. :-)
--Larry Wall in <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov>
Technical Details
Message-ID:
<3a0egc$p4c@csnews.cs.Colorado.EDU>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!csnews!mox!tchristReferences:
<id.IWEE1.A3H@nmti.com> <id.57ME1.GJ5@nmti.com> <39uaqf$3b2@csnews.cs.colorado.edu> <id.O6NE1.U_5@nmti.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f891f,9bda08f2f068881f X-Google-Attributes: gidf891f,public X-Google-Thread: 1025b4,9bda08f2f068881f X-Google-Attributes: gid1025b4,public X-Google-Thread: 10eb76,9bda08f2f068881f X-Google-Attributes: gid10eb76,public X-Google-Thread: 103d24,9bda08f2f068881f X-Google-Attributes: gid103d24,public X-Google-Thread: 10259a,9bda08f2f068881f X-Google-Attributes: gid10259a,public X-Google-ArrivalTime: 1994-11-11 17:43:23 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!csnews!mox!tchrist From: Tom Christiansen <tchrist@mox.perl.com> Newsgroups: comp.lang.misc,gnu.misc.discuss,comp.lang.scheme,comp.lang.tcl,comp.lang.perl Subject: Re: Metalanguages in environments where code is data. Date: 11 Nov 1994 18:51:53 GMT Organization: Perl Consulting and Training Lines: 22 Message-ID: <3a0egc$p4c@csnews.cs.Colorado.EDU> References: <id.IWEE1.A3H@nmti.com> <id.57ME1.GJ5@nmti.com> <39uaqf$3b2@csnews.cs.colorado.edu> <id.O6NE1.U_5@nmti.com> Reply-To: tchrist@mox.perl.com (Tom Christiansen) NNTP-Posting-Host: perl.com Originator: tchrist@mox