# do an alert
safari_js 'alert("Hello Safari User")';
# return some value
var $arrayref = safari_js 'return [1,2,3]';
# multiple lines are okay
var fred = "bob";
# You can set variables to pass in
safari_js 'return document.getElementById(id).href', id => "mainlink";
Functions are exported on request, or may be called fully qualified.
This script may safely contain newlines, unicode characters, comments etc. Any line numbers in error messages should match up with error messages
You may pass in named parameters by passing them as name/value pairs
safari_js $js_code_to_run, name1 => $value1, name2 => $value2, ...
The parameters are simply availble as variables in your code.
Written by Mark Fowler <firstname.lastname@example.org>
Copryright Mark Fowler 2011. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Some pages (e.g. http://developer.apple.com/) cause array stringifcation to break. I haven't worked out why yet.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.