in reply to Interpolating a single quad in an IP address
I think this is what you're shooting for:
#! /usr/bin/perl use strict ; use warnings ; $|++ ; # @system_call=('host' , "192.168.$help.1");$help = 'i need the $help # variable to read a list of numbers from a file one at a time and pri +nt # the results of the ip resolutions'; im just learning perl so if i do +nt # articulate well enough its becouse im in /tmp/stupid for the moment. # thanks. #--------------------------------------------------------------------- +-- open IN, 'my_file.txt' ; while ( <IN> ) { chomp ; print `host 192.168.$_.1` if /\d+/ ; } close IN ; exit ; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: i cant explain this...just look.
by eather (Initiate) on Jul 31, 2002 at 02:50 UTC |