LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-02-2004, 05:42 PM   #1
dude4you
LQ Newbie
 
Registered: Jan 2004
Posts: 16

Rep: Reputation: 0
Why cant i execute a perl script


When I try to execte my script I get following error:

[root@ scripts]# su cactiuser perl unix_apachestats.pl localhost
perl: /usr/bin/perl: cannot execute binary file

I also tried

[root@ scripts]# su cactiuser unix_apachestats.pl localhost
unix_apachestats.pl: /bin/bash=/bin/bash: No such file or directory
unix_apachestats.pl: =/usr/bin/lynx: No such file or directory
unix_apachestats.pl: =/usr/bin/head: No such file or directory
unix_apachestats.pl: my: command not found
unix_apachestats.pl: chomp: command not found
unix_apachestats.pl: line 34: syntax error near unexpected token `{'
unix_apachestats.pl: line 34: `if ($hostname eq '') {'
 
Old 03-02-2004, 06:31 PM   #2
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
In order to narrow the possible sources for this error, it might be a good idea to check the system log file, to see if there is a more detailed error message.

In a Debian system this file is located at /var/log/messages

Shortly after reproducing the error, display the newest lines in this usually very long file by typing:

Code:
tail /var/log/messages
(You need be root to have access to that file).
 
Old 03-02-2004, 06:50 PM   #3
flynhi66
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Rep: Reputation: 0
try su - cactiuser perl unix_apachestats.pl localhost

su by itself does not set environment variables needed by this script. call it with su - (the minus runs the environment scripts and sets the variables)..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2 does not execute Perl! mesh2005 Linux - Networking 1 10-26-2005 11:51 PM
Cannot execute a script grueugene Programming 15 01-27-2005 05:50 AM
Converting a Windows Perl script to a Linux Perl script. rubbercash Programming 2 07-19-2004 11:22 AM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 07:25 PM
Including methods from a perl script into another perl script gene_gEnie Programming 3 01-31-2002 06:03 AM


All times are GMT -5. The time now is 12:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration