Hi all,
This shouldn't be too difficult for you guys.
I just want to format the length of an array using sprintf to add a leading zero:
$total = sprintf("%02d", @files);
for an array with 5 elements this gives me "00" instead of "05". The perl docs say something about arrays not working as you would expect, but it wasn't too clear on it.
for now, I'm just doing this, but is it the only way?
$total = @files;
$total = sprintf("%02d", $total);
Thanks!
justin
This shouldn't be too difficult for you guys.
I just want to format the length of an array using sprintf to add a leading zero:
$total = sprintf("%02d", @files);
for an array with 5 elements this gives me "00" instead of "05". The perl docs say something about arrays not working as you would expect, but it wasn't too clear on it.
for now, I'm just doing this, but is it the only way?
$total = @files;
$total = sprintf("%02d", $total);
Thanks!
justin