I'd just use s/^(\d{4})$/$1_001/
~>perl -e '@id = (1234,"4323_003"); foreach ( @id ) { s/^(\d{4})$/$1_0 +01/; print $_, "\n"; }' 1234_001 4323_003
If the input needs to be checked, I'd do it separately (and before).
In reply to Re: Variable assignment confusion
by qq
in thread Variable assignment confusion
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |