On Mon, 2009-09-07 at 15:12 -0400, Uri Guttman wrote:
> >>>>> "MA" == Mishustin Alexey <shum...@shumkar.ru> writes:
> 
>   MA> В Пнд, 07/09/2009 в 23:01 +0400, Mishustin Alexey пишет:
>   >> I give up!
>   >> 
>   >> What's the mystery?
> 
>   MA> Aaaa,
> 
>   MA> ($raised_num) = 'Tab_22' =~ /^Tab_(.*)$/;
>   MA> print $raised_num."\n";
> 
>   MA> ($raised_num) = 'Tab_23' =~ /^Tab_([0-9]+)$/;
>   MA> print $raised_num."\n";
> 
>   MA> ($raised_num) = 'Tab_24' =~ /^Tab_([0-9][0-9])$/;
>   MA> print $raised_num."\n";
> 
>   MA> !!
> 
> see? wasn't it more fun and educational to discover the answer without
> being given it directly? :)
> 
> uri

I like reading these little problems.  MA wasn't the only one who
learned something here.  I hadn't thought of evaluating regexs in list
context (says me wondering how many times I've done $a = $1; $b =
$2;...)

Great stuff.  Not sure if the list is a supplement to the books
(Learning Perl etc) or the books a supplement to the list.  Both good.

Tim Bowden


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to