develooper Front page | perl.perl6.language.data | Postings from September 2000

Re: RFC 237 (v1) hashes should interpolate in double-quoted strings

Thread Previous | Thread Next
From:
Nathan Torkington
Date:
September 18, 2000 07:17
Subject:
Re: RFC 237 (v1) hashes should interpolate in double-quoted strings
Message ID:
14790.9041.350092.960910@prometheus.frii.com
Chaim Frenkel writes:
> What about formating the output as a value that can be used by eval?
> 
> 	%hash = (a => 1, b => 'the world');
> 	print "%{hash}\n";
> 
> ('a' => 1, 'b'=> 'the world')

Interesting.

> And as for having to escape % in printf strings. Why not enable the
> interpolation if the %{ is seen?

Too inconsistent.  People often write dollar amounts, but we don't
only enable scalar interpolation for ${varname}.

Nat

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About