The regexp method is most likely the more efficient, especially on larger strings.my $val = (split /\./, 'foo.bar.aaa')[0]; #or my($val) = 'foo.bar.aaa' =~ /^([^.]+)/;
In reply to Re: split...or better?
by suaveant
in thread split...or better?
by mikejones
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |