in reply to Re: ignoring empty returns from split
in thread ignoring empty returns from split
gives me an undef, 'one', and 'two'.$line = "==one==two==three"; ($one,$two,$three,$four)=split (/=+/,$line); print "$one\n$two\n$three\n$four";
$line = "==one==two==three=four"; ($one,$two,$three,$four)=split (/=+/,($line=~/^=*(.*?)$/,$1)[1]); print "$one\n$two\n$three\n$four";
|
---|