Skip Menu |

This queue is for tickets about the Net-IP CPAN distribution.

Report information
The Basics
Id: 101957
Status: open
Priority: 0/
Queue: Net-IP

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.26
Fixed in: (no value)



Subject: Please add equals method
Would be nice if this was supported and printed "Yes": #!/usr/bin/env perl use Net::IP; my $ip = Net::IP->new('180.020.200.200'); # NB 020 if($ip->equals('180.20.200.200')) { # NB 20 print "Yes\n"; } else { print "No\n"; }
On 2015-02-05 14:53:34, NHORNE wrote: Show quoted text
> Would be nice if this was supported and printed "Yes": > > #!/usr/bin/env perl > > use Net::IP; > > my $ip = Net::IP->new('180.020.200.200'); # NB 020 > > if($ip->equals('180.20.200.200')) { # NB 20 > print "Yes\n"; > } else { > print "No\n"; > }
operator overloading would be very handy here too: print "yes\n" if Net::IP->new('180.020.200.200') == Net::IP->new('180.20.200.200');