| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #+############################################################################## | 
| 2 |  |  |  |  |  |  | #                                                                              # | 
| 3 |  |  |  |  |  |  | # File: No/Worries.pm                                                          # | 
| 4 |  |  |  |  |  |  | #                                                                              # | 
| 5 |  |  |  |  |  |  | # Description: coding without worries                                          # | 
| 6 |  |  |  |  |  |  | #                                                                              # | 
| 7 |  |  |  |  |  |  | #-############################################################################## | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | # | 
| 10 |  |  |  |  |  |  | # module definition | 
| 11 |  |  |  |  |  |  | # | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | package No::Worries; | 
| 14 | 20 |  |  | 20 |  | 47747 | use strict; | 
|  | 20 |  |  |  |  | 57 |  | 
|  | 20 |  |  |  |  | 644 |  | 
| 15 | 20 |  |  | 20 |  | 131 | use warnings; | 
|  | 20 |  |  |  |  | 65 |  | 
|  | 20 |  |  |  |  | 1714 |  | 
| 16 |  |  |  |  |  |  | our $VERSION  = "1.5"; | 
| 17 |  |  |  |  |  |  | our $REVISION = sprintf("%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/); | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | # | 
| 20 |  |  |  |  |  |  | # used modules | 
| 21 |  |  |  |  |  |  | # | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 20 |  |  | 20 |  | 6439 | use Sys::Hostname qw(); | 
|  | 20 |  |  |  |  | 22261 |  | 
|  | 20 |  |  |  |  | 656 |  | 
| 24 | 20 |  |  | 20 |  | 7138 | use No::Worries::Export qw(export_control); | 
|  | 20 |  |  |  |  | 80 |  | 
|  | 20 |  |  |  |  | 157 |  | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | # | 
| 27 |  |  |  |  |  |  | # global variables | 
| 28 |  |  |  |  |  |  | # | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | our($HostName, $ProgramName, $_IntegerRegexp, $_NumberRegexp); | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | # | 
| 33 |  |  |  |  |  |  | # module initialization | 
| 34 |  |  |  |  |  |  | # | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | # we set once for all the host name | 
| 37 |  |  |  |  |  |  | $HostName = Sys::Hostname::hostname() || ""; | 
| 38 |  |  |  |  |  |  | $HostName = lc($HostName); | 
| 39 |  |  |  |  |  |  | $HostName =~ s/\..+$//; | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | # we set once for all the program name | 
| 42 |  |  |  |  |  |  | $ProgramName = $0 || ""; | 
| 43 |  |  |  |  |  |  | $ProgramName =~ s/^.*\///; | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | # private global variables | 
| 46 |  |  |  |  |  |  | $_IntegerRegexp = qr/^\d+$/; | 
| 47 |  |  |  |  |  |  | $_NumberRegexp  = qr/^(\d+\.)?\d+$/; | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | # | 
| 50 |  |  |  |  |  |  | # export control | 
| 51 |  |  |  |  |  |  | # | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | sub import : method { | 
| 54 | 62 |  |  | 62 |  | 175 | my($pkg, %exported); | 
| 55 |  |  |  |  |  |  |  | 
| 56 | 62 |  |  |  |  | 179 | $pkg = shift(@_); | 
| 57 | 62 |  |  |  |  | 369 | grep($exported{$_}++, qw($HostName $ProgramName)); | 
| 58 | 62 |  |  |  |  | 246 | grep($exported{$_}++, qw($_IntegerRegexp $_NumberRegexp)); | 
| 59 | 62 |  |  |  |  | 372 | export_control(scalar(caller()), $pkg, \%exported, @_); | 
| 60 |  |  |  |  |  |  | } | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | 1; | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | __DATA__ |