SPUG: Perl cgi and filehandles

Tim Maher/CONSULTIX tim at consultix-inc.com
Fri Jan 5 07:24:46 CST 2001


On Fri, Jan 05, 2001 at 11:55:12AM -0800, Brittingham, John wrote:
> I hope I am wording this right...
> Does perl run from a command line work differently that perl run as cgi from
> a browser in requards to filehandles?
> The reason I am asking is I have a script the writes to a file
> ("single_log_extract_results.htm") when it is run from the command line but
> dies when it is run from a browser with "can not open
> /home/httpd/html/single_log_extract_results.htm" 

Hi John!  Glad to see you're using your new Perl skills, and getting help
from the mailing list.

A Perl program running in CGI mode will typically use the "nobody" UID,
which means it will have to operate with more restricted permissions than
it does when you run it as "john" from the command line (this is determined
by the server's configuration details).

Once you have tested your program and in so doing created that file
with "john" ownership, the "nobody" account won't be able to write to
it, assuming a normal umask setting of 022.  chmod o+w on the file
will fix that.

-Tim

*========================================================================*
| Dr. Tim Maher, CEO, Consultix       (206) 781-UNIX/8649;  ask for FAX# | 
| Email: tim at consultix-inc.com        Web: http://www.consultix-inc.com  |
|Training- TIM MAHER: Unix, Perl  DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
|12/12: UNIX  1/15: Perl/DBI  2/20: Data Munging;Perl  2/22: Adv. OO Perl|
*========================================================================*

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list