halecommarachel has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
This line of code isn't working for me:
print "$_ could not be restored!\n" unless (exists $found{$_}) foreach (@files);
This is the error:
syntax error at /home/fisusr/bin/monitor_ssh.pl line 108, near ") foreach "
Is this not valid code? Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach loop on one line
by Kenosis (Priest) on Dec 03, 2013 at 00:49 UTC | |
|
Re: foreach loop on one line
by BrowserUk (Patriarch) on Dec 03, 2013 at 00:54 UTC | |
|
Re: foreach loop on one line
by KurtZ (Friar) on Dec 03, 2013 at 01:20 UTC | |
|
Re: foreach loop on one line
by toolic (Bishop) on Dec 03, 2013 at 00:50 UTC | |
|
Re: foreach loop on one line
by tobyink (Canon) on Dec 03, 2013 at 09:25 UTC |