|
hi horst --
In a message dated 6/12/2006 7:16:32 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> Hi, dear colleagues.
> In a script I wish to build a name (string), which consists also an > countervalue, derived from a loop counter. > For the small values (0 to 9) shall the string consist the leading zero (00 > .... 09). > Whats to do? > At the moment I dont see the solution, so big the door is! > > Please help me! > > Horst something like this may be what you need:
C:[EMAIL PROTECTED]>perl -we "use strict; printf qq(foo%02d \n), $_ for
0 ..
13"
foo00 foo01 foo02 foo03 foo04 foo05 foo06 foo07 foo08 foo09 foo10 foo11 foo12 foo13 see also:
perldoc -f printf
perldoc -f sprintf
hth -- bill walters
|
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
