markd has asked for the wisdom of the Perl Monks concerning the following question:
This does not work though. The backticks method of assigning program outputs to variables works for hostname but not for source. What am I doing wrong?$hostname = `hostname`; print "hostname is $hostname\n"; $source = `ypcat hosts | grep '$hostname$'`; $source =~ /\d+\.\d+\.\d+\.\d/; print "source is $source\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ip address get problem
by b10m (Vicar) on Mar 22, 2004 at 15:03 UTC | |
by markd (Acolyte) on Mar 22, 2004 at 15:20 UTC | |
by Abigail-II (Bishop) on Mar 22, 2004 at 16:17 UTC | |
|
Re: ip address get problem
by Happy-the-monk (Canon) on Mar 22, 2004 at 15:01 UTC | |
|
Re: ip address get problem
by markd (Acolyte) on Mar 22, 2004 at 15:29 UTC |