The Artima Developer Community
Sponsored Link

Perl Buzz Forum
Perl 6 has data dumping built in

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Andy Lester

Posts: 518
Nickname: petdance
Registered: Jun, 2009

Andy Lester is an author and programmer.
Perl 6 has data dumping built in Posted: Aug 5, 2010 10:43 AM
Reply to this message Reply

This post originated from an RSS feed registered with Perl Buzz by Andy Lester.
Original Post: Perl 6 has data dumping built in
Feed Title: Perlbuzz
Feed URL: http://perlbuzz.com/atom.xml
Feed Description: What's happening in the world of Perl programming, including Perl 5, Perl 6, the CPAN and Parrot?
Latest Perl Buzz Posts
Latest Perl Buzz Posts by Andy Lester
Latest Posts From Perlbuzz

Advertisement

Any Perl 5 programmer who's worked with Perl 5 more than a few months has learned about how invaluable the Data::Dumper module is. The ability to say

use Data::Dumper;
print Dumper( \%hash );

is a godsend to debugging data structures of any complexity.

Perl 6 has this dumping built in.

uniqua:~/rakudo/lab $ cat dumper
#!/usr/local/bin/perl6

use v6;

my %hash = (
    'this'     => 'that',
    'year'     => 2112,
    'matcher'  => regex { ^ M(r|rs|s)\. \s+ (\w+) \s+ Wall $ },
    'rational' => 0.5,
    'num'      => (0.5).Num,
);

say %hash.perl;
# Or %hash.perl.say

uniqua:~/rakudo/lab $ ./dumper
{"num" => 0.5, "this" => "that", "year" => 2112,
"rational" => 1/2, "matcher" => { ... }}

Regex dumping does not display the actual regex yet, but Patrick Michaud says it's coming soon.

Read: Perl 6 has data dumping built in

Topic: What to respond to "Perl 6 isn't Perl any more" Previous Topic   Next Topic Topic: Diving into Perl 6

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use