in reply to Segmentattion fault

Try using the debugger to step through the code (assuming the debugger doesn't "fix" the problem). Or sprinkle print statements liberally.

One of my quick and dirty methods is to print the file and line number after each executable line:

$x = 14; print STDERR __FILE__ . ':' . __LINE__ . "\n";

-QM
--
Quantum Mechanics: The dreams stuff is made of