|
Posted by David Tiberio on October 24, 2004, 10:50 pm
Please log in for more thread options
I am developing a new perl module that uses constants with regular
expressions. What is the proper way to offer this file?
For example, my perl file is compromised of constants such as the
following:
use constant REGEX_SHELL_DATE =>
b(b(b(Sun|Mon|Tue|Wed|Thu|Fri|Sat)b|b(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)b)bsb(b(d|[
0]d|[1][012])b|b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)b|b(January|February|March|April|May|June|July|August|September|October|November|December)b)bs(d)sb(b([
01]d|2[0-3])b:b([0-5]d)b:b([0-5]d)b)bsb([A-Z])bsb(d|d)b)b;
And a programmer would use my constants like so:
my $date = "Mon Oct 25 11:59:13 EDT 2004";
print $1 if $date =~ /@/;
exit();
Should my file, containing constants, be a module or some sort of
include file? How would the programmer "include" the file? I tried it
as a module, but constants are not naturally accessible from a program
calling the module.
|