Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: exec (or system())
Floor wrote:

> With a 'cat' command I read out the contents of the e-mail adresses of the
> subscribers and put it in one viewable textfile.
> I now run that job in a crontab job that runs every 15 minutes.
> It would be great if I can run that job at the start of the Perl script of
> the mailinglist software. I allready tried to put the system line in it, b
ut
> as I am a complete nono on Perl,

I don't know "nono"; I assume you mean "am a complete newbie when it comes t
o Perl".
That's OK, we all were at one time.

> it didn't run (it did, but didn't make an update to the online output file).[/colo
r]

Did your other script check for errors?  (In particular: "permission denied"
.)

I hope you're aware that when the web server runs your CGI script, it runs
as "nobody" (or some other unprivileged user-ID) and not as "floor".
That is, if the output file has the usual file permissions, so that it can
only be written to by a process logged in as you, then the file cannot
be written to by the CGI script when run by the web server.
 
>
> I think there might be allway a security issue on this, but in this case i
t
> will be the only alternative I am afraid.

Using
system "./my-script" == 0 or warn "Problem running ./my-script: $? ($!)";
or
my $results = `./my-script`; warn "Problem running ./my-script: $? ($!)" if 
$?;
has some of the same sort of security issues as
open my $fh,'>',$filename or warn "Cannot write to $filename: $!";
in regards to: Output files need to be writable by the web server process.

> I am not an experienced Perl users, but as with Cobol, you have to put the
se
> kins of commands in a certain part of the source code or else the command
> wouldn't be executed.

Perl does not have those sorts of silly restrictions.  Any executable statem
ent
that is not inside a subroutine definition is considered to be part of the
main program.  It will be executed if the flow of control reaches that far.

On another topic, I recommend you look into the comp.lang.perl.misc newsgrou
p;
it has a lot more traffic than the alt.perl newsgroup.
-Joe

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Smith
02-05-08 09:07 AM



http://www.CheapVideoBlog.com/player.php?movie=726648

Report this thread to moderator Post Follow-up to this message
Old Post
Scrat
03-24-08 06:14 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:07 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.