$ perl -e '@a=split(/\./, 'first.second.third'); $b=pop(@a); print "B is: $b\n";' B is: firstsecondthird $ perl -e '@a=split(/\./, "first.second.third"); $b=pop(@a); print "B is: $b\n";' B is: third