HTML-Pen
view release on metacpan or search on metacpan
lib/HTML/Pen.pm view on Meta::CPAN
sub defaultdocs {
return filePath( @_ ) ;
}
sub filePath {
return join '/', @_ if $_[0] =~ m|^/| ;
return join '/', $pen->{path}, @_ ;
}
sub fromFQPath {
my @path = split m|/|, pathHack( $_[0] ) ;
my $fn = pop @path ;
my $path = join '/', @path ;
return ( $path, $fn ) ;
}
sub include {
my $fn = shift ;
my $skip = @_? shift @_: 0 ;
## hopefully something else barks first...
lib/HTML/Pen/Utils.pm view on Meta::CPAN
our @ISA = qw(Exporter);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# This allows declaration use Contessa::Demo ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' =>
[ qw( split memstat mymkdir imagefile randomize ) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw( );
our $VERSION = '0.01';
sub mysplit {
my $pat = shift ;
my $t = shift ;
return ( $t ) if ref $t eq 'SCALAR' ;
return () if ref $t ;
lib/HTML/Pen/Utils.pm view on Meta::CPAN
my $next = shift ;
return mymkdir( join( '/', $dir, $next ), @_ ) ;
}
sub imagefile {
my $fn = shift ;
my $buff = shift ;
$fn =~ s|^/|| ;
my @fn = split m|/|, $fn ;
pop @fn ;
mymkdir( @fn ) ;
open $f, "> $fn" ;
print $f $buff ;
close $f ;
}
sub randomize {
# srand() ;
( run in 1.124 second using v1.01-cache-2.11-cpan-71847e10f99 )