Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: incrementing a number

by choroba (Cardinal)
on Oct 12, 2010 at 16:24 UTC ( [id://864896]=note: print w/replies, xml ) Need Help??


in reply to incrementing a number

AA825944001 is not a number, it is a string. If you mean just the numeric part, you have to separate it, increment and glue together again.
In fact, Perl can increment strings as well, just try
$x='AA825944001'; print ++$x;

Just be careful with strings like AA99 - is AB00 what you really want to get from them?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found