[H-GEN] Perl temp problem

Jason Parker-Burlingham jasonp at uq.net.au
Sun Apr 27 20:45:07 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

"Tony Melia (DMS)" <Tony.Melia at downsmicro.com.au> writes:

> 	I have a perl script which calls a system() command to do a trivial
> task that creates an anonymous temp file.  This worked fine up until I did
> an up2date today (yes, I know, some people say never to run it!).  An
> example demonstrating problem is ;
> 
> #!/usr/bin/perl
> System("lynx -source http://whatever <http://whatever>  | mail
> me at myaddress").  

I assume the "<http://whatever>" part is some meta-syntax on your part
and not really part of the script (since the shell would normally
interpret the ">" and "<".

> I now get an email (instead of the html content) saying /var/www/IKJTE:
> permission denied

Well, if the script is running as a CGI you may just want to do a
C<chdir> first.  Alternatively setting TMPDIR may help.  You can set
the TMPDIR environment variable by frobbing $ENV{TMPDIR} within the
perl script.

I tried to solve your problem with the following:

   $ strace -eopen lynx -source http://slashdot.org/ 2>strace | wc

The strace output (in the file "strace", naturally) indicated lynx was
trying to use /tmp; setting TMPDIR changed that to /var/tmp.

jason
-- 
``I didn't program you for sarcasm.''

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list