vladb has asked for the wisdom of the Perl Monks concerning the following question:
Try uncommenting either of the two lines marked # CORE DUMP and the script will core dump.use strict; open(IN,"page.html"); $/ = undef; my $content = <IN>; close(IN); print "size: ". length($content) ."\n"; # either of the two regexp cause seg fault! # $content =~ s/^Set-Cookie: .*$//mgi; # CORE DUMP # Also trying to remove the /g option here. # Still core dumps. # $content =~ s/^Set-Cookie: .*$//mi; # CORE DUMP # these work fine though... $content =~ s/^Cache-Control: .*$//mi; # OK print "Done.\n";
I'm also puzzled over why the second CORE DUMP line still fails when I remove the /g regexp option? As I look at the OK line and compare it to the CORE DUMP line just above it (also without the /g option), I hardly note any startling difference.size: 67877 Segmentation fault (core dumped)
| "There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mystereous regexp core dump
by gellyfish (Monsignor) on Mar 25, 2002 at 22:20 UTC | |
|
Re: Mystereous regexp core dump
by talexb (Chancellor) on Mar 25, 2002 at 22:11 UTC | |
|
Re: Mystereous regexp core dump
by IlyaM (Parson) on Mar 25, 2002 at 22:30 UTC |