| BSON::Code - JavaScript code data for BSON |
BSON::Code - JavaScript code data for BSON
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 at lavabit.com>
Bug reports and patches are welcome. Reports which include a failing Test::More style test are helpful and will receive priority.
Copyright 2011 minimalist.
This program is free software; you can redistribute it and/or modify it under the terms as perl itself.
| BSON::Code - JavaScript code data for BSON |