in reply to How can I use the the return value of split without assigning?

Just use list slices:
my $first = (split /=/, $string)[0]; # or even... my ($first) = split /=/, $string;

_____________________________________________________
Jeff japhy Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: How can I use the the return value of split without assigning?
  • Download Code