List Info

Thread: Linux Perl Script Problem




Linux Perl Script Problem
country flaguser name
United States
2007-02-06 17:10:03
This is possibly more of a Red Hat Linux problem than a Perl
problem, 
but perhaps someone here can help me.  I'm trying to migrate
a simple 
website that uses HTML forms and Perl scripts to a new
computer that 
was recently set up with Red Hat Linux Enterprise ES 4.

I have a perl script called test.cgi as follows:

====================================
#!/usr/bin/perl -W
print("Hello Worldn");
====================================

The script has mode file permission 777.  The folder in
which it 
resides (and all parent folders) have permission 755.

If I call the Perl interpreter directly and pass the script
as an 
argument, it works:

[roottestlinux cgi-bin] # /usr/bin/perl test.cgi
Hello World
[roottestlinux cgi-bin] #


If I run it as a script as follows, it does not work:

[roottestlinux cgi-bin] # ./test.cgi
[roottestlinux cgi-bin] #


The disk is mounted as:
/dev/sda3 on / type ext3 (rw)


Does anyone have suggestions as to what to look for to
resolve this?

Thanks,

Eric




Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: Linux Perl Script Problem
country flaguser name
United States
2007-02-06 18:48:22
Since you are not getting an error to the screen, I'd
suspect it's
running, just sending the output to an unexpected location..
Try
changing the print to:

`echo "hello world" > test.txt`;

and then see of the file test.txt is created.. You might get
a
permissions error when it tries to create the file, but at
least
you know the program is running, and can look into why the
display
isn't being set properly..

Also running:

`env > environment.txt`;

is very helpful in determining just what environment is
being passed
to the program.. flk k



Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: Linux Perl Script Problem
country flaguser name
United States
2007-02-06 19:38:10
Eric:
   
  I have Perl 5.8.8 on Fedora Core 5 - Kernel
2.6.18-1.2257.fc5. My perl scripts are in the
  following folder  /programs/scripts/perl ...I can execute
it directly from that directory or
  with the following cmd:
   
    perl /root/programs/scripts/perl perlping.pl  
   
  For what it's worth I would check my PATH , by  'echo
$PATH' make sure you have the
  correct directories in the PATH. Hope this helps...
   
  Regards,
  Scott
   
  

Eric Boyajian <ericboyajianyahoo.com> wrote:
          This is possibly more of a Red Hat Linux problem
than a Perl problem, 
but perhaps someone here can help me. I'm trying to migrate
a simple 
website that uses HTML forms and Perl scripts to a new
computer that 
was recently set up with Red Hat Linux Enterprise ES 4.

I have a perl script called test.cgi as follows:

====================================
#!/usr/bin/perl -W
print("Hello Worldn");
====================================

The script has mode file permission 777. The folder in which
it 
resides (and all parent folders) have permission 755.

If I call the Perl interpreter directly and pass the script
as an 
argument, it works:

[roottestlinux cgi-bin] # /usr/bin/perl test.cgi
Hello World
[roottestlinux cgi-bin] #

If I run it as a script as follows, it does not work:

[roottestlinux cgi-bin] # ./test.cgi
[roottestlinux cgi-bin] #

The disk is mounted as:
/dev/sda3 on / type ext3 (rw)

Does anyone have suggestions as to what to look for to
resolve this?

Thanks,

Eric



         

 
---------------------------------
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.

[Non-text portions of this message have been removed]



Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )