[thelist] Perl-limiting size of returned number?

Adrian Fischer adrian at logo-logic.com
Sun Jun 17 07:01:44 CDT 2001


Hi Guys,

This is the problem...Im using perl's time as a file number but I only want
to use the first 5 numbers of the number returned.  I think I can do it with
sprintf() or printf() but am not sure of the syntax.  Again  think it would
look something like this:
<snip>
$new_file=time;
$file_no= (sprintf("%0d",$new_file));
</snip>
this aint right because this will trim decimals or something.  I want only
return the first 5 or so places.

Thanks

Adrian Fischer





More information about the thelist mailing list