samwyse has asked for the wisdom of the Perl Monks concerning the following question:
The following doesn't generate any errors, but if it's changing the time stamps then something's changing them back immediately. Can anyone help?
This is perl, v5.8.8 built for aix-thread-multi, if it matters.#!/usr/bin/perl -pi.bak # Strip DOS CR chars, hopefully without affecting mtime s/\cM//g; if (eof) { @times = (stat($ARGV.$^I))[8,9]; close ARGV; utime @times, $ARGV or warn; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Is there any way to successfully use utime in a -pi loop? (ARGVOUT)
by tye (Sage) on Jul 23, 2012 at 21:20 UTC | |
by samwyse (Scribe) on Jul 23, 2012 at 23:41 UTC |
Back to
Seekers of Perl Wisdom