in reply to Many birds, single cage...

Here's one way:
my $piece = $+ if $strange_thing =~ m/($large)|$wei($rd)|($stra)$nge/;
Have a look at perldoc perlvar for more info on $+

-enlil

Replies are listed 'Best First'.
Re: Re: Many birds, single cage...
by monsieur_champs (Curate) on Dec 09, 2003 at 21:32 UTC

    Dear Enlil
    Thank you very much for remember this special variable.
    It seems that this is the solution that I was looking for. I 'm just a little concerned about performance, but I will run a full test set on the new implementation tomorrow (it's time to go home). Can you please tell me in advance if this can bite me on performance matters?

    May the gods bless you.


    "In few words, translating PerlMonks documentation and best articles to other languages is like building a bridge to join other Perl communities into PerlMonks family. This makes the family bigger, the knowledge greather, the parties better and the life easier." -- monsieur_champs

Re: Re: Many birds, single cage...
by duff (Parson) on Dec 09, 2003 at 20:39 UTC

    If I had any more votes to give today, I'd ++ you right now. I'd forgotten about $+. Good catch.