> > > > > > $ perl -e 'printf "%vd\n", 192.168.1.1 & 255.255.0.0' > > > 192.168.0.0 > > > > > > > quoting the string in anyway seems to break it. i am trying > to read in the > > strings from <STDIN> like this: > > print "Enter the IP address: "; > > $ip = <STDIN>; > > print "Enter the Subnet address: "; > > $sn = <STDIN>; > > > > printf "The network adr is: %vd\n", $ip & $sn; > > -- > > output: > > Enter the IP address: 192.168.1.1 > > 192.168.1.1 > > > > Enter the Subnet address: 255.255.255.0 > > 255.255.255.0 > > > > The network adr is: 48.49.48.46.48.52.48.46.48.36.49.10 > > --- > > > > how can i make this work ? > > Well the quick, dirty and insecure way is > > $ip = eval <STDIN>; > > If that in unsatisfactory you might want to make sure there are no > "naughty" characters in there, or you'll need an answer more along the > lines that you were looking for initially. >
Well, Quick and dirty are fine for now. I will have to hack up a routine using pack/unpack. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]