Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Check for data in array

by fazedandconfused (Novice)
on Feb 08, 2012 at 16:49 UTC ( #952528=note: print w/ replies, xml ) Need Help??


in reply to Check for data in array

I've found the solution. If I remove the warn Dumper \%sections; and then change the comaprison to add the "m" flag after the pattern as below,

if ( $sections{"procs"} !~ /service.exe/m ) { $color = "yellow"; $summary = "`/bin/date` CAWA Server service is not run +ning."; $statusmsg = "&yellow service.exe not running. Possibl +e failover to ukclasce002. Inform OSG before 8:30am.\n\n" . $s ections{"procs"}; } else { $color = "green"; $summary = "`/bin/date` CAWA Server service OK $os"; $statusmsg = "&green service.exe running ok.\n\n" . $s +ections{"procs"}; }

This now works as expected. Thanks for the suggestions anyway.


Comment on Re: Check for data in array
Select or Download Code
Replies are listed 'Best First'.
Re^2: Check for data in array
by choroba (Canon) on Feb 08, 2012 at 16:53 UTC
    Very strange. /m only affects ^ and $ that you do not use in the regular expression!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2015-07-28 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls