in reply to Re: Generating and storing regexp
in thread Generating and storing regexp

AFAICT, Storable can't store regexes. At least I do get "Can't store REGEXP items at ..." when I try to run your code.  (Also listed under BUGS in the docs)

(Storable 2.22 that comes with Perl 5.12.2)

Replies are listed 'Best First'.
Re^3: Generating and storing regexp
by educated_foo (Vicar) on Feb 20, 2011 at 17:58 UTC
    Iinteresting...
    $ perl -MStorable -le 'print $Storable::VERSION, " ", $^V' 2.25 v5.10.0 $ perl -MStorable -le 'store { x => qr/x/ }, "/tmp/x"; $x = retrieve " +/tmp/x"; print $x->{x}' Regexp=SCALAR(0x10082e9f0) $ perl -MStorable -le 'store { x => qr/x/ }, "/tmp/x"; $x = retrieve " +/tmp/x"; print qq{!${$x->{x}}!}' !!
    So the latest Storable *pretends* to store it, but in fact gives you garbage. Cute.
Re^3: Generating and storing regexp
by noodleish (Novice) on Feb 20, 2011 at 17:27 UTC

    I can confirm that. Found out the hard way... :)