in reply to Does anyone use underscore pseudo-filehandle?
sub _mtime { my ($self, $filepath) = @_; my $options = $self->{options}; return(undef) if ($options->{blind_cache}); # make sure it still exists in the filesystem (-r $filepath) or Carp::confess("HTML::Template : template file $f +ilepath does not exist or is unreadable."); # get the modification time return (stat(_))[9]; }
As you can see, the _ construct is passed to stat following the -r (readable) test on the file, presumably given that this stat information is also cached in a similar manner to file test information.
Following through on this at perlfunc:_X, it appears that these file tests obtain the information required to return a positive or negative test result via a system stat call. From perlfunc:_X ...
print "Can do.\n" if -r $a || -w _ || -x _; stat($filename); print "Readable\n" if -r _; print "Writable\n" if -w _; print "Executable\n" if -x _; print "Setuid\n" if -u _; print "Setgid\n" if -g _; print "Sticky\n" if -k _; print "Text\n" if -T _; print "Binary\n" if -B _;
Ooohhh, Rob no beer function well without!
|
|---|