in reply to Returning a string from executable

You are looking for strict equality in your tests --
if ($enable_poe eq 'POE device missing or unpowered') { print $enable_poe, "\n", "Your Poe IS NOT enabled, dummy\n"; }
What happens if the string is really "POE device missing or unpowered\n"? (Note the new-line character....)

Try

if ($enable_poe =~ /POE device missing or unpowered/) { print $enable_poe, "\n", "Your Poe IS NOT enabled, dummy\n"; }

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Returning a string from executable
by duckyd (Hermit) on Oct 27, 2006 at 23:59 UTC
    Alternatively, you could just chomp $enable_poe; before you check it (thus avoiding the need for a regex)
Re^2: Returning a string from executable
by Luken8r (Novice) on Oct 27, 2006 at 18:55 UTC
    EGADS! That was it, thanks!!