in reply to Re: map a list
in thread map a list

/(\w+)(=(#?)(\w+))?/; defined $3 && $3 eq '#' ? "$1=>fn($4)" :
Danger! if that regex match fails, you're getting the previous round's information. GrandFather, I thought you knew better. :(

Replies are listed 'Best First'.
Re^3: map a list
by GrandFather (Saint) on Mar 12, 2007 at 21:00 UTC

    Argh, I did know better, I just forgot. However that's not a style I'd recommend for practical code in any case - it would be a dog to maintain and is somewhat obscure. Inserting die if ! in front of the regex might suit the OP's purpose.


    DWIM is Perl's answer to Gödel