Use a function to wrap it, so that it can be reused:
print foo("1234"), "\n"; print foo("1234_002"); sub foo { return ($_[0] =~ /^\d{4}$/) ? $_[0] . "_001" : $_[0]; }
In reply to Re: Variable assignment confusion
by pg
in thread Variable assignment confusion
by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |