view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CSE.pm view on Meta::CPAN
return JSON::decode_json(File::Slurp::read_file($self->index_dirty_file().'' , { binmode => ':raw' }));
}
sub _build_index_mtime{
my ($self) = @_;
my $st = File::stat::stat($self->index_dir());
return DateTime->from_epoch( epoch => $st->mtime() );
}
sub _build_max_size{
my ($self) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Cache.pm view on Meta::CPAN
return unless $self->enabled;
my $ttl = $self->ttl || 60 * 30; # default ttl of 30 minutes
my $filename = $self->_clean_filename($key);
return undef unless -f $filename;
my $now = time;
my $stat = stat($filename) || die "Error stating $filename: $!";
my $ctime = $stat->ctime;
my $age = $now - $ctime;
if ( $age < $ttl ) {
my $value = retrieve("$filename")
|| die "Error reading from $filename: $!";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Chart/Gtk2/Diagnostics.pm view on Meta::CPAN
$str .= "\n";
if (%mstats) {
$str .= "mstat (Devel::Peek)\n" . hash_format (\%mstats);
} else {
$str .= "(Devel::Peek -- no mstat() in this perl)\n";
}
if (eval { require Devel::Arena; }) {
$str .= "\n";
my $stats = Devel::Arena::sv_stats();
view all matches for this distribution
view release on metacpan or search on metacpan
# On systems where $0 cannot be used to find out
# the file size, one can maybe still use <DATA>
# to determine the size of the file.
use POSIX qw(strftime);
$raw_time = (stat(DATA))[9];
$size = -s DATA;
$kilosize = int($size / 1024) . "k";
print "<P>Script size is $kilosize\n";
print strftime(
"<P>Last script update: %c (%Z)\n", localtime($raw_time)
x => sub { Mojo::DOM->new(@_) };
}
# Download a PDF file using Perl
# Will not download if it is already up to date. (by etag)
perl -Mojo -E "my $q=chr 34; sub get_etag($tx){ $tx->result->headers->etag =~ s/^$q|$q$//gr; } my $ua = Mojo::UserAgent->new; my $url = Mojo::URL->new('https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf'); my $f = $url->path->parts->[-1]; my $t...
# Fetch latest unicode characters (Windows)
perl -CSAD -Mojo -mcharnames -E "my $ua = Mojo::UserAgent->new; my $url = 'https://blog.emojipedia.org/whats-new-in-unicode-10/'; my $tx = $ua->get($url); die qq(Error getting) unless $tx->result->is_success; my $d = $tx->result->dom->find('ul:not([c...
# Fetch latest unicode characters (Linux)
# Download a PDF file using Perl
perl -Mojo -E "my $ua = Mojo::UserAgent->new; my $url = Mojo::URL->new('https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf'); my $f = $url->path->parts->[-1]; my $tx = $ua->get($url)->result->save_to($f)"
# Download a PDF file using Perl
# Will not download if it is already up to date. (by date)
perl -Mojo -E "my $ua = Mojo::UserAgent->new; my $url = Mojo::URL->new('https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf'); my $f = $url->path->parts->[-1]; my $t = (stat($f))[9]; my $d = Mojo::Date->new($t); my $tx = $ua->get($url, {'If-Modi...
# Create a Mojo Websocket and message hooks
perl -Mojo -E "my $ua = Mojo::UserAgent->new; say r $ua->websocket_p('ws://172.17.17.1:80/get_jobs')->then(sub($tx){ my $p = Mojo::Promise->new; $tx->on(finish => sub($tx,$code,$reason){ say qq(Closed with code $code); $p->resolve;}); $tx->on(message...
# Show all the redirects
#############################################################
## Python Modules - datetime
#############################################################
# Get yyyymmmdd format in Python from a integer Epoch string
python -c "import datetime; import os; s=os.stat('version.js'); t=datetime.datetime.fromtimestamp(int(s.st_mtime)).strftime('%Y%m%d%H%M%S'); print(t)"
20210203102701
# Print current time in about YYYYMMDD
python -c "import datetime; print(datetime.date.today().strftime('%Y%m%d'))"
view all matches for this distribution
view release on metacpan or search on metacpan
bin/chronicle view on Meta::CPAN
#
my ( $dev, $ino, $mode, $nlink, $uid,
$gid, $rdev, $size, $atime, $mtime,
$ctime, $blksize, $blocks
)
= stat($file);
#
# Lookup the existing entry
#
bin/chronicle view on Meta::CPAN
}
#
# Sort them into order by mtime.
#
@entries = sort {( stat($a) )[9] <=> ( stat($b) )[9]} @entries;
#
# Now process them, extracting the submitters IP, email,
# etc, etc, from the body of the comment-file.
#
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Codit.pm view on Meta::CPAN
sub lockModified {
my $self = shift;
my $file = $self->configGet('-configfolder') . '/lockfile';
if (-e $file) {
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
my $lmod = $self->{LOCKMODIFIED};
return $lmod ne $mtime if defined $lmod;
}
return ''
}
lib/App/Codit.pm view on Meta::CPAN
my $file = $self->configGet('-configfolder') . '/lockfile';
if (open(LOUT, '>', $file)) {
print LOUT "\n";
close LOUT
}
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
$self->{LOCKMODIFIED} = $mtime;
}
sub lockScan {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/app-apache view on Meta::CPAN
$APACHEBASECONF = "$PREFIX/apache/conf/httpd.conf";
$APACHEBASECONF = "$APACHEROOT/conf/httpd.conf" if (! -f $APACHEBASECONF);
$baseconf_mtime = 0;
if (-f $APACHEBASECONF) {
@stat = stat($APACHEBASECONF);
$baseconf_mtime = $stat[9];
}
$APACHECONF = "$CONFDIR/httpd.conf";
$conf_mtime = 0;
if (-f $APACHECONF) {
@stat = stat($APACHECONF);
$conf_mtime = $stat[9];
}
if ($baseconf_mtime && (!$conf_mtime || ($conf_mtime < $baseconf_mtime))) {
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($conf_mtime);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/dex view on Meta::CPAN
elsif ($type eq 'IO') {
if (defined $value) {
undef $value;
$value->{stat} = {};
if ($value->{fileno} = fileno(*{ $glob })) {
@{ $value->{stat} }{ @stats } = stat(*{ $glob });
$value->{tell} = tell *{ $glob };
}
}
}
$glob{ $type } = $value if defined $value;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DistSync.pm view on Meta::CPAN
my $meta = read_yaml($props{file_meta});
$props{meta} = $meta;
# Create current static dates
$props{mtime_manifest} = (-e $props{file_manifest}) && -s $props{file_manifest}
? (stat($props{file_manifest}))[9]
: 0;
$props{mtime_manidel} = (-e $props{file_manidel}) && -s $props{file_manidel}
? (stat($props{file_manidel}))[9]
: 0;
$props{mtime_mirrors} = (-e $props{file_mirrors}) && -s $props{file_mirrors}
? (stat($props{file_mirrors}))[9]
: 0;
# Read MANIFEST, MANIFEST.SKIP, MANIFEST.DEL files
$props{manifest} = maniread($props{file_manifest});
$props{maniskip} = maniread($props{file_maniskip}, SKIPMODE);
lib/App/DistSync.pm view on Meta::CPAN
my $fdir = File::Spec->canonpath($File::Find::dir);
return if -d $_;
my $key = join("/", File::Spec->splitdir(File::Spec->catfile($name)));
$found->{$key} = {
mtime => (stat($_))[9] || 0,
size => (-s $_) || 0,
dir => $fdir,
path => $path,
file => File::Spec->abs2rel( $path, $fdir ),
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DocKnot/Release.pm view on Meta::CPAN
$current_path->mkpath();
for my $file ($tarball_ref->{files}->@*) {
my $source = $self->{distdir}->child($file);
my $dest = $current_path->child($file);
$source->copy($dest);
my ($atime, $mtime) = $source->stat()->@[8, 9];
push(@times, $mtime);
utime($atime, $mtime, $dest)
or die "cannot reset timestamps of $dest: $!\n";
my $generic_name = $file;
$generic_name =~ s{ \A (\Q$self->{tarname}\E) - v?[\d.]+ [.] }{$1.}xms;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ElasticSearch/Utilities/Aggregations.pm view on Meta::CPAN
version 8.8
=head1 FUNCTIONS
=head2 is_single_stat()
Returns true if an aggregation returns a single value.
=head2 expand_aggregate_string( token )
view all matches for this distribution
view release on metacpan or search on metacpan
my $selected = $log->{selected} ? "*" : " ";
my $size = "-";
my $updated = "";
if (-e $log->{file}) {
$size = human_readable(-s $log->{file});
my $mtime = (stat($log->{file}))[9];
$updated = time_diff_str($mtime, $now);
}
my $file = $log->{file};
my $line = sprintf "%s %-60s %-10s %s", $selected, $file, $size, $updated;
print "$line\n";
for my $log (@logs) {
my $size = "-";
my $updated = "";
if (-e $log->{file}) {
$size = human_readable(-s $log->{file});
my $mtime = (stat($log->{file}))[9];
$updated = datestr($mtime) . " (" . time_diff_str($mtime, $now) . ")";
}
my $vhost = $log->{vhost};
print "$log->{file}\n";
if ($log->{selected}) {
print " format $log->{format}\n";
}
my $rotations = get_rotations($log->{file});
for my $r (@$rotations) {
my $size = human_readable(-s $r->{file});
my $mtime = (stat($r->{file}))[9];
my $updated = datestr($mtime) . " (" . time_diff_str($mtime, $now) . ")";
print " rotation $r->{name} $size $updated\n";
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution