Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    searching perl program for ip address

    How can I search a perl program for an ip address. The tricky part is that I want to find ANY ip address in the program. So Id like to search for any ip address style set of numbers.

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Can you explain some more? I am stuck on the concept of searching a perl program. wouldn't it be perl doing the searching?
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    New Coder
    Join Date
    Jul 2010
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    no..

    I am using komodo ide. and I want to search all the program files. .pm and .pl files

  • #4
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Have you tired using komodo's "edit -> find"? It should provide the option to use a regex for the search criteria.

    I don't use their IDE, so I don't know if it supports searching multiple files in a single search. You may need to write a separate script to preform the search on all files.

  • #5
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    NetAddr::IP::Find - Find IP addresses in plain text - http://search.cpan.org/~miyagawa/Net...ddr/IP/Find.pm

  • #6
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    $ip = "217.34.34.3 217.34.34.2 ";
    $hash->{$1}++ while $ip =~ /(\d+\.\d+\.\d+\.\d+)/smg xor grep { $_ > 255 } split /\./, $1;
    author: amg (forum.vingrad.ru)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •