>    if (/Time: (..):(..):(..)/) {
>         $hours = $1;
>         $minutes = $2;
>         $seconds = $3;
>     }
> 
> This then becomes:
> 
>   /Time: (?$hours=..):(?$minutes=..):(?$seconds=..)/
> 
> This is more maintainable than counting the brackets and easier to understand
> for a complex regex.  And one does not have to worry about the scope of $1 etc.

This is probably one of the coolest RFC's I've seen so far. :-) 

One question: How are these scoped? Are they lexicals? Global dynamics?
What if you want to change the scoping?

This is the only catch I see. Maybe requiring, under 'use strict':

   my($hours, $minutes, $seconds);
   /Time: (?$hours=..):(?$minutes=..):(?$seconds=..)/

Input?

-Nate

Reply via email to