in reply to Re^6: panic: attempt to copy freed scalar a7b9650 to ad20598
in thread panic: attempt to copy freed scalar a7b9650 to ad20598

my $clientref = $job->{clientref} if (exists($job->{clientref}));
my with a statement modifier on the end is generally (almost universally?) a bad thing (unless it's a workaround for a weird issue as in ikegami's post). You probably want something like:
my $clientref = exists($job->{clientref}) ? $job->{clientref} : undef;
Update: Actually, I don't see any reason to not just do (since the value will be undef if the key doesn't exist, and it won't be autovivified in the hash):
my $clientref = $job->{clientref};
Update: ikegami is correct below. His post did not use "my...if...". My bad :-(

Replies are listed 'Best First'.
Re^8: panic: attempt to copy freed scalar a7b9650 to ad20598
by ikegami (Patriarch) on Dec 03, 2009 at 21:16 UTC

    unless it's a workaround for a weird issue as in ikegami's post

    Not only did my post not make use of my ... if ...;, it's always illegal to do so.

Re^8: panic: attempt to copy freed scalar a7b9650 to ad20598
by mje (Curate) on Dec 04, 2009 at 15:57 UTC

    To update ikegami, runrig and BrowserUk. Leaving the code as it was but upgrading from 5.10.0 to 5.10.1 made the panic go away but it was replaced with a Variable "$clientref" is not available. Removing the "if" test when creating $clientref made this warning go away in 5.10.1 and also stopped the panic when I moved back to 5.10.0.

    Many thanks for your help and suggestions.