Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Perl Question


On Wed, Apr 02, 2008 at 03:09:44PM +1100, Peter Abbott wrote:
> Can anyone with greater knowledge than myself explain this regex
> behaviour.
>  [ ... ]
> if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d
> \d).*?(\d*\.\d\d)L/) {
> 		$box = $1;
> 		$name = $2;
> 		$name =~ s/\.//;
> 		$place = $4;
> 		$time = $5;
> 		$margin = $6;
> 			}
> Undoubtedly something simple that a self taught dummy has failed to
> grasp.

Doing s/// for $name there resets the $1, $2, .. counters

Matt