On Thu, Sep 06, 2001 at 10:09:28AM +0800, Stas Bekman wrote:
> On Wed, 5 Sep 2001, Doug MacEachern wrote:
> 
> > On Sun, 2 Sep 2001, Stas Bekman wrote:
> >
> > > File::Compare is quite useless. We need to compare a variable against the
> > > file.
> >
> > then use 'eq', really, i just don't see a need for checksums here.
> > but File::Compare should be usable, if changes to the header are made so
> > date is not included, so you can do something like:
> > generate FunctionTable.pm.new
> > if different mv FileTable.pm.new FunctionTable.pm
> > else unlink FunctionTable.pm.new
> >
> > see also mv-if-diff usage in Perl's build.
> 
> OK, but that will work only if we take the date string out of
> autogenerated file and put it into a .info file. Is that OK?

Howsabout

   my $new = $new_file_contents ;
   my $old = slurp $file_name

   s/\d\d\d\d(.\d\d){5}// for ( $new, $old ) ;

   if ( $new ne $old ) {
       write $file_name, $new_file_contents ;
   }

or am I missing something?

- Barrie

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to