Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: 'ID' generation issue and 'ID' format in XML::Twig

by Hue-Bond (Priest)
on Jul 11, 2006 at 14:55 UTC ( [id://560480]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://560480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2025-07-08 10:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.