in reply to Re: Concatenation and Regex on one Statement?
in thread Concatenation and Regex on one Statement?

Interesting.

What's the difference between "do" and "eval" here?
--

($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Replies are listed 'Best First'.
Re: Re: Re: Concatenation and Regex on one Statement?
by dws (Chancellor) on Mar 16, 2002 at 02:45 UTC
    What's the difference between "do" and "eval" here?

    Both "do" and "eval" return the value of last expression in the block. "eval" traps exceptions, capturing the argument to "die" and stuffing it into $@. "do" doesn't. I prefer it as a lighter-weight solution to problems like the one you posed.