Printing out the code of an anonymous subroutine

前端 未结 4 2053
挽巷
挽巷 2021-02-05 12:56

I\'m currently working in a very complex Perl architecture, and I want to create some debugging tools. Since a lot of the behavior involves anonymous subroutines, I\'d like to a

4条回答
  •  感动是毒
    2021-02-05 13:45

    Also, Devel::Dwarn sets Data::Dumper so it deparses by default. It quickly made it my favourite dumper:

    perl -MDevel::Dwarn -e "Dwarn { callback => sub { 1+1 } }"
    

    gives

    {
      callback => sub {
          2;
      }
    }
    

提交回复
热议问题