Neither script produces error messages. I added some debugging statements inside prefs.pm so I could see the execution flow (and fixed the newval statement):

pref.pm
package prefs; use strict; use Config::IniFiles; our @ISA = qw( Config::IniFiles ); sub new { my $self = shift; my $class = (ref $self) || $self; print "creating $class\n"; my $fname = 'fubar.ini'; my $obj; if (-f $fname) { $obj = $self->SUPER::new( -file => $fname ); } else { $obj = $self->SUPER::new(); $obj->SetFileName( $fname ); $obj->newval('fubar', 'var1', 'default'); } return bless($obj, $class); } sub DESTROY { my $self = shift; $self->RewriteConfig(); print "destroying $self\n"; $self->SUPER::DESTROY(@_); } 1;
Here is the output:

C:\>t1.pl creating prefs destroying prefs=HASH(0x224fc4) C:\>dir Directory of C:\ 05/26/2005 03:58 PM 23 fubar.ini 05/26/2005 03:55 PM 646 prefs.pm 05/25/2005 12:33 PM 78 t1.pl 05/25/2005 12:34 PM 79 t2.pl C:\>t2.pl creating prefs C:\>dir Directory of C:\ 05/26/2005 03:58 PM 23 fubar.ini 05/26/2005 03:58 PM 9 fubar.ini-new 05/26/2005 03:55 PM 646 prefs.pm 05/25/2005 12:33 PM 78 t1.pl 05/25/2005 12:34 PM 79 t2.pl C:\>del fubar* C:\>dir Directory of C:\ 05/26/2005 03:55 PM 646 prefs.pm 05/25/2005 12:33 PM 78 t1.pl 05/25/2005 12:34 PM 79 t2.pl C:\>t2.pl creating prefs destroying prefs=HASH(0x224fc4) C:\>dir Directory of C:\ 05/26/2005 03:59 PM 23 fubar.ini 05/26/2005 03:55 PM 646 prefs.pm 05/25/2005 12:33 PM 78 t1.pl 05/25/2005 12:34 PM 79 t2.pl C:\>t1.pl creating prefs destroying prefs=HASH(0x18245c4) C:\>dir Directory of C:\ 05/26/2005 03:59 PM 23 fubar.ini 05/26/2005 03:55 PM 646 prefs.pm 05/25/2005 12:33 PM 78 t1.pl 05/25/2005 12:34 PM 79 t2.pl

I am using Perl 5.8.6 on Win32 (Windows XP) with Config::IniFiles 2.38. I am able to reproduce the same problem on Solaris 8 with Perl 5.8.0 and Config::IniFiles 2.38.

In reply to Re^2: my VS. our by lathropr
in thread my VS. our by lathropr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.