in reply to Issue with #!usr/bin/perl

That "pesky line" is called a shebang line and you've almost certainly mistyped it: I expect it should be "#!/usr/bin/perl".

I can't see how you're "struggling just to get hello world up and running": you say your code works with it and without it - what problem are you struggling with?

You're no doubt running some perl.exe program (from ActivePerl, Strawberry Perl, or wherever) with hello.pl as an argument - you're possibly achieving that by clicking on an icon. I expect perl.exe is treating the shebang line as a comment because it starts with a "#". Someone with more in-depth knowledge might be able to provide a better (possibly different) answer but, at the end of the day, you can safely ignore it.

I used to run Perl programs from a WinXP box where I had Strawberry Perl and Cygwin. I would leave the shebang line pointing to whatever Perl I had on Cygwin: this allowed me to run the same script without changes from both a Cygwin command line and the WinXP GUI.

I don't have Windows 7 but the following may help explain what's going on. Perhaps you can recreate this session on your system.

  1. Create a Hello world script with a bogus shebang line:
    $ cat > fred.pl #!/usr/bin/not_perl print "Hello, world!\n";
  2. Check that there really isn't a not_perl program:
    $ ls -l /usr/bin/not_perl ls: /usr/bin/not_perl: No such file or directory
  3. Make fred.pl executable:
    $ chmod +x fred.pl
  4. Execute it:
    $ fred.pl -bash: ./fred.pl: /usr/bin/not_perl: bad interpreter: No such file or +directory
  5. Now use a real perl program to run fred.pl (noting that the shebang line is ignored and there's no error messages):
    $ perl fred.pl Hello, world!

There's also some documentation about simulating shebang lines which may be of interest. See perlrun: #! and quoting on non-Unix systems.

-- Ken