BSON::Code - JavaScript code data for BSON
version 0.12
use BSON; my $code = BSON::Code->new(q[ function be_weird(a) { if ( a > 20 ) { alert("It's too big!") } return function(b){ alert(b) } } ]);
This module is needed for BSON and it manages BSON's code element.
Main constructor which takes two parameters: A string with JavaScript code and an optional hashref with scope.
my $code = BSON::Code->new($js_code, { a => 6, b => 14 });
Returns the JavaScript code.
Returns the scope hashref.
Returns the length of the JavaScript code.
BSON
minimalist <minimalist@lavabit.com>
David Golden <david@mongodb.com>
This software is Copyright (c) 2015 by minimalist and MongoDB, Inc..
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install BSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BSON
CPAN shell
perl -MCPAN -e shell install BSON
For more information on module installation, please visit the detailed CPAN module installation guide.