Why did you add the "o"?  I believe you should only need that if you are
storing the regex in a scalar for reuse.  Otherwise I think the regex
will still be compiled once for each iteration.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Nelson R. Pardee
Sent: Monday, May 01, 2006 7:37 PM
To: Ng, Bill; Active State Perl
Subject: Re: Easy One

Is there a reason you don't write it

 my ($characterString, $numberString) =  $string =~ /^([^\d]+)(.*)$/o;

This will assure the values are not defined if the regex fails. I also
added "o".

On Mon, 1 May 2006, Luke Bakken wrote:

> if (length $string == 8) # might as well check eh?
> {
>     $string =~ /^([^\d]+)(.*)$/;
>     my ($characterString, $numberString) = ($1, $2);
> }
>
> Luke
>
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

 --Nelson R. Pardee, Support Analyst, Information Technology &
Services--
 --Syracuse University, 211 Machinery Hall, Syracuse, NY 13244-1260
--
 --(315) 443-1079         [EMAIL PROTECTED]
--
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to