Re: cgi form generates a cronjob
Frank, You could do a sudo www command and using sed you culd edit Now I have never done anything like this but I can see how I would approach it to edit the cronjob. God Luck!!! -Original Message- From: FRANK DELATORRE [EMAIL PROTECTED] Sent: Mar 25, 2005 9:48 AM To: beginners-cgi@perl.org Subject: cgi form generates a cronjob Hello, I hope this is the right forum to ask this question: Is it possible to generate a crontab file from a perl driven CGI script? If so, what are the key steps? I've been thinking about how to develop this but for some reason I cannot rectify, in my head, how to edit a crontab file as www when www is not really a user in the /home dir... thanks Frank -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Perl out to PHP
How about this: 1) first page is php with action to a perl page 2) page is a perl page that process the info and redirects to a the first page 3) back to first page but here you check the referrer and if it is a perl page then display your data other wise is just the first time the php page gets called. Nestor :-) -Original Message- From: Ing. Branislav Gerzo [EMAIL PROTECTED] Sent: Feb 4, 2005 6:23 AM To: beginners-cgi@perl.org Subject: Re: Perl out to PHP Paul Archer [PA], on Friday, February 4, 2005 at 08:14 (-0600 (CST)) thinks about: I think he means that he wants his perl to generate HTML containing PHP. PA Understood. My point was more along the lines of: What do you really want PA to do, and why don't you state that clearly, instead of making us PA mind-read? ok, sorry then. We have website done with PHP, it did my brother. But I'm more into perl, so I did some scripts. Website is about checking IPs (if it is up, and so on), so I wrote script for that. Ok, now my problem: user come to website, write in textbox some IPs, I want send this input to my perl script (parse that text, takes IPs, do operation with them - insert them to database, check them...), and send results via _PHP_ to user. Thanks to all for replies! -- ...m8s, cu l8r, Brano. [Bother! said Pooh, as Piglet sacrificed him to the dark gods.] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: CGI.pm 2.98 breaks CGI::Carp?
Randall, Sorry, but what is TPJ ? Thanks, Nestor :-) -Original Message- From: Randal L. Schwartz [EMAIL PROTECTED] Sent: Sep 24, 2003 4:06 AM To: [EMAIL PROTECTED], Drieux [EMAIL PROTECTED] Subject: Re: CGI.pm 2.98 breaks CGI::Carp? Drieux == Drieux [EMAIL PROTECTED] writes: Drieux just a quick knickle tour - I of course will defer to Randal Drieux to go into more detail if required. That covers most of it, but let me put it a different way. use CGI::Carp qw(fatalsToBrowser); presumes that the person operating the browser is the person also developing the program. While this can certainly be true during development, it is rarely true (if ever!) in production. Here's the problem: The end user doesn't want to see a Perl error message. They will probably have no clue what to do to work around it, and will rarely understand how to precisely copy that error (and any associated state or sequence descriptions) to a proper email buffer to email the developer. But worse, the end user *shouldn't* see the details of the error, which will often include filenames and other key data that might reveal the security mechanisms being used. This is prime intrusion vector information - a goldmine for the person wanting to abuse the website. All you should do for a non-recoverable error is tell the user: SOMETHING WENT WRONG. WE ALREADY KNOW ABOUT IT. IF YOU WANT TO TELL US WHAT YOU WERE DOING: email [EMAIL PROTECTED] referencing trouble ticket #12345. and then on the server side, log the hell out of the error, and create a trouble ticket so there can be a repair made and correlation with any user. If you don't want to create a ticket, just use unpack(H*, pack NS, time, $$), which should be fairly unique and yet short enough to cut and paste nicely. In fact, that'd be nice column idea! I needed one for TPJ today. Thanks. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI.pm 2.98 breaks CGI::Carp?
Thanks -Original Message- From: Randal L. Schwartz [EMAIL PROTECTED] Sent: Sep 24, 2003 9:23 AM To: Nestor Florez [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], Drieux [EMAIL PROTECTED] Subject: Re: CGI.pm 2.98 breaks CGI::Carp? Nestor == Nestor Florez [EMAIL PROTECTED] writes: Nestor Randall, Nestor Sorry, but what is TPJ ? www.tpj.com - the Perl Journal, formerly a print quarterly, then bundled with SysAdmin, is now back as an online monthly. I have a column there, taken over from brian d foy, who is currently in Iraq under military orders until next April. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: apache in win2k
Conan, I bet you, that if you put the shebang line pointing to the perl\bin\perl directory it will work. I had my perl working with apache and I downloaded activestate perl and all of a sudden I was getting the same message Can not Spawned. I change my shebang line on all my perl script and it worked. I wish someone could explain this. Nestor :-) - Original Message - From: Conan Chai [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 11:54 PM Subject: apache in win2k dear all, i just install apache 1.3.26 in win2k. the html documents are running properly but cgi is not running. i have perl v5.6.1 installed. everytime i run a cgi script, the server error_log says couldn't spawn child process: c:/program files/apache group/apache/cgi-bin/pizza.cgi. this error happens even if i run a simple cgi that prints hello world. i'm not sure if it has anything to do with the shebang line because as what i found out, windows ignores the shebang line. pls advise. thks Conan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SHIFT in a subroutine
I was wondering about the shift inside a subroutine. I have never used it. What is the purpose of it been there? Thanks in advance, Nestor :-) - Original Message - From: Stephen.Hurley [EMAIL PROTECTED] To: 'Bruce Ambraal' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 6:58 AM Subject: RE: What is the value of @_4_[0], and $return_me? (see below) Well, for a start, you have a spelling mistake in there... my $retun_me = shift; - probably should be - my $return_me = shift; Secondly, what exactly are you trying to do with this code ? I don't know too much about perl, but I think the assignment: @_ = @arr; might be a little suspicious. I normally grab the arguments passed to my sub routine from @_ , I don't usually assign *to* it. In the end, it seems like this subroutine should return the first value in @arr, which is 0. Does any of this help ? -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 14:38 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: What is the value of @_4_[0], and $return_me? (see below) Hi 1. (see subject) 2. Explain lines 3 , 4 3.Why does'nt this coding return anything2 sub routine { my @arr = (0, 'a' 1, 'b'); @_ = @arr; my $retun_me = shift; return( $return_me ) }; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HELP - finding a float while reading a file
Hi there, I am trying to read a file and find the last numeric value in the line read. example: 123 45 -23 56 -3.45 145 555 112 -12.0 -2.55 all of the values are separated by a space and I am looking for the last value. I tried $_ = s/[-][0-9].+$/$1/; $number = $1; The problem is that, not aleways I am getting the last value starting at the negative value. Somtime I get the second to last value. Thanks in advance, Nestor :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: regexp to replace double with single quotes inside html tags
John, can you explain the piece of code that you wrote. Thanks and happy new year :-) - Original Message - From: John W. Krahn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 30, 2001 3:38 AM Subject: Re: regexp to replace double with single quotes inside html tags Birgit Kellner wrote: I would like to replace all double with single quotes inside a html tag, i.e. perform the substitution only for html tag attributes, but not outside tag boundaries. my $string = qq|a href=http://someurl.url; title=welrkwlekrjaha/a, and here follows a quoted expression: blablaimg src=http://someimage.gif; width=80 height=200|; All double quotes should be replaced by single ones except those surrounding the string blabla. My approach would be: Look for , followed by a string of characters except , followed by - if matched, replace this instance of with '. I found the following code to work, but it strikes me as very clumsy and I am not sure whether it captures all relevant cases and really excludes all those which are not relevant. while ($string =~ /([^]*?)/gs) { my $var = $1; $string =~ s/$var/$var'/;} print qq|$string\n|; $string =~ s/([^]+)/$a=$1;$a=~tr||'|;$a/eg; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl:readina doc file and adding a gif
I am trying to figure out how to insert a gif file in the middle of a word file(.doc). I am asking here, becasue I thought maybe someone has come acrss this before. I can read the doc file and create it as a different file and word will read, but if I try inserting someting into the file, then word can not read it. Does anyone know the format or the correct way to insert a gif file in middle of a microsoft word file(.doc) I can read the word file using something like: while(read(FILE, $buf, $len)) { #Here when ever I find a key word I open the gif file, read and insert #a print statement intothe OUT file handle if($_ =~ /nestor/) { while(read(GIF, $buf2, $len)) { print OUT $gif; } } print OUT $_; } When I look at the size of the new file, I can tell that tne input file and the GIF file are all one file but word does nto recognize the document. There must be some word format saying at this point display the gif file, kind of like in an HTML file you would have an IMAGE tag. How big do you have to set the $len scalar? I set it to 1024 currently. Can anyone give me any hints for the proper format to insert a gif file into a word file. Thanks, Nestor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]