[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] split oddity



on 3/7/99 2:48 PM, Brian L. Matthews wrote...

>Consider:
>
>#!perl
>$x = 'a,b,c,d,e,f';
>($a, undef, undef, $d, $e) = split /,/, $x;
>print "$a-$d-$e\n";
>
>What would you expect this to print? I expected:
>
>a-d-e
>
>and under perl5.004_04 on my ISP, that's what I get. However, under MacPerl
>5.2.0r4, which I *thought* was 5.004_04, I get:
>
>a-d,e,f-
>
>Comments, confirmations?
>
>Brian
>

Comfirmed (5.2.0r4). Although it does fine with a plain old list 
assignment...

 $x = 'a,b,c,d,e,f';
 @x = split(/,/, "$x");
 ($a, undef, undef, $d, $e) = (@x);
 print "$a-$d-$e\n";



Scott

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org