-----Original Message----- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Christian Walde Sent: 23 February 2011 15:57 To: perl-win32-users@listserv.activestate.com Subject: Re: spurious deaths in script execution due to read-only Config?
... > Try reading the whole bug i linked. It has a detailed description of what happens and when and where the > offending error is triggered and how it can be prevented. > > Summary: > > Grep makes $_ point at $Config{foo}, on first load ActivePerl::Config tries to load File::Basename, which > triggers Exporter.pm, which goes "local $_". At THAT point an attempt to autovivify is made causing the whole > thing to crash down. > > Solution: Make sure $_ isn't pointing at %Config when Exporter.pm happens. This can be done as simple as this: > > map { require ActiveState::Path } 1; > > (Though i'm sure more elegant solutions exist.) Right, I hadn't followed that link. I do recall 'perldoc perlsub' warning about localising tied hashes & arrays being broken, and %Config::Config is a tied hash, I believe. Regarding your work around. Map in a void context is usually frowned upon. Perhaps grep or possibly ... for ('now') { require ActiveState::Path } ... should have the same effect, i.e. aliasing $_ to something (hopefully) innocuous. HTH -- Brian Raven Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs