Hello.
 
Is there a way to pad a number with leading zeros with 1 command rather than
the 2 I used below?  It looks like you're supposed to be able to zero-fill
with sprintf but I couldn't figure it out.
 
#!/bin/perl -wd
 
$f = 1234;
 
$g = sprintf "%6s", $f;    
$g =~ s/ /0/g;                
 
print "$f\n";
print "$g\n";
 
 
 
~Carl

Reply via email to