On Thu, 21 Apr 2005 10:06:24 +0300 Offer Kaye <[EMAIL PROTECTED]> wrote:
> On 4/21/05, FreeFall wrote: > > Sure I did with Paul's example data : > > $date = 'one | two |three |'; > > And I tried to change the regx /\s*\|\s*/ to /s*\|?\s*/ and it worked. What > > do you think? > > I think that's very strange. Here is my version: > > perl -MData::Dumper -we'use strict; my $date = q{one | two |three > > |};my @record = split /\s*\|\s*/,$date;print Dumper ([EMAIL PROTECTED]);' > $VAR1 = [ > 'one', > 'two', > 'three' > ]; > > Here is yours: > > perl -MData::Dumper -we'use strict; my $date = q{one | two |three > > |};my @record = split /\s*\|?\s*/,$date;print Dumper ([EMAIL PROTECTED]);' > $VAR1 = [ > 'o', > 'n', > 'e', > 't', > 'w', > 'o', > 't', > 'h', > 'r', > 'e', > 'e' > ]; > > As you can see, your version doesn't work correctly. sorry for that. I made a mistake. You are totally right. Thank you,anyway! -- Whatever you do will be insignificant,but the important is you do it! It doesn't matter who you are, it's what you do that takes you far! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>