in reply to Re^2: 'ID' generation issue and 'ID' format in XML::Twig
in thread 'ID' generation issue and 'ID' format in XML::Twig

You can (ab)use the magical increment properties of ++:

my $c='aff001'; print $c++, "\n" for 0..5; __END__ aff001 aff002 aff003 aff004 aff005 aff006

You should be careful with overflows, though:

my $c='aff998'; print $c++, "\n" for 0..5; __END__ aff998 aff999 afg000 afg001 afg002 afg003

--
David Serrano