in reply to Re: create array of empty files and then match filenames
in thread create array of empty files and then match filenames
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.
poj
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: create array of empty files and then match filenames
by angela2 (Sexton) on Jan 07, 2016 at 18:32 UTC | |
by poj (Abbot) on Jan 07, 2016 at 18:43 UTC |