Actually, the two code snippets work exactly the same. Witness:
$ cat x.pl foreach(glob('*.*')) { unlink if -f and !-s _; } foreach(glob('*.*')) { unlink if (-f $_) && !-s _; } $ perl -MO=Deparse x.pl use File::Glob (); foreach $_ (glob('*.*')) { unlink $_ if -f $_ and not -s _; } foreach $_ (glob('*.*')) { unlink $_ if -f $_ and not -s _; } x.pl syntax OK
In reply to Re^3: UNIX command - remove 0 byte file
by VSarkiss
in thread UNIX command - remove 0 byte file
by darrengan
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |