in reply to How to cut strings from the end
This will do want you want:
$string = 'perl345'; $_ = $string; chop; chop; chop; #! $string = $_;
Unless I have the sense of your question reversed, in which case this will work:
$string = "perl345"; for( reverse split //, $string ){ $newstring .= chop unless /[a-z]/ } print scalar reverse $newstring;
;-)
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
|
|---|