Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

no output

by joco10 (Novice)
on Sep 09, 2005 at 16:37 UTC ( [id://490637]=perlquestion: print w/replies, xml ) Need Help??

joco10 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm fairly new at Perl, but I have a little problem: I installed Linux (FC3) and Perl on my PC at home to practice with Perl, and I can run my programs by using /usr/bin/perl prog_name.pl, but it won’t work when I try running it as an executable ( ./prog_name.pl). It looks like it runs, but doesn’t produce any output. The correct shebang is on the first line of the code and the file has attributes 755. Do I have to change a configuration to make this work? Thanks, Jo

Replies are listed 'Best First'.
Re: no output
by socketdave (Curate) on Sep 09, 2005 at 16:43 UTC
    Please post a script that exhibits this behavior. My guess is that you have noexec set for the partition containing your program. Try copying your .pl file to /bin and running it from there (unless it deletes everything in the current directory, of course ;)
      I tried it in the bin folder and it worked. What does that mean?
        Basically, your /home partition is set up to not allow programs to run from it. It's to prevent malicious code from running on your system. It can be disabled by editing /etc/fstab, but I advise you to create a directory in /usr to work on your code. Good luck!
Re: no output
by sh1tn (Priest) on Sep 09, 2005 at 16:41 UTC
    Your first line should be the following output:
    echo '#!'`which perl`


Re: no output
by shemp (Deacon) on Sep 09, 2005 at 16:43 UTC
    It sounds like you have pretty much everything set up correctly, i.e. permissions, etc. So what do you mean by it looks like it runs? No errors are reported on the command line perhaps.

    I'd recommend reducing the problem to a simplest case. Try a simple hello world program and see what happens.


    I use the most powerful debugger available: print!
Re: no output
by jfroebe (Parson) on Sep 09, 2005 at 17:44 UTC

    Hi,

    This sounds to be the result of SELinux. Either change the /etc/selinux/config to be disabled or configure SELinux. Configuring SELinux takes a bit of planning to do right. Unless this is going to be a server, I would recommend just disabling it.

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re: no output
by halley (Prior) on Sep 09, 2005 at 18:59 UTC
    If your script has ever been edited on Windows,
    • pass it through dos2unix, or
    • check there's no ^M byte on the first line, or
    • put a space after the last printable on the first line

    --
    [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://490637]
Approved by Paladin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found