shawn wilson wrote:
Oh, I guess I was thinking that using the file name repeats the stat
(which it does). Since I was complaining about the ugliness of '_'.
However, you're right - that works as well as (-f _)-- that doesn't
look weird as shit? I've got issues moving my fingers into typing
From perldoc -f stat:
If stat is passed the special filehandle consisting of an underline, no stat
is done, but the current
contents of the stat structure from the last stat, lstat, or filetest are
returned. Example:
if (-x $file (($d) = stat(_)) $d 0) {
print $file is executable NFS
On Wed, Mar 19, 2014 at 4:21 AM, Yonghua Peng sys...@mail2000.us wrote:
From perldoc -f stat:
If stat is passed the special filehandle consisting of an underline, no
stat is done, but the current
contents of the stat structure from the last stat, lstat, or filetest
are returned. Example:
On Wed, Mar 19, 2014 at 10:37 AM, shawn wilson ag4ve...@gmail.com wrote:
On Wed, Mar 19, 2014 at 4:21 AM, Yonghua Peng sys...@mail2000.us wrote:
From perldoc -f stat:
If stat is passed the special filehandle consisting of an underline, no
stat is done, but the current
contents of the
Shaji Kalidasan wrote:
You can use more than one file test on the same file to create a
complex logical condition.
Suppose you only want to operate on files that are both readable and
writable; you check each attribute and combine them with and:
if (-r $file and -w $file) {
...
}
Each
On Tue, Mar 18, 2014 at 11:32 PM, John W. Krahn jwkr...@shaw.ca wrote:
Shaji Kalidasan wrote:
or stat() or lstat()
I don't remember seeing that reusing i?stat would not duplicate the
stat call...?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail:
From Archive::Tar::File - what's '_' and where is it documented?
sub _filetype {
my $self = shift;
my $file = shift;
return unless defined $file;
return SYMLINK if (-l $file); # Symlink
return FILE if (-f _); # Plain file
return DIR if (-d _);
Dear Shawn,
You can use more than one file test on the same file to create a complex
logical condition.
Suppose you only want to operate on files that are both readable and writable;
you check each attribute and combine them with and:
if (-r $file and -w $file) {
...
}
Each time you
On Mon, Mar 17, 2014 at 10:05 AM, shawn wilson ag4ve...@gmail.com wrote:
From Archive::Tar::File - what's '_' and where is it documented?
sub _filetype {
my $self = shift;
my $file = shift;
return unless defined $file;
return SYMLINK if (-l $file); # Symlink
Thank y'all.
That's weird to read, but it makes sense easy enough.
On Mon, Mar 17, 2014 at 7:10 AM, Brian Fraser frase...@gmail.com wrote:
On Mon, Mar 17, 2014 at 10:05 AM, shawn wilson ag4ve...@gmail.com wrote:
From Archive::Tar::File - what's '_' and where is it documented?
sub _filetype
10 matches
Mail list logo