~ubuntu-branches/ubuntu/trusty/libnet-dns-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/Net/DNS/RR/A.pm

  • Committer: Bazaar Package Importer
  • Author(s): Florian Hinzmann
  • Date: 2006-03-31 18:51:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060331185136-gpxyhfnnnt9f9b1n
Tags: 0.57-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package Net::DNS::RR::A;
2
2
#
3
 
# $Id: A.pm 388 2005-06-22 10:06:05Z olaf $
 
3
# $Id: A.pm 546 2005-12-16 15:23:03Z olaf $
4
4
#
5
5
use strict;
6
6
BEGIN { 
13
13
use Socket;
14
14
 
15
15
@ISA     = qw(Net::DNS::RR);
16
 
$VERSION = (qw$LastChangedRevision: 388 $)[1];
 
16
$VERSION = (qw$LastChangedRevision: 546 $)[1];
17
17
 
18
18
sub new {
19
19
        my ($class, $self, $data, $offset) = @_;
28
28
sub new_from_string {
29
29
        my ($class, $self, $string) = @_;
30
30
 
31
 
        if ($string && ($string =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)\s*$/)
 
31
        if ($string && ($string =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)\s*$/o)
32
32
            && ($1 >= 0) && ($1 <= 255)
33
33
            && ($2 >= 0) && ($2 <= 255)
34
34
            && ($3 >= 0) && ($3 <= 255)