How can I convert the stringified version of array reference to actual array reference in Perl?

前端 未结 6 575
南笙
南笙 2020-11-29 11:11

Is there any way to get Perl to convert the stringified version e.g (ARRAY(0x8152c28)) of an array reference to the actual array reference?

For example



        
6条回答
  •  盖世英雄少女心
    2020-11-29 11:53

    The first question is: do you really want to do this?

    Where is that string coming from?

    If it's coming from outside your Perl program, the pointer value (the hex digits) are going to be meaningless, and there's no way to do it.

    If it's coming from inside your program, then there's no need to stringify it in the first place.

提交回复
热议问题