Astro-App-Satpass2
view release on metacpan or search on metacpan
inc/My/Module/Test/App.pm view on Meta::CPAN
my $app = Astro::App::Satpass2->new();
=head2 same_path
same_path $got, $want, 'Got the same path';
This subroutine implements a test to see if the first two arguments
represent the same file path. On systems that do not support reliable
inode results from C<stat()> (that is, MSWin32 and friends, riscos, and
VMS) the test is simply a comparison of normalized paths. On systems
that support (or are suspected to support) reliable inodes, if the
normalized paths are different the inode numbers are compared.
=head1 METHODS
This module also does some aspect-oriented programming (read: 'violates
encapsulation') by placing the following methods in the
L<Astro::App::Satpass2|Astro::App::Satpass2> name space:
lib/Astro/App/Satpass2/Format/Template/Provider.pm view on Meta::CPAN
my $error;
local *FH;
if(-d $path) {
$error = "$path: not a file";
}
elsif (open(FH, "<", $path)) {
local $/;
binmode(FH, ENCODING);
$data = <FH>;
$mod_date = (stat($path))[9];
close(FH);
}
else {
$error = "$path: $!";
}
return wantarray
? ( $data, $error, $mod_date )
: $data;
}
( run in 0.506 second using v1.01-cache-2.11-cpan-49f99fa48dc )