All pastes #336359 Raw Edit

Stuff

public text v1 · immutable
·published 2007-02-02 00:07 UTC
rendered paste body
package SM::Constants;

use strict;
use warnings;

use base Exporter;

# This begin block loads a hash with constants and their values. The format is
# the same  as an argument to  us constant.
# ie: use constant DATA_Location => 0x80;

BEGIN {
    our %h = (

        # Constant declarations

        # Packet data type constants
        DATA_OUT_Location => 0x80,
        DATA_IN_Location  => 0x00,

        # Packet sub type constants
        DATA_SUB_Initial => 0x00,

        # General terms
        IN  => 0,
        OUT => 1,
    );
}

# Load all our constants into the local namespace
use constant \%h;

# Export all the constants
@EXPORT = keys %h;

1;