Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: It doesn't mean what you think it means

by Stegalex (Chaplain)
on Apr 11, 2002 at 15:05 UTC ( [id://158333]=note: print w/replies, xml ) Need Help??


in reply to It doesn't mean what you think it means
in thread Compiling regular expressions to perform substitution

Slight modification needed to make this compile. Here it is:
my %mungers = ( foo => sub { $_[0] =~ s/foo/bar/g }, fru => sub { $_[0] =~ s/(fru.*)/uc($1)/e }, ); if( $phase_of_moon > WAXING_GIBBOUS ) { $mungers{foo}->( $string ); # this line changed } else { $mungers{fru}->( $string ); # this line changed }
Again, thanks for everyone's help. I like chicken.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-26 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found