LaBrea-Tarpit

 view release on metacpan or  search on metacpan

IANA/build_codes.pl  view on Meta::CPAN

#!/usr/bin/perl
#
# build_codes.pl
# version 1.01 5-7-02, Michael@bizsystems.com
#
# This software is copyright and GPL'd. See the notice in the
# README file for details
#
#  DO NOT RUN THIS SCRIPT IN THIS DIRECTORY
#  IT IS RUN AUTOMATICALLY BY Makefile.PL

die q|DO NOT RUN THIS SCRIPT MANUALLY, IT
IS RUN AUTOMATICALLY BY 'make'
| unless &{$_=sub{(caller)[1]}} eq 'IANA/build_codes.pl';

die "Could not find IANA/protocols"
	unless open(P,'IANA/protocols');

unless (open(I,'IANA/icmp')) {
  close P;
  die "Could not find IANA/icmp";
}

unless (open(C,'>Codes.pm')) {
  close P;
  close I;
  die "Could not create Codes.pm";
}

my $date = scalar localtime(time);

print "Building module 'Codes.pm'\n";

print C <<EOF;
#
# DO NOT EDIT THIS FILE, CHANGES WILL BE LOST
#
# Created by Makefile.PL 
# (IANA/build_codes.pl)
# from	IANA/protocols
# and	IANA/icmp
# $date
#
EOF

print C <<'EOF';
package LaBrea::Codes;
use strict;
use vars qw($VERSION @ISA @EXPORT_OK %prot %pnum %icmp %inum );

$VERSION = do { my @r = (q$Revision: 0.01 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };

require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(
	protocol
	icmp
);

=head1 NAME

  LaBrea::Tarpit::Codes

=head1 SYNOPSIS

  use LaBrea::Tarpit::Codes qw (
	protocol
	icmp
	numeric
  );

  $text	  = protocol(number);
  $number = protocol(text);
  $text   = icmp(number);



( run in 2.635 seconds using v1.01-cache-2.11-cpan-800906f7e73 )