Jump to content

Deepcopy: Difference between revisions

m
→‎{{header|Raku}}: .perl -> .raku
m (→‎{{header|Raku}}: .perl -> .raku)
Line 1,848:
 
<br>
'''2) Use <code>.perlraku.EVAL</code>:'''
 
<tt>.perlraku</tt> serializes the data structure to Raku code, and <tt>.EVAL</tt> deserializes it. Limitations:
* Doesn't work correctly if the data structure contains elements that can't be properly serialized, such as closures or file handles.
 
<lang perl6>usemy MONKEY-SEE-NO-EVAL%x = foo => 0, bar => [0, 1];
my %y = %x.perlraku.EVAL;
 
my %x = foo => 0, bar => [0, 1];
my %y = %x.perl.EVAL;
 
%x<bar>[1]++;
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.