Durai wrote: > > Hello All, Hello,
> open FILE, "test.txt" or die "Can't open file!: $!"; > while( <FILE> ) > { > print if /(\d+\.\d+\.\d+\.\d)/; > } > close FILE; > > It gives the following output: > > # prevent Apache from glomming onto all bound IP addresses (0.0.0.0) > #Listen 12.34.56.78:80 > # e.g., www.apache.org (on) or 204.62.129.132 (off). > > I want only a word which contains IP address only not with port and others.. > For example, Need like: 204.62.129.132 not (0.0.0.0),12.34.56.78:80,.. . open FILE, 'test.txt' or die "Can't open file!: $!"; while ( <FILE> ) { print "$_\n" for /\d+\.\d+\.\d+\.\d+/g; } close FILE; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>