in reply to Safe HTML output?

The warning about staying shared is an issue with named subs only. (See diagnostics)
The solution is easy: don't use named subs as closures.

# First solution: Put coderefs in scalars and use those my $start = sub { ... }; my $p = HTTP::Parser->new( ..., start_h => [ $start, ... ], ... ); # Second solution: Use coderefs, but don't use scalars to hold them my $p = HTTP::Parser->new( ..., start_h => [ sub { ... # code here }, ... ], end_h => [ sub { ... # code here }, ... ], ... );
HTH.

P.S. Maybe HTML::TokeParser is better for this job.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$