Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Intermittent bug in module: File not getting deleted as expected

by nysus (Vicar)
on Feb 19, 2019 at 19:03 UTC ( #1230190=note: print w/replies, xml ) Need Help??


in reply to Re^2: Intermittent bug in module: File not getting deleted as expected
in thread Intermittent bug in module: File not getting deleted as expected

- M reports the age of the file in days.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

  • Comment on Re^3: Intermittent bug in module: File not getting deleted as expected
  • Download Code

Replies are listed 'Best First'.
Re^4: Intermittent bug in module: File not getting deleted as expected
by tybalt89 (Parson) on Feb 19, 2019 at 19:07 UTC

    From perldoc -f -M

    -M  Script start time minus file modification time, in days.

      Ah, thanks. That makes things perfectly clear.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        BTW, perldoc is wrong, it's not "script start time", it's $^T as shown by the following:

        #!/usr/bin/perl -l # https://perlmonks.org/?node_id=1230174 use strict; use warnings; use Path::Tiny; my $file = 'tmp.1230174'; sleep 2; path($file)->spew("$file\n"); sleep 2; print -M $file; $^T = time; print -M $file;

        Outputs:

        -2.31481481481481e-05 2.31481481481481e-05

        So you can play games with "file age" if you want to.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1230190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2019-06-26 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (110 votes). Check out past polls.

    Notices?