At 06:12 PM 5/3/2006 -0700, $Bill Luebkert wrote:
>Having said that, I would also say that $a and $b were a bad choice for
>the sorting vrbls. Let's hope something more intuitive (special looking)
>for Perl 6 - like a separate namespace/syntax for special vrbls (like
>maybe $^a, $^b or some such).
Timothy Johnson wrote:
>>my ($b, $c) = ($1, $2) if $a =~ /^(\D+)(\d+)/;
>
>
> Don't do that! $a and $b are special variables used by perl for sorting
> (and even if they weren't it would be bad form to use variables whose
> names have no bearing on their contents).
While $a and $b are special,
At 09:34 AM 5/3/2006 -0700, Timothy Johnson wrote:
>Don't do that! $a and $b are special variables used by perl for sorting
>(and even if they weren't it would be bad form to use variables whose
>names have no bearing on their contents).
Nah, they're not that special. $a and $b are only special
At 11:07 AM 5/3/2006, David Kaufman wrote:
Hi Chris,
Chris Wagner <[EMAIL PROTECTED]> wrote:
> At 01:28 AM 5/3/2006 -0400, David Kaufman wrote:
>> my ($b, $c) = ($1, $2) if $a =~ /^(\D+)(\d+)/;
>
> U can't combine a my and an if. Perl will go schizo.
Sure "U" can :-) I use this type of constru
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
David Kaufman
Sent: Tuesday, May 02, 2006 10:29 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Re: Easy One
> my ($b, $c) = ($1, $2) if $a =~ /^(\D+)(\d+)/;
Don't do that! $a an
Hi Chris,
Chris Wagner <[EMAIL PROTECTED]> wrote:
> At 01:28 AM 5/3/2006 -0400, David Kaufman wrote:
>> my ($b, $c) = ($1, $2) if $a =~ /^(\D+)(\d+)/;
>
> U can't combine a my and an if. Perl will go schizo.
Sure "U" can :-) I use this type of construct all the time, even with strict
mode and
At 01:28 AM 5/3/2006 -0400, David Kaufman wrote:
>my ($b, $c) = ($1, $2) if $a =~ /^(\D+)(\d+)/;
U can't combine a my and an if. Perl will go schizo.
--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"
0100
___
Hi Bill (in Brooklyn),
Ng, Bill <[EMAIL PROTECTED]> wrote:
> Real simple,
>
> I have a string, "$a" for arguments sake, that contains a single
> word. The word will always have exactly 8 characters in it, most
> likely something like "ABCD1234". I need to split this up into two
> strings ($b &
Timothy Johnson wrote:
> if ($str =~ /^(?=.{8}$)(\D+)(\d+)$/){
I like it - solves both problems.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
$Bill Luebkert wrote:
> Luke Bakken wrote:
>
> > What is the purpose of this illustration in the context of the
>
>>original stated problem? The original problem stated that the string
>>will have different numbers of alphabetic characters and numbers while
>>your regex specifies 4 digits exact
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
$Bill Luebkert
Sent: Tuesday, May 02, 2006 5:42 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Re: Easy One
>> The original problem stated that the string
>> will have differen
Luke Bakken wrote:
> What is the purpose of this illustration in the context of the
> original stated problem? The original problem stated that the string
> will have different numbers of alphabetic characters and numbers while
> your regex specifies 4 digits exactly. My code was in reference to
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Luke Bakken
Sent: Tuesday, May 02, 2006 6:16 AM
To: Timothy Johnson
Cc: perl-win32-users@listserv.ActiveState.com
Subject: Re: Easy One
>> >> I have a string, "$a" for argumen
>Maybe you're used to some old behavior in Perl, but that doesn't
>appear to be the case in 5.8.8 at least. I get this output:
Ah. Okay, I see why that worked now. $1, $2 et al are scoped to the
current block, so in this case you are right. If you were to do two
pattern matches within the
[resending with a better counter-example]
Luke Bakken wrote:
>>> use strict;
>>>
>>> my $str = '';
>>> matchit();
>>> $str = '';
>>> matchit();
>>>
>>> sub matchit
>>> {
>>> if (length $str == 8) {
>>> $str =~ /^(\D+)(\d+)$/;
>>>
Luke Bakken wrote:
>>> use strict;
>>>
>>> my $str = '';
>>> matchit();
>>> $str = '';
>>> matchit();
>>>
>>> sub matchit
>>> {
>>> if (length $str == 8) {
>>> $str =~ /^(\D+)(\d+)$/;
>>> print "\$1 $1 \$2 $2\n";
>>>
I have a string, "$a" for arguments sake, that contains a
>>
>>single
>>
word. The word will always have exactly 8 characters in it, most
>>
>>likely
>>
something like "ABCD1234". I need to split this up into two strings
>>
>>($b
>>
>>
>>
>>>if (length $string == 8) # might a
Luke Bakken wrote:
I have a string, "$a" for arguments sake, that contains a
>>
>>single
>>
word. The word will always have exactly 8 characters in it, most
>>
>>likely
>>
something like "ABCD1234". I need to split this up into two strings
>>
>>($b
>>
>>
>>
>>>if (length $str
Ah, you made me go back and reread the manual on this. It does sound like
it doesn't matter if there's no variable to interpolate. Although- when I
recently did some timing, it seemed to make a very slight difference.
On Tue, 2 May 2006, Timothy Johnson wrote:
> Why did you add the "o"? I believ
>> I have a string, "$a" for arguments sake, that contains a
single
>> word. The word will always have exactly 8 characters in it, most
likely
>> something like "ABCD1234". I need to split this up into two strings
($b
>
>if (length $string == 8) # might as well check eh?
>{
>$stri
f
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 &quo
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?
> {
> $st
REGEX!
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Ng, Bill
> Sent: Tuesday, May 02, 2006 3:55 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Easy One
>
>
> Real simple,
>
> I ha
Tuesday, May 02, 2006 5:55 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Easy One
Real simple,
I have a string, "$a" for arguments sake, that contains a single word.
The word will always have exactly 8 characters in it, most likely something
like "ABCD1234
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Luke Bakken
Sent: Monday, May 01, 2006 2:50 PM
To: Ng, Bill
Cc: perl-win32-users@listserv.ActiveState.com
Subject: Re: Easy One
On 5/1/06, Ng, Bill <[EMAIL PROTECTED]> wrote:
>> Real simple,
>
On 5/1/06, Ng, Bill <[EMAIL PROTECTED]> wrote:
Real simple,
I have a string, "$a" for arguments sake, that contains a single
word. The word will always have exactly 8 characters in it, most likely
something like "ABCD1234". I need to split this up into two strings ($b
& $c), the first
ame your variable $a. $a and $b are special variables
used in sorting.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ng, Bill
Sent: Monday, May 01, 2006 12:55 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Easy One
Real simple,
I hav
[EMAIL PROTECTED] wrote:
> Real simple,
>
> I have a string, "$a" for arguments sake, that contains a single
> word. The word will always have exactly 8 characters in it, most
> likely something like "ABCD1234". I need to split this up into two
> strings ($b & $c), the first string needs t
Real simple,
I have a string, "$a" for arguments sake, that contains a single
word. The word will always have exactly 8 characters in it, most likely
something like "ABCD1234". I need to split this up into two strings ($b
& $c), the first string needs to contain all the characters before
29 matches
Mail list logo