Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RE: RE: My crime of choice

by johannz (Hermit)
on Oct 13, 2000 at 23:56 UTC ( #36655=note: print w/ replies, xml ) Need Help??


in reply to RE: My crime of choice
in thread My crime of choice

Well, this works under use strict. I create a named array containing a named hash of anonymous hashes of anonymous arrays of anonymous and named subroutine references. I think I got everything you said :-)

#!/usr/bin/perl use strict; use Data::Dumper; local $\ = "\n"; my %namedHash = ( 'anon hash1' => { 'anon array1' => [ sub { print 'anon sub1'}, \&test1, \&test2 ], 'anon array2' => [ sub { print 'anon sub2';}, \&test1, \&test3 ], }, 'anon hash2' => { 'anon array1' => [ sub { print 'anon sub1'}, \&test1, \&test2 ], 'anon array2' => [ sub { print 'anon sub2'}, \&test1, \&test3 ], }, ); my @namedArray = ( \%namedHash ); print Dumper(\@namedArray); exit; sub test1 { print 'sub test1'; }; sub test2 { print 'sub test2'; }; sub test3 { print 'sub test3'; };


Comment on RE: RE: My crime of choice
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-09-02 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (21 votes), past polls