in reply to Re^2: UNIX command - remove 0 byte file
in thread UNIX command - remove 0 byte file
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
|
---|