Re: Here Docs

2010-06-02 Thread Jenda Krynicky
From: "Uri Guttman" > > "JK" == Jenda Krynicky writes: > > JK> From: "Joseph L. Casale" > >> 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 wil

interpolation techniques (was Re: Here Docs)

2010-06-01 Thread Uri Guttman
> "t" == trapd00r 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 var, I us

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 @{[scala

Re: Here Docs

2010-06-01 Thread Uri Guttman
> "JK" == Jenda Krynicky writes: JK> From: "Joseph L. Casale" >> 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 in here docs. basic here docs

Re: Here Docs

2010-06-01 Thread Jenda Krynicky
From: "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 use Interpolation eval => 'eval'; print <<"END"; $eval{localtime time} Foo Bar END CPAN - http://search.cpan.org

Re: Here Docs

2010-05-02 Thread Dr.Ruud
Jim Gibson wrote: Joseph L. Casale: Inside a here doc, how can I force an expression to be evaluated such as localtime [...] You can use the trick mentioned in 'perldoc -q string' "How do I expand function calls in a string?", referencing, then dereferencing an array, but it is ugly [...]

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: beginners-unsubscr.

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" 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 = localtime time; Bu

Re: Here Docs

2010-04-30 Thread Jim Gibson
On 4/30/10 Fri Apr 30, 2010 9:27 AM, "Joseph L. Casale" 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 = localtime tim