in reply to Increment a string with letters and numbers
DB<107> ($str,$n)=split /:/,'EVO:0000023' => ("EVO", "0000023") DB<108> print "$str:",++$n EVO:0000024 DB<109> print "$str:",++$n EVO:0000025
++ is magic and does a string increment as long as you don't use $n in numeric context otherwise use sprintf
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|