RolandGunslinger has asked for the wisdom of the Perl Monks concerning the following question:
This is starting to bother me. I wrote up a perl script and what I had wanted to do was this
I obviously got an error about trying to mod a scalar value I found a way to get what I wanted by calling subroutines instead;$down="false"; open (FH, $log) || $down = "true";
I know this may look like a really stupid bit of perl code, I only code perl for my own enjoyment and I've only been doing it since September. What would you folks recommend? Thanks much.use vars qw/$down/; $down="false"; open (FH, $log) || &woops($host); if ($down eq "false") { ....send tail of log file... } else { ....send "server is down" } sub woops { ...do some stuff.... $down = "true"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: open failure code
by tachyon (Chancellor) on Nov 26, 2003 at 23:17 UTC | |
Re: open failure code
by cchampion (Curate) on Nov 26, 2003 at 23:25 UTC | |
by RolandGunslinger (Curate) on Nov 26, 2003 at 23:32 UTC | |
by Nkuvu (Priest) on Nov 26, 2003 at 23:39 UTC | |
Re: open failure code
by Revelation (Deacon) on Nov 26, 2003 at 23:17 UTC | |
Re: open failure code
by mpeppler (Vicar) on Nov 26, 2003 at 23:18 UTC | |
Re: open failure code
by Anonymous Monk on Nov 26, 2003 at 23:38 UTC | |
by Grygonos (Chaplain) on Nov 27, 2003 at 00:09 UTC | |
by jweed (Chaplain) on Nov 27, 2003 at 02:50 UTC | |
by davido (Cardinal) on Nov 27, 2003 at 05:47 UTC |
Back to
Seekers of Perl Wisdom