Re: odd variable result

2006-08-28 Thread John W. Krahn
Curt Shaffer wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED] >> >> Curt Shaffer wrote: >>> >>>my $test = system `/usr/bin/snmpget -v1 10.1.11.18 -c secret >>>.1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}'`; >> >> You are using back-quotes AND system() so if your external command d

Re: odd variable result

2006-08-28 Thread John W. Krahn
Curt Shaffer wrote: > List, Hello, > I am trying to set a variable based on a system call. In Perl a "system call" would be open() or link() or crypt(), etc. You mean that you are trying to set a variable based on the output of an external program. > Here is my code: > > #!/usr/bin/perl us

RE: odd variable result

2006-08-28 Thread Curt Shaffer
: Curt Shaffer; Perl List Subject: Re: odd variable result try this syntax: my $test = system ("/usr/bin/snmpget -v1 10.1.11.18 -c secret .1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}'"); or my $test = qx(you command above w/no quotes needed); or open (SNMP, "

Re: odd variable result

2006-08-28 Thread Derek B. Smith
try this syntax: my $test = system ("/usr/bin/snmpget -v1 10.1.11.18 -c secret .1.3.6.1.4.1.710.7.1.5.1.23.1.13.1|awk '{print $4}'"); or my $test = qx(you command above w/no quotes needed); or open (SNMP, "snmpget -v1 10.1.11.18 -c secret .1.3.6.1.4.1.710.7.1.5.1.23.1.13.1" ) or die "failed