Skip to content

Instantly share code, notes, and snippets.

@MadMartigan
Created February 8, 2013 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadMartigan/4739145 to your computer and use it in GitHub Desktop.
Save MadMartigan/4739145 to your computer and use it in GitHub Desktop.
Undefined first element on arrayref insert
my $arrayref;
for ( 1..5 ) {
push(@$arrayref, $_);
}
$collection->insert({arrayref => $arrayref});
> db.test.find().pretty();
{
"_id" : ObjectId("511502d0acd47abc56010000"),
"arrayref" : [
undefined,
1,
2,
3,
4,
5
]
}
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment