← Index
NYTProf Performance Profile   « line view »
For Makefile.PL
  Run on Sun Mar 1 16:04:44 2015
Reported on Sun Mar 1 16:09:02 2015

FilenameC:/tmp64ng/perl/vendor/lib/Portable/HomeDir.pm
StatementsExecuted 22 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1110s0sPortable::HomeDir::::BEGIN@5Portable::HomeDir::BEGIN@5
1110s0sPortable::HomeDir::::BEGIN@6Portable::HomeDir::BEGIN@6
1110s0sPortable::HomeDir::::BEGIN@7Portable::HomeDir::BEGIN@7
1110s0sPortable::HomeDir::::BEGIN@8Portable::HomeDir::BEGIN@8
1110s0sPortable::HomeDir::::CORE:sortPortable::HomeDir::CORE:sort (opcode)
0000s0sPortable::HomeDir::::_SELFPortable::HomeDir::_SELF
0000s0sPortable::HomeDir::::applyPortable::HomeDir::apply
0000s0sPortable::HomeDir::::my_dataPortable::HomeDir::my_data
0000s0sPortable::HomeDir::::my_documentsPortable::HomeDir::my_documents
0000s0sPortable::HomeDir::::my_homePortable::HomeDir::my_home
0000s0sPortable::HomeDir::::my_musicPortable::HomeDir::my_music
0000s0sPortable::HomeDir::::my_picturesPortable::HomeDir::my_pictures
0000s0sPortable::HomeDir::::my_videosPortable::HomeDir::my_videos
1110s0sPortable::HomeDir::::newPortable::HomeDir::new
0000s0sPortable::HomeDir::::platformPortable::HomeDir::platform
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Portable::HomeDir;
2
3# In the trivial case, only my_home is implemented
4
520s10s
# spent 0s within Portable::HomeDir::BEGIN@5 which was called: # once (0s+0s) by Portable::new at line 5
use 5.008;
# spent 0s making 1 call to Portable::HomeDir::BEGIN@5
620s20s
# spent 0s within Portable::HomeDir::BEGIN@6 which was called: # once (0s+0s) by Portable::new at line 6
use strict;
# spent 0s making 1 call to Portable::HomeDir::BEGIN@6 # spent 0s making 1 call to strict::import
720s20s
# spent 0s within Portable::HomeDir::BEGIN@7 which was called: # once (0s+0s) by Portable::new at line 7
use warnings;
# spent 0s making 1 call to Portable::HomeDir::BEGIN@7 # spent 0s making 1 call to warnings::import
820s10s
# spent 0s within Portable::HomeDir::BEGIN@8 which was called: # once (0s+0s) by Portable::new at line 8
use Portable::FileSpec;
# spent 0s making 1 call to Portable::HomeDir::BEGIN@8
9
1010sour $VERSION = '1.22';
11
12#####################################################################
13# Portable Driver API
14
15
# spent 0s within Portable::HomeDir::new which was called: # once (0s+0s) by Portable::new at line 164 of Portable.pm
sub new {
1610s my $class = shift;
1710s my $parent = shift;
1810s20s unless ( Portable::_HASH($parent->portable_homedir) ) {
# spent 0s making 1 call to Portable::_HASH # spent 0s making 1 call to Portable::portable_homedir
19 die('Missing or invalid HomeDir key in portable.perl');
20 }
21
22 # Create the object
2310s my $self = bless { }, $class;
24
25 # Map the
2610s10s my $homedir = $parent->portable_homedir;
# spent 0s making 1 call to Portable::portable_homedir
2710s10s my $root = $parent->dist_root;
# spent 0s making 1 call to Portable::dist_root
2810s10s foreach my $key ( sort keys %$homedir ) {
# spent 0s making 1 call to Portable::HomeDir::CORE:sort
2920s unless (
30 defined $homedir->{$key}
31 and
32 length $homedir->{$key}
33 ) {
34 $self->{$key} = $homedir->{$key};
35 next;
36 }
3720s20s $self->{$key} = Portable::FileSpec::catdir(
# spent 0s making 2 calls to Portable::FileSpec::catdir, avg 0s/call
38 $root, split /\//, $homedir->{$key}
39 );
40 }
41
4210s return $self;
43}
44
45sub apply {
46 my $self = shift;
47
48 # Shortcut if we've already applied
49 if ( $File::HomeDir::IMPLEMENTED_BY eq __PACKAGE__ ) {
50 return 1;
51 }
52
53 # Load File::HomeDir and the regular platform driver
54 require File::HomeDir;
55
56 # Remember the platform we're on so we can default
57 # to it properly if there's no portable equivalent.
58 $self->{platform} = $File::HomeDir::IMPLEMENTED_BY;
59
60 # Hijack the implementation class to us
61 $File::HomeDir::IMPLEMENTED_BY = __PACKAGE__;
62
63 return 1;
64}
65
66sub platform {
67 $_[0]->{platform};
68}
69
- -
74#####################################################################
75# File::HomeDir::Driver API
76
77sub _SELF {
78 ref($_[0]) ? $_[0] : Portable->default->homedir;
79}
80
81sub my_home {
82 _SELF(@_)->{my_home};
83}
84
85# The concept of "my_desktop" is incompatible with the idea of
86# a Portable Perl distribution (because Windows won't overwrite
87# the desktop with anything on the flash drive)
88# sub my_desktop
89
90sub my_documents {
91 _SELF(@_)->{my_documents};
92}
93
94sub my_music {
95 _SELF(@_)->{my_music};
96}
97
98sub my_pictures {
99 _SELF(@_)->{my_pictures};
100}
101
102sub my_videos {
103 _SELF(@_)->{my_videos};
104}
105
106sub my_data {
107 _SELF(@_)->{my_data};
108}
109
11010s1;
 
# spent 0s within Portable::HomeDir::CORE:sort which was called: # once (0s+0s) by Portable::HomeDir::new at line 28
sub Portable::HomeDir::CORE:sort; # opcode