Closed p5pRT closed 21 years ago
2;0 juerd@ouranos:\~$ perl -MO=Deparse -e'print "$foo\::bar"' print "$foo::bar"; -e syntax OK 2;0 juerd@ouranos:\~$ perl -MO=Deparse -e'print "${foo}::bar"' print "$foo::bar"; -e syntax OK
Should be obvious\, I think :)
Below\, characters in the 80th column are doubled because of a shitty terminal. Sorry about that.
On Sat\, Mar 29\, 2003 at 03:53:18PM -0000\, Juerd wrote:
2;0 juerd@ouranos:\~$ perl -MO=Deparse -e'print "$foo\::bar"' print "$foo::bar"; -e syntax OK 2;0 juerd@ouranos:\~$ perl -MO=Deparse -e'print "${foo}::bar"' print "$foo::bar"; -e syntax OK
Should this be a solution ?
Regards Adi
On Sat\, Mar 29\, 2003 at 06:50:55PM +0200\, I wrote:
- || ($last =~ /^[{\[\w_]/ && + || ($last =~ /^[:{\[\w_]/ &&
And \<'> should be probably there too. - || ($last =~ /^[:{\[\w_]/ && + || ($last =~ /^[:'{\[\w_]/ &&
$ perl -MO=Deparse "${a}'b" ^D "$a'b";
which perl will parse as $a::b ...
"EA" == Enache Adrian \enache@​rdslink\.ro writes:
EA> On Sat\, Mar 29\, 2003 at 06:50:55PM +0200\, I wrote: EA> - || ($last =~ /^[{\[\w_]/ && EA> + || ($last =~ /^[:{\[\w_]/ &&
EA> And \<'> should be probably there too. EA> - || ($last =~ /^[:{\[\w_]/ && EA> + || ($last =~ /^[:'{\[\w_]/ &&
EA> $ perl -MO=Deparse EA> "${a}'b" EA> ^D EA> "$a'b";
EA> which perl will parse as $a::b ...
Yes. It might be better to write the regex as (['\[{\w_]|::)\, since a single colon doesn't trigger interpretation as a variable\, but generally this is a context where it's better to err on the side of adding the curlies rather than not.
-- Stephen
Enache Adrian wrote:
On Sat\, Mar 29\, 2003 at 06:50:55PM +0200\, I wrote:
- || ($last =~ /^[{\[\w_]/ && + || ($last =~ /^[:{\[\w_]/ &&
And \<'> should be probably there too. - || ($last =~ /^[:{\[\w_]/ && + || ($last =~ /^[:'{\[\w_]/ &&
Thanks\, applied as #19127.
$ perl -MO=Deparse "${a}'b" ^D "$a'b";
which perl will parse as $a::b ... -- Unlocked is not *NIX
The issue got patched\, so I'm marking the problem ticket as resolved.
@jhi - Status changed from 'new' to 'resolved'
Migrated from rt.perl.org#21744 (status was 'resolved')
Searchable as RT21744$