in reply to Re: get some part of the string using regex
in thread get some part of the string using regex

Of course when using split you can always limit the number times the string gets split by adding the third parameter:
my $foo = 'abc|def|ghi|jkl|mno'; my @bar = split('|', $foo, 3);
Since you are only interested in the first two fields.