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

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

Thread Next
From:
Stas Bekman
Date:
February 6, 2003 16:49
Subject:
utime undef, undef, "/tmp/test" and warnings
Message ID:
3E43024A.20508@stason.org
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
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About