Calendar-Schedule
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
url => 'https://github.com/vkeselj/calendar-schedule.git',
web => 'https://github.com/vkeselj/calendar-schedule',
}}}):() ));
open(M, ">>Makefile") or die;
if ( -f 'priv.make' ) { print M &getfile('priv.make') }
close(M);
sub getfile($) {
my $f = shift;
local *F;
open(F, "<$f") or die "getfile:cannot open $f:$!";
my @r = <F>;
close(F);
return wantarray ? @r : join ('', @r);
}
Schedule.pm view on Meta::CPAN
my $row = shift;
my $overlap = shift; $overlap = 0 if !defined($overlap);
my $ret = $overlap > 0 ? $epr->{$col, $row, $overlap} : $epr->{$col, $row};
return defined($ret) ? $ret : '';
}
=pod
=cut
sub _getfile($) {
my $f = shift;
local *F;
open(F, "<$f") or die "getfile:cannot open $f:$!";
my @r = <F>;
close(F);
return wantarray ? @r : join ('', @r);
}
1;
__END__
t/test-lib.pl view on Meta::CPAN
#!/usr/bin/perl
# Testing library
sub my_mkdir {
for my $d (@_) { next if -d $d;
mkdir $d, 0700 or die "can't mkdir $d: $!" } }
sub getfile($) {
my $f = shift;
local *F;
open(F, "<$f") or die "getfile:cannot open $f:$!";
my @r = <F>;
close(F);
return wantarray ? @r : join ('', @r);
}
sub putfile($@) {
my $f = shift;
local *F;
open(F, ">$f") or die "putfile:cannot open $f:$!";
print F '' unless @_;
while (@_) { print F shift(@_) }
close(F);
}
1;
( run in 0.295 second using v1.01-cache-2.11-cpan-1f129e94a17 )