develooper Front page | perl.perl5.porters | Postings from February 2003

utime undef, undef, "/tmp/test" and warnings

Thread Next
Stas Bekman
February 6, 2003 16:49
utime undef, undef, "/tmp/test" and warnings
Message ID:
I wasn't sure if this is can be considered as a bug, but utime suggests:

                If the first two elements of the list are "undef", then the
                utime(2) function in the C library will be called with a null
                second argument.  On most systems, this will set the file's
                access and modification times to the current time.  (i.e.
                equivalent to the example above.)

                    utime undef, undef, @ARGV;

% perl-blead -lwe 'utime undef, undef, "/tmp/test"'
Use of uninitialized value in utime at -e line 1.
Use of uninitialized value in utime at -e line 1.

It does the job right, but what about the warnings? under:

   use warnings FATAL => 'all';

that technique can't be used. So I have to use:

% perl-blead -lwe '$t=time; utime $t, $t, "/tmp/test"'

Should utime's implementation accept undefs without generating warnings?

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About