You can use B::Deparse to create a string from a coderef that you can then eval back to the coderef again.
The latest version of Data::Dumper can do this for you. Take a look at the $Data::Dumper::Deparse switch.
In reply to Re: save to file: $h{'sub'}=sub{..};
by adrianh
in thread save to file: $h{'sub'}=sub{..};
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |