in reply to pattern matching difficulties, in two cases

This works for me:
#!/usr/bin/perl while (<>) { if (/\s*inet (addr:)?([\d\.]+) /) { print "$2\n"; } }

Replies are listed 'Best First'.
Re: Re: patern matching difficulties, in two cases
by jcpunk (Friar) on Jun 24, 2003 at 17:08 UTC
    That works beautifully on the linux box, but grabs the loopback on the sun system.... however, i thank the much for that as it makes life simpler and jumpstarts my brain
    jcpunk

    by the way thanks for all the help that was, is, and will be

      Changing the print to:
      print "$2\n" unless ($2 =~ /^127/);
      is the quick-n-dirty way to fix that.
        again i thank you for the help, it is much apprecated
        jcpunk

        by the way thanks for all the help that was, is, and will be