in reply to Remembering values from multiple condition 'if'
Hi,
besides the solution proposed by other monks, there is the following
which places the existing file's names in an array.use strict; my @files = grep ($_,map -e $_ && $_ , qw(foo foobar bar)); if (@files) { print "there are files\n"; #here @files holds the names of the files print(join(",",@files),"\n"); } else { print "no files\n"; }
cheers
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remembering values from multiple condition 'if'
by Aristotle (Chancellor) on Jul 02, 2002 at 01:51 UTC | |
by TheHobbit (Pilgrim) on Jul 02, 2002 at 19:53 UTC | |
by Aristotle (Chancellor) on Jul 02, 2002 at 19:58 UTC |