Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.

by olivierp (Hermit)
on Dec 09, 2004 at 08:51 UTC ( #413453=note: print w/ replies, xml ) Need Help??


in reply to Re: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
in thread Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.

Doh !
Thanks to fglock and Errto for pointing out the obivous.
This at least "fixes" my $var3:

my ($var3) = map { s/\r?\n\Z/(munched)/; $_ } <<EOT; Var also has an interpolated var: $interpolated And the last newline is also absent -> EOT
However, $var4 still explodes on a read-only value, and I still haven't found, apart from eval'ing the whole thing, how to do the same for $href->{key3} = {...

--
Olivier


Comment on Re^2: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
Download Code
Re^3: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
by fglock (Vicar) on Dec 09, 2004 at 12:55 UTC

    Very interesting - that's because an interpolated string is actually an unnamed variable, while a simple string is just a constant.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://413453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-09-30 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (383 votes), past polls