Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

As another monk told you, assuming the user alsways gets an IP from the same block is a dangerous road. It wont work for most DSL links and certainly not for mobile devices like tablets.

Even assuming the user stays in the same building (for example a company), when unplugging or plugging an ethernet cable, many devices automatically switch from WLAN to LAN or vice versa. And, on a reasonably big network, these might be in different IP ranges.

Also, you can not assume that it's "safe" if the IP changed but stayed in the same IP range. Many script kiddies are just that: Young people, often living or working in a small or large group together. You know, pupils, students, apprentice PerlMonks, and so on. And often enough, they are very... enthusiastic... about their skills while still learning the more intricate details of right and wrong... ;-)

On the other hand, multiple users may share a single IP adress because they are behind a NAT or using a SSH connection or other tunnel to the same server. Or, for HTTP, they might use the same proxy.

Your method also ultimatively will fail rather sooner than later from a simple, mathematical standpoint: We are running out of IPv4 adresses and more and more networks start to enable IPv6. For this, you need another set of calculations.

Finally, you can not even rely on an unchanged IP. With access to the users local network, it's usually not that hard to knock his/her computer of the net and re-use the IP for ones own purposes for a short time. That's why cryptography was invented. You know, SSL and stuff.

(Not that anything i just said really matters for the "wrong" kind of users. I know a number people who run a pirated, unpatched Version of XP. Without AntiVirus of course. But with IE6 that came pre-installed. Only two of them have learned their lesson in the last year, both got their online banking access hijacked.)

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

In reply to Re^2: Net::IP convert ip to int by cavac
in thread Net::IP convert ip to int by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2017-11-25 08:59 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (355 votes). Check out past polls.