Shebang not working



I'm having trouble launching a Perl script with the shebang operator.
OS is SuSE 9.2 Professional. So far, I haven't had any helpful
insights at comp.os.linux.suse, and hope this isn't too far from Perl
to post here.

Complete Perl script:

#! /usr/bin/perl

print "Hello, World\n";

This is contained in a file of 3 lines, left-justified, created with
vi. It is saved with a directory entry of

-rwxrwxrwx 1 root root 44 Dec 31 15:32 hworld.pl

In the /usr/bin directory, I find the following entry

-rwxr-wr-w 3 root root 1160321 Oct 2 2004 perl

which leads me to believe that permissions are OK.

Now, here is how things work:

#perl hworld.pl
Hello, World
#hworld.pl
bash: hworld.pl: command not found
#./hworld.pl
bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
# ./hworld.pl
bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
#. hworld
bash: hworld: No such file or directory
#. hworld.pl
bash: print: command not found
#

>From these I conclude that there is something going wrong with the
shebang line and getting started. Any pointers as to what I need to
change will be appreciated. (Obviously, I need to fix this in order
to use Perl in a CGI environment :)].

Thanks and regards,
Sam


.



Relevant Pages

  • RE: OT? Bash Script
    ... Having done this in both Perl, and Bash, I'd argue that the Perl solution, ... the easier file IO in bash comes at the ... Maybe use a perl script for the ...
    (RedHat)
  • RE: Segmentation Fault(Core dumped)
    ... But when I started testing my perl script, ... Compilation failed in require at ./test.pl line 13. ... > official business of Sender. ...
    (perl.dbi.users)
  • Re: sharing variables-data perl-asp
    ... Also how do you invoke a perl script from an active server page? ... ASP in Perl. ... Why do you want to shell out to perl when you're already running perl? ...
    (comp.lang.perl.misc)
  • Re: environment variables in perl scripts
    ... Define a BEGIN block in your perl program. ... > perl script, something like: ... > environment variables are there and diag.txt shows ... > This communication is intended for the use of the ...
    (perl.dbi.users)
  • Re: kill process when file count reached,,.
    ... an infinite loop there, ... IMO you could just use readdir and grep in perl. ... You're using awk in backticks in a perl script? ... Perl has a kill builtin, why the hell not use that. ...
    (comp.lang.perl.modules)