Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: what type of dsc is this

by dbuckhal (Chaplain)
on Oct 09, 2018 at 00:12 UTC ( [id://1223700]=note: print w/replies, xml ) Need Help??


in reply to what type of dsc is this

My best guess is an array of blessed hashes...

Agreed... and a little snippet that might be helpful?

perl -Mstrict -MData::Dumper -we ' package Test; sub new { my $class = shift; my $stuff = {}; bless $stuff, $class; return $stuff; } package Main; my $t = [ Test->new("foo"), Test->new("bar"), Test->new("baz"), ]; print "Ref: " . ref($t) . "\n"; print Data::Dumper->Dump([$t]) . "\n"; ' __output__ Ref: ARRAY $VAR1 = [ bless( {}, 'Test' ), bless( {}, 'Test' ), bless( {}, 'Test' ) ];

Replies are listed 'Best First'.
Re^2: what type of dsc is this
by LanX (Saint) on Oct 09, 2018 at 00:46 UTC
    Suggestion, it's even more helpful if you put the passed arguments into $stuff. :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      I thought of that, but did not in order to leave my references empty, similar to the OP's. But, if you insist. :)

      perl -Mstrict -MData::Dumper -we ' package Test; sub new { my $class = shift; my $stuff = { shift() => 1}; bless $stuff, $class; return $stuff; } package Main; my $t = [ Test->new("foo"), Test->new("bar"), Test->new("baz"), ]; print "Ref: " . ref($t) . "\n"; print Data::Dumper->Dump([$t], ["for_LanX"]) . "\n"; ' __output__ Ref: ARRAY $for_LanX = [ bless( { 'foo' => 1 }, 'Test' ), bless( { 'bar' => 1 }, 'Test' ), bless( { 'baz' => 1 }, 'Test' ) ];

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-16 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found