Authen-Quiz
view release on metacpan or search on metacpan
inc/File/Slurp.pm view on Meta::CPAN
if ( ref $file_name ) {
# slurping a handle so use it and don't open anything.
# set the block size so we know it is a handle and read that amount
$read_fh = $file_name ;
$blk_size = $args{'blk_size'} || 1024 * 1024 ;
$size_left = $blk_size ;
# DEEP DARK MAGIC. this checks the UNTAINT IO flag of a
# glob/handle. only the DATA handle is untainted (since it is from
# trusted data in the source file). this allows us to test if this is
# the DATA handle and then to do a sysseek to make sure it gets
# slurped correctly. on some systems, the buffered i/o pointer is not
# left at the same place as the fd pointer. this sysseek makes them
# the same so slurping with sysread will work.
eval{ require B } ;
if ( $@ ) {
inc/Test/Pod/Coverage.pm view on Meta::CPAN
push @queue, map "$file/$_", @newfiles;
}
if ( -f $file ) {
next unless $file =~ /\.pm$/;
my @parts = File::Spec->splitdir( $file );
shift @parts if @parts && exists $starters{$parts[0]};
shift @parts if @parts && $parts[0] eq "lib";
$parts[-1] =~ s/\.pm$// if @parts;
# Untaint the parts
for ( @parts ) {
if ( /^([a-zA-Z0-9_\.\-]+)$/ && ($_ eq $1) ) {
$_ = $1; # Untaint the original
}
else {
die qq{Invalid and untaintable filename "$file"!};
}
}
my $module = join( "::", @parts );
push( @modules, $module );
}
} # while
return @modules;
}
( run in 0.363 second using v1.01-cache-2.11-cpan-4e96b696675 )