Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Not strict (once and only once)

by Aristotle (Chancellor)
on May 04, 2003 at 04:51 UTC ( #255430=note: print w/replies, xml ) Need Help??


in reply to Re: Not strict
in thread A Perl aptitude test

That is what you call doing it once and only once?
my $namespace = \%GMPN::Database::Table::; my %inject = ( pre_insert => sub { ... }, pre_update => sub { ... }, ); for my $subpkg (qw[org user group foo bar]) { my ($method, $code); $namespace->{"$subpkg::"}->{$method} = $code while ($method, $code) = each %inject; }

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: Not strict (once and only once)
by diotalevi (Canon) on May 04, 2003 at 05:40 UTC

    Ok, so it was at least better. And thinking back, I initially wrote each glob access many lines apart which didn't lend itself to that expression.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://255430]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-10-24 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (286 votes). Check out past polls.

    Notices?