On Sun, 17 Sep 2000 21:59:47 -0700, Nathan Wiger wrote:
Yeah, I for one think %hashes should be interpolated exactly like
@arrays. It's simple and consistent.
Simple and consistent would be behaviour like
"@{[%hash]}"
However, convenient it is not, getting all key/value pairs in one
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
On 17 Sep 2000 23:54:05 -0400, Chaim Frenkel wrote:
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')
So, what about arrays? Or scalars?
We have Data::Dumper for that.
--
The idea of interpolating a hash is cool... but is seperating each
pair by $/ really useful? A comma or $" sees to make more sense.
Yeah, I for one think %hashes should be interpolated exactly like
@arrays. It's simple and consistent.
-Nate
On Sat, Sep 16, 2000 at 03:37:33AM -, Perl6 RFC Librarian wrote:
"%hash" should expand to:
join( $/, map { qq($_$"$hash{$_}) } keys %hash )
So let me get this straight...
%hash = (foo = 42, bar = 13);
print "%hash";
should come out to:
foo 42
bar 13
The idea of
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
hashes should interpolate in double-quoted strings
=head1 VERSION
Maintainer: Nathan Torkington [EMAIL PROTECTED]
Date: 15 Sep 2000
Mailing List: [EMAIL PROTECTED]
Number: 237
Version: 1