[Templates] segmentation fault

Mark D. Anderson mda@discerning.com
Sat, 25 Oct 2003 14:07:38 -0700


David Dyer-Bennet wrote:

> "Mark D. Anderson" <mda@discerning.com> writes:
> 
> 
>>I've run into this in perl 5.6 (not perl 5.8) before as well.
>>It typically seems to happen when $1 is bound in a lexical context
>>where it is already bound.
>>I've had to work around by doing things like:
>>   my ($fname) = ($aif->{fpath} =~ /\/encyclopedia\/(.*)\/index\.html$/ );
>>   if ($fname) {
>>             print "foo $fname";
> 
> 
> That appears to work, at least in the test case.  But I don't have the
> slightest understanding of *how* it works!  How does $fname end up
> bound to the paren contents?  Is this in the perldoc anywhere?

Yes, "perldoc perlop", and just about any Perl book, frankly.

> 
> Is perl 5.8 a reasonably safe upgrade from 5.6?

Yes.
Furthermore, if you do it right you can take advantage of automatic
fallback in 5.8 to available modules you've installed for 5.6.
But I'm not about to try to explain how to do that, or how it works :).

-mda