« blib/lib/Perlmazing/Perlmazing/get_aes_cipher.pm
↑ Summary
lib/Perlmazing/Perlmazing/Precompile/merge.pm »
| 1 | 1 | ▶ | use Perlmazing; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | sub main { | ||||||||
|
Subroutine
main: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||
| 4 | 1 | ▶ | if (wantarray) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 5 | 0 | return CORE::stat $_[0]; | |||||||||
| 6 | } else { | ||||||||||
| 7 | 1 | return Perlmazing::Object::Stat->new($_[0]); | |||||||||
| 8 | } | ||||||||||
| 9 | } | ||||||||||
| 10 | |||||||||||
| 11 | package Perlmazing::Object::Stat; | ||||||||||
| 12 | 1 | ▶ | use Perlmazing; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use overload fallback => 1, '""' => \&_stringify; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | our $AUTOLOAD; | ||||||||||
| 15 | |||||||||||
| 16 | # These are just respecting the name given in the Perldoc for convienience: | ||||||||||
| 17 | my @keys = qw( | ||||||||||
| 18 | dev | ||||||||||
| 19 | ino | ||||||||||
| 20 | mode | ||||||||||
| 21 | nlink | ||||||||||
| 22 | uid | ||||||||||
| 23 | gid | ||||||||||
| 24 | rdev | ||||||||||
| 25 | size | ||||||||||
| 26 | atime | ||||||||||
| 27 | mtime | ||||||||||
| 28 | ctime | ||||||||||
| 29 | blksize | ||||||||||
| 30 | blocks | ||||||||||
| 31 | ); | ||||||||||
| 32 | |||||||||||
| 33 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
| |||||||||||
| 34 | 1 | my $self = shift; | |||||||||
| 35 | 1 | my $file = shift; | |||||||||
| 36 | 1 | my @stat = CORE::stat $file; | |||||||||
| 37 | 1 | ▶ | return unless @stat; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 1 | my $this = {}; | |||||||||
| 39 | 1 | ▶ | for (my $i = 0; $i < @stat; $i++) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 13 | $this->{$keys[$i]} = $stat[$i]; | |||||||||
| 41 | } | ||||||||||
| 42 | 1 | bless $this, $self; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 1 | ▶ | sub _stringify { | ||||||||
|
Subroutine
_stringify: called CC=3 SCAR=11.1
| |||||||||||
| 46 | 1 | my $self = shift; | |||||||||
| 47 | 1 | my $string = ''; | |||||||||
| 48 | 1 | for my $i (@keys) { | |||||||||
| 49 | 1 | ▶ | return 1 if defined $self->{$i}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | } | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 1 | ▶ | sub _keys { | ||||||||
|
Subroutine
_keys: called CC=1 SCAR=0.0
| |||||||||||
| 54 | 1 | my @copy = @keys; | |||||||||
| 55 | 1 | return @copy; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: not called CC=2 SCAR=17.9
| |||||||||||
| 59 | 0 | (my $name = $AUTOLOAD) =~ s/^.+:://; | |||||||||
| 60 | 0 | my $self = shift; | |||||||||
| 61 | 0 | ▶ | if (exists $self->{$name}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 0 | return $self->{$name}; | |||||||||
| 63 | } else { | ||||||||||
| 64 | 0 | my @call = caller; | |||||||||
| 65 | 0 | die qq[Can't locate object method "$name" via package "].__PACKAGE__.qq[" at $call[1] line $call[2].\nTip: valid methods are ].join(', ', @keys)."\n"; | |||||||||
| 66 | } | ||||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | 0 | ▶ | sub DESTROY {} | ||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||
| 70 | |||||||||||
| 71 | 1; | ||||||||||