Chris White wrote: [Sat Mar 05 2005, 12:11:24AM EST] > sub package_nvsplit { > $i=0; > while($_[$i] !~ /^\d/) { > $i++; > } > $package_end=$i-1; > $pn=join("-",@_[0..$package_end]); > $pv=@_[$i..$#package_array]; > return $pn, $pv; > } my ($cat, $name, $ver) = m{(.*)/(.*?)-(\d.*)}; There are much better regexes that will actually validate, but the above regex does everything you described. If you're interested in completed Perl code to correctly sort ebuilds according to portage rules, see http://dev.gentoo.org/~agriffis/darcs/skel/bashrc.funcs and search for sortvers. Regards, Aron -- Aron Griffis Gentoo Linux Developer