Re: Here Docs

2010-06-02 Thread Jenda Krynicky
From: Uri Guttman u...@stemsystems.com JK == Jenda Krynicky je...@krynicky.cz writes: JK From: Joseph L. Casale jcas...@activenetwerx.com Inside a here doc, how can I force an expression to be evaluated such as localtime: here docs are just a different form of string so any

Re: Here Docs

2010-06-01 Thread Jenda Krynicky
From: Joseph L. Casale jcas...@activenetwerx.com Inside a here doc, how can I force an expression to be evaluated such as localtime: print END; `localtime time` Foo Bar END use Interpolation eval = 'eval'; print END; $eval{localtime time} Foo Bar END CPAN -

Re: Here Docs

2010-06-01 Thread Uri Guttman
JK == Jenda Krynicky je...@krynicky.cz writes: JK From: Joseph L. Casale jcas...@activenetwerx.com Inside a here doc, how can I force an expression to be evaluated such as localtime: here docs are just a different form of string so any technique which works in quoted strings will work

Re: Here Docs

2010-06-01 Thread trapd00r
i would say to just use a temporary scalar variable. there is no shame in doing this and it is simpler than using the Interpolation module which is doing tied things and calling eval (which is dangerous). When I dont want to use a temp var, I usually do like this: print EOF; foo

interpolation techniques (was Re: Here Docs)

2010-06-01 Thread Uri Guttman
t == trapd00r trapd...@trapd00r.se writes: i would say to just use a temporary scalar variable. there is no shame in doing this and it is simpler than using the Interpolation module which is doing tied things and calling eval (which is dangerous). t When I dont want to use a temp

Re: Here Docs

2010-05-03 Thread Dr.Ruud
[...] What makes you say it is ugly? To me it is just another useful language feature. But it needs plenty of space. :) I use $ in here-docs as well: perl -wle' my @id = 1..5; my $sql = do { local $ = q{,}; # SQL; SELECT id , name FROM things WHERE id IN (@id

Here Docs

2010-04-30 Thread Joseph L. Casale
Inside a here doc, how can I force an expression to be evaluated such as localtime: print END; `localtime time` Foo Bar END I know I can simply create the var before, my $var = localtime time; But just curious how to evaluate expressions inside this... Thanks! jlc -- To unsubscribe,

Re: Here Docs

2010-04-30 Thread Jim Gibson
On 4/30/10 Fri Apr 30, 2010 9:27 AM, Joseph L. Casale jcas...@activenetwerx.com scribbled: Inside a here doc, how can I force an expression to be evaluated such as localtime: print END; `localtime time` Foo Bar END I know I can simply create the var before, my $var =

Re: Here Docs

2010-04-30 Thread John W. Krahn
Jim Gibson wrote: On 4/30/10 Fri Apr 30, 2010 9:27 AM, Joseph L. Casale jcas...@activenetwerx.com scribbled: Inside a here doc, how can I force an expression to be evaluated such as localtime: print END; `localtime time` Foo Bar END I know I can simply create the var before, my $var =

RE: Here Docs

2010-04-30 Thread Joseph L. Casale
You can use the trick mentioned in 'perldoc -q string' How do I expand function calls in a string? Funny that the perldoc uses the exact function I wanted to use:) localtime is a Perl function, not an external command, so: Thanks guys! jlc -- To unsubscribe, e-mail: