Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: short method to print age.

by zouz (Initiate)
on Mar 05, 2009 at 19:42 UTC ( [id://748641]=note: print w/replies, xml ) Need Help??


in reply to Re: short method to print age.
in thread short method to print age.

Thank you all for the answers you guys offered. i think i will end up using this code.
#!/usr/bin/perl use warnings; %alex = ( 'name' => 'Alex', 'age' => '45'); %john = ( 'name' => 'John', 'age' => '20'); %chaddy = ( 'name' => 'Chady', 'age' => '16'); @children = (\%john, \%chaddy); $alex{'children'} = \@children; print "Alex children are \n " , join("\nand ", map $_->{age}, reverse @{$alex{children}}) , "\tyears old\n"; print "Alex is $alex{age} himself\n";
instead of the one i mentioned above. much easier to understand i guess,thx Roy and thank you all once again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found