gnubbs has asked for the wisdom of the Perl Monks concerning the following question:
and regexs are already giving me sores. It has been a long time since I wrote anything in Perl, and my rusty mind is not being very cooperative. Looking at the Camel book I sweat that this is correct, but perl keeps yelling at me.
#!/usr/local/bin/perl -w use strict; my $ifconfig = `/usr/etc/ifconfig ec0`; my ($junk, $ip_address) = ($ifconfig =~ /(^.*\n.*inet\w)(d{1,3}\.\d +{1,3}.\d{1,3})/); print "$junk $ip_address\n";
When run, I get the following error:
ROOT 113 tech_support_4 //devel# ./net_config.test
Use of uninitialized value at ./net_config.test line 8.
Use of uninitialized value at ./net_config.test line 8.
I am sure that this is an easy question, and I greatly appreciate your responses. Be gentle. It is 3:30 on a friday afternoon, happy hour at my favorite bar, and I am at work...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Back in the saddle...
by Limbic~Region (Chancellor) on Apr 04, 2003 at 22:56 UTC | |
by gnubbs (Beadle) on Apr 04, 2003 at 23:00 UTC | |
|
Re: Back in the saddle...
by Mr. Muskrat (Canon) on Apr 04, 2003 at 23:00 UTC | |
|
Re: Back in the saddle...
by Nkuvu (Priest) on Apr 04, 2003 at 22:40 UTC | |
by gnubbs (Beadle) on Apr 04, 2003 at 22:51 UTC | |
by graff (Chancellor) on Apr 05, 2003 at 01:29 UTC | |
|
Re: Back in the saddle...
by The Mad Hatter (Priest) on Apr 04, 2003 at 22:42 UTC | |
|
Re: Back in the saddle...
by jasonk (Parson) on Apr 05, 2003 at 23:59 UTC |