in reply to WWW::Mechanize::PhantomJS - can't exec "phantomjs"

After some digging, I found the solution. It turns out that while cygwin can call windows executables, the POSIX-style pathnames that cygwin uses (e.g. /home/user/hello.js) must first be converted to Windows-compatible paths (e.g. C:\cygdrive\cygwin64\home\user\hello.js) using the cygpath utility. Here is the actual code I had to use:

my $mech = WWW::Mechanize::PhantomJS->new( launch_ghostdir => '"`cygpath -w /usr/lib/perl5/site_perl/5.14/WWW +/Mechanize/PhantomJS/ghostdriver/main.js`"', );


I'm not sure why I need both double quotes and backticks to make it work, but that's what the example I found used, so I went with it. I decided to update this post because I hate searching and finding the exact issue I am having with no solution posted. Hopefully someone finds this information useful someday.