At 4:02 PM -0500 10/24/09, Harry Putnam wrote:
With this little script, how would I manage to get the shorter timestamps zero padded using printf? I now how to get padded numbers but not when I'm pushing off the right margin too.cat script.pl #!/usr/local/bin/perl use strict; use warnings; while (my $file = shift @ARGV){ my @stat = stat $file; printf "%11d %s\n",$stat[9], $file; }
I am not clear on what you are asking. You would use the format conversion '%011d' to zero-pad a number to fill 11 characters, but you say you know that already. Can you give an example of your desired output?
-- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
