"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
\@{$ref} is the same as $ref, because @{$ref} accesses the array that $ref points to, and adding a \ gets the same reference. While accessing @_ inside a function does work, I think you should put your arguments in variable (which should be done when @_ isn't a list of similar things but each argument has its own meaning. So: (and basically replace every use of $_[0] by $ref, and $_[1] by $depth). foreach my $item (keys %{$_[0]}){ repl_mongo($key,$_[1]-1 ); } The loop variable is $item, but you access $key. Do you have strict on? It should have told you about that. And for the date conversion, after you have found that a string starts with ISODate (that's index exactly 0 by the way) you can use substr to extract the date part (which will always be at the same positions, starting from the 8th character). In reply to Re: iterating through json decode
by Eily
|
|