#!/usr/bin/perl -w
use strict;
use WWW::Mechanize::PhantomJS;
my $mech = WWW::Mechanize::PhantomJS->new();
$mech->get('http://google.com');
$mech->eval_in_page('alert("Hello PhantomJS")');
my $png= $mech->content_as_png();
####
./phantomjs_test.pl
Can't exec "phantomjs": No such file or directory at /usr/lib/perl5/site_perl/5.14/WWW/Mechanize/PhantomJS.pm line 131.
Couldn't launch [| phantomjs /usr/lib/perl5/site_perl/5.14/WWW/Mechanize/PhantomJS/ghostdriver/main.js --port=8910 --logLevel=OFF]: No such file or directory / 0 at /usr/lib/perl5/site_perl/5.14/WWW/Mechanize/PhantomJS.pm line 131.
####
$options{ pid } = open my $fh, $cmd
####
my $cmd= "| $options{ launch_exe } $options{ launch_ghostdir } @{ $options{ launch_arg } }";