Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
system( 'mv ...' ) not working?by ramses0 (Initiate) |
on Sep 23, 2003 at 15:52 UTC ( [id://293544]=perlquestion: print w/replies, xml ) | Need Help?? |
ramses0 has asked for the wisdom of the Perl Monks concerning the following question:
Hi there. I've wrestled with this for days now, and haven't gotten anywhere. I'm using Perl to make web-based glue-code for an import (of log files) script. Summary of the problem is: "after a long running process system("import $file"), my system("mv $file /tmp/trash") isn't working" Here are more details...
Scenario is:
So... put up a web-page with checkboxes and the output of: (remember, this is glue-code, so I'm not using / learning readdir / opendir, etc yet). ...and after a submission (where $cgi->param('logs') is filled with checkboxed selected items...)
Where add_and_trash() is something like:
Can anyone see any problems? Every single function call is being called correctly. If I take the copy/paste of the print $cmd's and paste them manually into a bash session, everything works, it's only when run from the perl front-end that it bombs. `whoami` reports back 'rames', not 'nobody'. Any ideas / assistance would be welcome. Sorry for chopping apart the script (it's long and boring, otherwise), hopefully my perl-fu is strong enough that I didn't make any syntax errors while paring it down. I've done reading with perldoc perlops (for ``), and perldoc -f system, but just can't figure out why when *I* copy and paste the commands by hand it works, but perl (perl/cgi running through apache) can't get it working. Assistance is appreciated, I'll respond with more details if there are parts that I'm missing. --Robert
Back to
Seekers of Perl Wisdom
|
|