Reputation:
I'm using Perl 5.14.2 on Cygwin, and suddenly it refuses to run the simplest of scripts:
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!\n";
Trying to execute this causes Perl to do absolutely nothing, and neither does $?
contain anything:
Administrator@Windows7 /cygdrive/d/Development/Perl
$ perl helloworld.plx
Administrator@Windows7 /cygdrive/d/Development/Perl
$ echo $?
0
However, I have written more complex scripts earlier, and they do run:
Administrator@Windows7 /cygdrive/d/Development/Perl
$ perl siteinfo.plx
Site info : google.com
________________________________________________________________________________
Whois : ( ... whois info printed here ...)
hpHosts : Not Listed
I really can't understand what is exactly going on here. I've tried reinstalling Perl but with no luck.
Any help is deeply appreciated.
Upvotes: 0
Views: 123
Reputation: 2071
Use B::Deparse to see how perl parses your program
$ perl -MO=Deparse,-p -e ""
-e syntax OK
$ perl -MO=Deparse,-p -e "#!/usr/bin/perl -- die 666; "
-e syntax OK
$ perl -MO=Deparse,-p -e "die 666; "
die(666);
-e syntax OK
Upvotes: 0
Reputation:
The answer to this turns out to be very dumb:
My text editor was set to churn out text files with Macintosh EOL format. Converting it to Unix/Windows format corrects the issue.
However, one thing that I found strange was that Perl would not notify of this issue, and instead it simply did nothing.
Upvotes: 0