Re: Where's this documented?

2014-03-20 Thread John W. Krahn
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

Re[2]: Where's this documented?

2014-03-19 Thread Yonghua Peng
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

Re: Re[2]: Where's this documented?

2014-03-19 Thread shawn wilson
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:

Re: Re[2]: Where's this documented?

2014-03-19 Thread Brian Fraser
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

Re: Where's this documented?

2014-03-18 Thread John W. Krahn
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

Re: Where's this documented?

2014-03-18 Thread shawn wilson
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:

Where's this documented?

2014-03-17 Thread shawn wilson
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 _);

Re: Where's this documented?

2014-03-17 Thread Shaji Kalidasan
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

Re: Where's this documented?

2014-03-17 Thread Brian Fraser
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

Re: Where's this documented?

2014-03-17 Thread shawn wilson
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