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__

_______________
D a m n D i r t y A p e
Home Node | Email

Replies are listed 'Best First'.
Re: Re: i cant explain this...just look.
by eather (Initiate) on Jul 31, 2002 at 02:50 UTC
    thank you very much for helping me. and this wasnt homework. $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);