[rrd-users] Re: FW: More PERL Help Needed

Serge Maandag serge.maandag at staff.zeelandnet.nl
Fri Sep 14 20:56:06 MEST 2001

Or, to make it a one-liner:

$found = map /cisco/i,`$prog $host public $oid`;


The guy is even less of a Perl guru than I am, so I was keeping it


-----Original Message-----
From: Todd Caine [mailto:todd_caine at eli.net]
Sent: donderdag 13 september 2001 17:28
To: Serge Maandag
Cc: Schroeder, Dennis; rrd-users at list.ee.ethz.ch
Subject: Re: [rrd-users] Re: FW: More PERL Help Needed

If $val doesn't match 'Cisco' then the expression won't be evaluated any
longer.  Now you could say:

$found = ($val =~ m/Cisco/) ? 1 : 0;

Serge Maandag wrote:

> Why not:
> My $val = `$prog $host public $oid`;
> $val =~ m/Cisco/ && $found = 1 || $found = 0;

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list