$str="123456789"; @arr=split(//,$str); while($tmp=pop(@arr)){ print "\nfirst-frm last-->$tmp"; }