File Coverage

blib/lib/Crypt/Passwd.pm
Criterion Covered Total %
statement 9 19 47.3
branch 0 6 0.0
condition n/a
subroutine 3 4 75.0
pod n/a
total 12 29 41.3


line stmt bran cond sub pod time code
1             package Crypt::Passwd;
2              
3             ########
4             # Crypt::Passwd - Perl 5 Interface for the UFC Crypt library
5             #
6             # Luis E. Munoz, lem@true.net
7             ########
8              
9 1     1   996 use strict;
  1         2  
  1         29  
10 1     1   5 use Carp;
  1         2  
  1         99  
11 1     1   5 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
  1         13  
  1         296  
12              
13             require Exporter;
14             require DynaLoader;
15              
16             @ISA = qw(Exporter DynaLoader);
17             # Items to export into callers namespace by default. Note: do not export
18             # names by default without a very good reason. Use EXPORT_OK instead.
19             # Do not simply export all your public functions/methods/constants.
20             @EXPORT = qw(unix_std_crypt unix_ext_crypt);
21             $VERSION = '0.03';
22              
23             sub AUTOLOAD {
24             # This AUTOLOAD is used to 'autoload' constants from the constant()
25             # XS function. If a constant is not found then control is passed
26             # to the AUTOLOAD in AutoLoader.
27              
28 0     0     my $constname;
29 0           ($constname = $AUTOLOAD) =~ s/.*:://;
30 0 0         my $val = constant($constname, @_ ? $_[0] : 0);
31 0 0         if ($! != 0) {
32 0 0         if ($! =~ /Invalid/) {
33 0           $AutoLoader::AUTOLOAD = $AUTOLOAD;
34 0           goto &AutoLoader::AUTOLOAD;
35             }
36             else {
37 0           croak "Your vendor has not defined Crypt::Passwd macro $constname";
38             }
39             }
40 0           eval "sub $AUTOLOAD { $val }";
41 0           goto &$AUTOLOAD;
42             }
43              
44             bootstrap Crypt::Passwd $VERSION;
45              
46             # Preloaded methods go here.
47              
48             # Autoload methods go after =cut, and are processed by the autosplit program.
49              
50             1;
51             __END__