Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Is There A Better Way?

by Shendal (Hermit)
on Aug 13, 2002 at 15:12 UTC ( #189820=note: print w/ replies, xml ) Need Help??


in reply to Is There A Better Way?

What you're looking for is sprintf. For example:

#!/usr/bin/perl -w use strict; print "Enter ID Number: "; chomp(my $input = <STDIN>); die "Not a number!" if ($input =~ /\D/); $input = sprintf("%011d",$input); print "input: $input\n";


Cheers,
Shendal


Comment on Re: Is There A Better Way?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-29 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls