You probably want something like this
#!/usr/bin/perl use strict; my @emptyfiles = grep { /^\d+$/ } grep { -f } glob '*'; foreach my $emptyfile (@emptyfiles) { my $previous = $emptyfile - 1; if ((-z $emptyfile) and (-f $previous)) { print "found previous conformation: $previous \n"; print "found new conformation: $emptyfile \n"; } # if -z loop. } #foreach loop.
Have a look at scalars and arrays in Perl variable types.
pojIn reply to Re^2: create array of empty files and then match filenames
by poj
in thread create array of empty files and then match filenames
by angela2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |