Re: How to use sub directories in IIS and Apache HTTPD
Siegfried Heintze wrote: When I try to employ subdirectories my perl cgi programs stop working. This is because the use statements cannot find their files. I could convert the use evidence_db; statements to require '../evidence_db.pm'; and that works. But this is painful. Surely there is an easier way. I thought of going into the IIS setup and put a -I switch for the perl statement IIS uses to invoke perl for CGI. However, that could mess up other applications in other sites if I am not the only site on the machine. I don't know where I would change the setting in Apache HTTPD for just the current site either. Can someone tell me? Thanks, Siegfried perldoc lib You can add directories to the @INC array at compile time. You may also be interested in perldoc FindBin For instance in the top of my CGI handler I have, use FindBin; use lib $FindBin::Bin/../../lib; use lib $FindBin::Bin/../lib; http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
perl.beginners.cgi Weekly list FAQ posting
NAME beginners-faq - FAQ for the beginners-cgi mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address): [EMAIL PROTECTED]. 1.2 - How do I unsubscribe? Now, why would you want to do that? Send mail to [EMAIL PROTECTED], and wait for a response. Once you reply to the response, you'll be unsubscribed. If that doesn't work, find the email address which you are subscribed from and send an email like the following (let's assume your email is [EMAIL PROTECTED]): [EMAIL PROTECTED] 1.3 - There is too much traffic on this list. Is there a digest? Yes. To subscribe to the digest version of this list send an email to: [EMAIL PROTECTED] To unsubscribe from the digest, send an email to: [EMAIL PROTECTED] 1.4 - Is there an archive on the web? Yes, there is. It is located at: http://archive.develooper.com/beginners-cgi%40perl.org/ 1.5 - How can I get this FAQ? This document will be emailed to the list once a month, and will be available online in the archives, and at http://beginners.perl.org/ 1.6 - I don't see something in the FAQ, how can I make a suggestion? Send an email to [EMAIL PROTECTED] with your suggestion. 1.7 - Is there a supporting website for this list? Yes, there is. It is located at: http://beginners.perl.org/ 1.8 - Who do I complain to? Complaints can be sent to [EMAIL PROTECTED] 1.9 - Who currently maintains the FAQ? Kevin Meltzer, who can be reached at the email address (for FAQ suggestions only) in question 1.6 1.10 - Who will maintain peace and flow on the list? Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large, yet padded, clue-sticks to maintain peace and order on the list. If you are privately emailed by one of these folks for flaming, being off-topic, etc... please listen to what they say. If you see a message sent to the list by one of these people saying that a thread is closed, do not continue to post to the list on that thread! If you do, you will not only meet face to face with a XQJ-37 nuclear powered pansexual roto-plooker, but you may also be taken off of the list. These people simply want to make sure the list stays topical, and above-all, useful to Perl/CGI beginners. 1.11 - When was this FAQ last updated? Feb 04, 2004 2 - Questions about the 'beginners-cgi' list. 2.1 - What is the list for? A list for beginning Perl programmers to ask questions in a friendly atmosphere. The topic of the list is, of course, CGI with Perl. 2.2 - What is this list _not_ for? * SPAM * Homework * Solicitation * Things that aren't Perl related * Non Perl/CGI questions or issues * Lemurs 2.3 - Are there any rules? Yes. As with most communities, there are rules. Not many, and ones that shouldn't need to be mentioned, but they are. * Be nice * No flaming * Have fun 2.4 - What topics are allowed on this list? Basically, if it has to do with Perl/CGI , then it is allowed. If your question has nothing at all to do with Perl/CGI, it will likely be ignored. 2.5 - I want to help, what should I do? Subscribe to the list! If you see a question which you can give an idiomatic and Good answer to, answer away! If you do not know the answer, wait for someone to answer, and learn a little. 2.6 - Is there anything I should keep in mind while answering? We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the beginner to the place in the FM they should R :) 2.7 - I don't want to post a question if it is in an FAQ. Where should I look first? Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it. It can save everyone time if you look in the Perl FAQs first, instead of having a list of people refer you to the Perl FAQs :) You can learn about 'perldoc' by typing: perldoc perldoc At your command prompt. You can also view documentation online at: http://www.perldoc.com and http://www.perl.com 3 - Other Resources 3.1 - What other websites may be useful to a beginner ? * Perl.org - http://www.perl.org * Perl Home Page - http://www.perl.com * PerlMonks - http://www.perlmonks.org * Perldoc - http://www.perldoc.com * Perl Archives - http://www.perlarchives.com * NMS Archive - http://nms-cgi.sourceforge.net/ * Unofficial Perl Beginners' Site - http://perl-begin.berlios.de 3.2 - What resources may be harmful to a beginner? Beware of Perl4-like code-- You might find some script archives and unauthorized mirrors with old Perl4 versions of Selena Sol and Matt Wright scripts. Don't use those scripts. They are outdated and may even in some cases
Re: Module confusion
Keep in mind two things: 1) you may need to build the module locally on a similar box (linux, same basic version of Perl), and 2) since the module is Time::HiRes, there needs to be a Time directory in your modules directory, and the HiRes.pm file need to be in that directory. EG: ~bobmin/perlmodules/Time/HiRes.pm use lib ~bobmin/perlmodules; use Time::HiRes; HTH, Paul 1:21pm, [EMAIL PROTECTED] wrote: Howdy Folks, I'm not really a beginner to perl, but I do have a problem which is plaguing me due to changes in (a) my server and (b) my host company. In the past they gleefully installed any module I requested of them. No longer. In a recent move to a new server I lost a module I needed. Time::HiRes, they claim that I can use the module locally, and lord knows I've tried. But the problem is EVERY file I can find concerning the installation of modules to a nonstandard directory assumes you can telnet into the server to install the module using the makefile. Well guess what, they took away my telnet access also with this new server. I've downloaded and unpacked the module from cpan, but when I tried moving the HiRes.pm into a modules directory and pointing to it using a use lib, I'm getting a not found message. I am unsure as to what should be in that modules directory. There's plenty online about installing modules, but little about what is in a module tar and what should be online to use them. This can't be a rare problem, hosting companies are closing down telnet all over the place for security reasons. If someone has over come this, or knows a document online which explains how to over come this, I'd appreciate knowing about it. Regards Bob Minnick, Northern WebsBob Minnick, President, Northern Webs 208.265.0474 | Mainpage: http://www.northernwebs.com Meta Medic:http://www.northernwebs.com/set/setsimjr.html SpiderView LC: http://www.northernwebs.com/set/spider_view.html SpiderView DA: http://www.northernwebs.com/set/spider_view_da.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response Jan Lewis, one of Microsoft's earliest employees, provides this helpful translation of Judge Jackson's 43-page opinion into Windowese: You have performed an illegal operation and will be shut down. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Incorrect HTML Rendering?
I have the following to kick off an HTML page:- ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [ !ENTITY help Help ] html xmlns=http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml lang=en-US xml:lang=en-US head ... h1help;Blah/h1 ... The page has passed the W3C validator. (The idea is that I'm trying to make a simple macro that will insert help buttons into the page, so the entity will eventually be somewhat more intelligent than the above...) All my local browsers are showing a raw ] at the top of the page, and a raw help; at the point of use. Is this something I should expect, or are the browsers *all* buggy (surely not!), or is there some way to tweak the above so it will work as I would like? Rgds, GStC.
Strange problem with cookie script
Hi, I am getting a strange problem with two cookie scripts I've written. The first, cookie_maker.cgi, creates two cookies containing a user id and a security key: #!/usr/bin/perl -w use strict; # creates cookies print Set-Cookie:user=cbfb\n; print Set-Cookie:secid=1234\n; # creates html header print Content-type: text/html\n\n; print htmlhead/headbody; # prints message print pCreated a cookie!/p; # prints html footer print /body/html; The second, cookie_reader.cgi, reads the cookies in a browser: #!/usr/bin/perl -w # creates html header print Content-type: text/html\n\n; print htmlhead/headbody\n; # reads cookie data if ($ENV{'HTTP_COOKIE'}) { @cookies = split (/;/, $ENV{'HTTP_COOKIE'}); foreach $cookie (@cookies) { ($name, $value) = split (/=/, $cookie); print p$name=$value/p\n; $crumbs{$name} = $value; } # found cookies print pFound some cookies./p\n; print puser = $crumbs{'user'}/p\n; print psecid = $crumbs{'secid'}/p\n; # no cookies found } else { print pNo cookies found./p\n; } # creates html footer print /body/html\n; The second script outputs the following (in most browsers, see below): user=cbfb secid=1234 Found some cookies. user = cbfb secid = For some reason, looking at the page source, a space has been inserted before the name of the second cookie, secid, so $crumbs{'secid'} doesn't seem to return anything: htmlhead/headbody puser=cbfb/p p secid=1234/p pFound some cookies./p puser = cbfb/p psecid = /p /body/html To confuse me even more, if I look at the cookie in Mozilla cookie manager, it seems to be fine (ie has no leading space). It does the same thing in Firefox, Epiphany, Lynx and Galeon. But interestingly in Konqueror it is 'user' that has the leading space instead! BTW, I am using MDK Linux 10.1 with Perl 5.8.5 on Apache. I am sure I am overlooking something obvious here, but no amount of fiddling has sorted it out. Hopefully someone with a better knowledge of Perl/CGI can point out what I'm doing wrong? If so, I look forward to hearing from you! Kind regards, Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Strange problem with cookie script
I am getting a strange problem with two cookie scripts I've written. The first, cookie_maker.cgi, creates two cookies containing a user id and a security key: #!/usr/bin/perl -w use strict; # creates cookies print Set-Cookie:user=cbfb\n; print Set-Cookie:secid=1234\n; # creates html header print Content-type: text/html\n\n; print htmlhead/headbody; # prints message print pCreated a cookie!/p; # prints html footer print /body/html; The second, cookie_reader.cgi, reads the cookies in a browser: #!/usr/bin/perl -w # creates html header print Content-type: text/html\n\n; print htmlhead/headbody\n; # reads cookie data if ($ENV{'HTTP_COOKIE'}) { @cookies = split (/;/, $ENV{'HTTP_COOKIE'}); foreach $cookie (@cookies) { ($name, $value) = split (/=/, $cookie); print p$name=$value/p\n; $crumbs{$name} = $value; } # found cookies print pFound some cookies./p\n; print puser = $crumbs{'user'}/p\n; print psecid = $crumbs{'secid'}/p\n; # no cookies found } else { print pNo cookies found./p\n; } # creates html footer print /body/html\n; The second script outputs the following (in most browsers, see below): user=cbfb secid=1234 Found some cookies. user = cbfb secid = For some reason, looking at the page source, a space has been inserted before the name of the second cookie, secid, so $crumbs{'secid'} doesn't seem to return anything: htmlhead/headbody puser=cbfb/p p secid=1234/p pFound some cookies./p puser = cbfb/p psecid = /p /body/html To confuse me even more, if I look at the cookie in Mozilla cookie manager, it seems to be fine (ie has no leading space). It does the same thing in Firefox, Epiphany, Lynx and Galeon. But interestingly in Konqueror it is 'user' that has the leading space instead! BTW, I am using MDK Linux 10.1 with Perl 5.8.5 on Apache. I am sure I am overlooking something obvious here, but no amount of fiddling has sorted it out. Hopefully someone with a better knowledge of Perl/CGI can point out what I'm doing wrong? If so, I look forward to hearing from you! Kind regards, Chris I don't know that I can help directly... but here's away that I do the same thing... This creates the cookie... snip my %secure = (USER=$user-{USER_ID},LEVEL=0); my $my_cookie = $q-cookie(-name='TechDirect', -value=\%secure); print $q-header({-type=text/html, -cookie=$my_cookie}); /snip This read the cookie... snip my %secure = $q-cookie('TechDirect'); # # did i have a cookie and was User logging on ? # if (%secure) { $REQUEST{USER} = $secure{USER}; $REQUEST{LEVEL} = $secure{LEVEL}; } /snip For more info the specs are in the CGI doc... I have not tried this with many browsers. We have a closed set of browsers we work with. jwm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Mail-Internet problem
Douglas Lentz wrote: Hello friends, I'm trying to get Mark Overmeer's Mail::Internet module to work on my system. Problem: I can't send mail using Mail::Internet's smtpsend method. Details: This is a Red Hat Linux box connecting to the internet over plain old dial-up PPP. I am using my ISP's SMTP server. I know my connectivity is OK, because (1) I can telnet into my ISP's SMTP server and send myself an email that way, using HELO, MAIL From, RCPT to, DATA, etc. (2) Net::SMTP works. I wrote a small script using it, and I can send myself email through my ISP until I go blind, if I want to. This is puzzling, because according to the documentation, Mail::Internet uses Net::SMTP. Anyway, I have verified that Net::SMTP works on my system. (3) I have verified that the test emails I send are not being trapped by my ISPs spam filter. I've used Mail::Internet frequently in the past, but always on machines running a local mail server (sendmail). The following script, when executed, appears to do nothing at all; no mail gets sent. I cribbed it straight from Lincoln Stein's book and just changed the names and addresses. (Mercifully, it's short.) Have you tried turning on the Debug flag to Net::SMTP? It might help diagnose the problem. A quick glance at the code didn't immediately turn up anything, other than the lack of strictures. snip code Any advice would be deeply appreciated. Thanks! http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Filter Regular Expressions
Hi, I want to filter text using regular expressions, but i don't know how to find in a file a string like this NONE , or NONE/ , or /bsvgId , Etc. I try to use the little script bellow with a count for the word but this scrit doesn't work if i put symbols like / , \ , , (Reserved Symbols). Anyone can help me ? Thanks. Begin Script #!/usr/bin/perl $count=0; while () { $count += s/\bNONE\b//g; } print $count\n; End Litle Script Este mensaje (incluyendo cualquier anexo) contiene información confidencial que se encuentra protegida por la Ley. La información que contiene, sólo puede ser utilizada por la persona o compañía a la cual está dirigido. Si usted no es un receptor autorizado, o por error recibe el mensaje, omita su contenido y elimínelo inmediatamente. Cualquier retención, difusión, distribución y/o copia así como la ejecución de cualquier acción basado en el contenido del mismo, se encuentra estrictamente prohibido, y esta amparado por la ley. -- This message (including any attachments) contains confidential information intented for a specific individual and purpose, and is protected by law. If you are not the intented recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Mail-Internet problem
On Mon, 07 Feb 2005 10:24:14 -0500, Wiggins d'Anconia [EMAIL PROTECTED] wrote: Douglas Lentz wrote: Hello friends, I'm trying to get Mark Overmeer's Mail::Internet module to work on my system. Problem: I can't send mail using Mail::Internet's smtpsend method. Details: This is a Red Hat Linux box connecting to the internet over plain old dial-up PPP. I am using my ISP's SMTP server. I know my connectivity is OK, because (1) I can telnet into my ISP's SMTP server and send myself an email that way, using HELO, MAIL From, RCPT to, DATA, etc. (2) Net::SMTP works. I wrote a small script using it, and I can send myself email through my ISP until I go blind, if I want to. This is puzzling, because according to the documentation, Mail::Internet uses Net::SMTP. Anyway, I have verified that Net::SMTP works on my system. (3) I have verified that the test emails I send are not being trapped by my ISPs spam filter. I've used Mail::Internet frequently in the past, but always on machines running a local mail server (sendmail). The following script, when executed, appears to do nothing at all; no mail gets sent. I cribbed it straight from Lincoln Stein's book and just changed the names and addresses. (Mercifully, it's short.) Have you tried turning on the Debug flag to Net::SMTP? It might help diagnose the problem. A quick glance at the code didn't immediately turn up anything, other than the lack of strictures. I would pass 'To' and 'MailFrom' as options to smtpsend(), and let Mail::Internet create the header instead of manipulating Mail::Header directly. I would also pass the server to smtpsend. See if it works in its simplest form. Then if you have a good reason to take the more complicated approach of creating the headers yourself and grabbing the server from a variable, add the objects and variables back in one at a time and see where it breaks. --jay -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Filter Regular Expressions
Gomez, Gonzalo wrote: Hi, I want to filter text using regular expressions, but i don't know how to find in a file a string like this NONE , or NONE/ , or /bsvgId , Etc. I try to use the little script bellow with a count for the word but this scrit doesn't work if i put symbols like / , \ , , (Reserved Symbols). Anyone can help me ? Thanks. Begin Script #!/usr/bin/perl $count=0; while () { $count += s/\bNONE\b//g; } print $count\n; End Litle Script Este mensaje (incluyendo cualquier anexo) contiene información confidencial que se encuentra protegida por la Ley. La información que contiene, sólo puede ser utilizada por la persona o compañía a la cual está dirigido. Si usted no es un receptor autorizado, o por error recibe el mensaje, omita su contenido y elimínelo inmediatamente. Cualquier retención, difusión, distribución y/o copia así como la ejecución de cualquier acción basado en el contenido del mismo, se encuentra estrictamente prohibido, y esta amparado por la ley. -- This message (including any attachments) contains confidential information intented for a specific individual and purpose, and is protected by law. If you are not the intented recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. Gomez: A possible solution for this could be: #!/usr/bin/perl -w open(FILE, test) or die Can't open : $!\n; $count=0; while(FILE) { chomp; if (m/NONE/) { $count++; } #end of if statement } #end of while loop print The count for NONE is $count\n; close FILE; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Filter Regular Expressions
Ezra, thanks beforehands for your help. but i'm searching that type of word : #!/usr/bin/perl -w open(FILE, altoc1.res) or die Can't open : $!\n; $count=0; while(FILE) { chomp; if (m/NONE/)#or NONE/ , any word , /any Word like XML { $count++; } #end of if statement } #end of while loop print The count for NONE is $count\n; close FILE; Could you herlp me again ? thanks!!! Gonzalo Gómez -Mensaje original- De: Ezra Taylor [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 07 de Febrero de 2005 11:19 a.m. Para: Gomez, Gonzalo CC: beginners@perl.org Asunto: Re: Filter Regular Expressions Gomez, Gonzalo wrote: Hi, I want to filter text using regular expressions, but i don't know how to find in a file a string like this NONE , or NONE/ , or /bsvgId , Etc. I try to use the little script bellow with a count for the word but this scrit doesn't work if i put symbols like / , \ , , (Reserved Symbols). Anyone can help me ? Thanks. Begin Script #!/usr/bin/perl $count=0; while () { $count += s/\bNONE\b//g; } print $count\n; End Litle Script Este mensaje (incluyendo cualquier anexo) contiene información confidencial que se encuentra protegida por la Ley. La información que contiene, sólo puede ser utilizada por la persona o compañía a la cual está dirigido. Si usted no es un receptor autorizado, o por error recibe el mensaje, omita su contenido y elimínelo inmediatamente. Cualquier retención, difusión, distribución y/o copia así como la ejecución de cualquier acción basado en el contenido del mismo, se encuentra estrictamente prohibido, y esta amparado por la ley. -- This message (including any attachments) contains confidential information intented for a specific individual and purpose, and is protected by law. If you are not the intented recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. Gomez: A possible solution for this could be: #!/usr/bin/perl -w open(FILE, test) or die Can't open : $!\n; $count=0; while(FILE) { chomp; if (m/NONE/) { $count++; } #end of if statement } #end of while loop print The count for NONE is $count\n; close FILE; Este mensaje (incluyendo cualquier anexo) contiene información confidencial que se encuentra protegida por la Ley. La información que contiene, sólo puede ser utilizada por la persona o compañía a la cual está dirigido. Si usted no es un receptor autorizado, o por error recibe el mensaje, omita su contenido y elimínelo inmediatamente. Cualquier retención, difusión, distribución y/o copia así como la ejecución de cualquier acción basado en el contenido del mismo, se encuentra estrictamente prohibido, y esta amparado por la ley. -- This message (including any attachments) contains confidential information intented for a specific individual and purpose, and is protected by law. If you are not the intented recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Filter Regular Expressions
Gomez, Gonzalo [EMAIL PROTECTED] wrote: : Hi, I want to filter text using regular expressions, but i : don't know how to find in a file a string like this NONE , : or NONE/ , or /bsvgId , Etc. I try to use the little : script bellow with a count for the word but this scrit : doesn't work if i put symbols like / , \ , , (Reserved : Symbols). : : Anyone can help me ? Thanks. It looks like you're trying to parse XML. If you are, I would suggest using an XML parser module, and not roll your own routines. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
perl.beginners Weekly list FAQ posting
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address): [EMAIL PROTECTED]. 1.2 - How do I unsubscribe? Now, why would you want to do that? Send mail to [EMAIL PROTECTED], and wait for a response. Once you reply to the response, you'll be unsubscribed. If that doesn't work, find the email address which you are subscribed from and send an email like the following (let's assume your email is [EMAIL PROTECTED]): [EMAIL PROTECTED] 1.3 - There is too much traffic on this list. Is there a digest? Yes. To subscribe to the digest version of this list send an email to: [EMAIL PROTECTED] To unsubscribe from the digest, send an email to: [EMAIL PROTECTED] This is a high traffic list (100+ messages per day), so please subscribe in the way which is best for you. 1.4 - Is there an archive on the web? Yes, there is. It is located at: http://archive.develooper.com/beginners%40perl.org/ 1.5 - How can I get this FAQ? This document will be emailed to the list once a week, and will be available online in the archives, and at http://learn.perl.org/ 1.6 - I don't see something in the FAQ, how can I make a suggestion? Send an email to [EMAIL PROTECTED] with your suggestion. 1.7 - Is there a supporting website for this list? Yes, there is. It is located at: http://beginners.perl.org/ 1.8 - Who do I complain to? You can send complaints to [EMAIL PROTECTED] 1.9 - Who currently maintains the FAQ? Kevin Meltzer, who can be reached at the email address (for FAQ suggestions only) in question 1.6 1.10 - Who will maintain peace and flow on the list? Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large, yet padded, clue-sticks to maintain peace and order on the list. If you are privately emailed by one of these folks for flaming, being off-topic, etc... please listen to what they say. If you see a message sent to the list by one of these people saying that a thread is closed, do not continue to post to the list on that thread! If you do, you will not only meet face to face with a XQJ-37 nuclear powered pansexual roto-plooker, but you may also be taken off of the list. These people simply want to make sure the list stays topical, and above-all, useful to Perl beginners. 1.11 - When was this FAQ last updated? Feb 04, 2004 2 - Questions about the 'beginners' list. 2.1 - What is the list for? A list for beginning Perl programmers to ask questions in a friendly atmosphere. 2.2 - What is this list _not_ for? * SPAM * Homework * Solicitation * Things that aren't Perl related * Monkeys * Monkeys solicitating homework on non-Perl related SPAM. 2.3 - Are there any rules? Yes. As with most communities, there are rules. Not many, and ones that shouldn't need to be mentioned, but they are. * Be nice * No flaming * Have fun 2.4 - What topics are allowed on this list? Basically, if it has to do with Perl, then it is allowed. You can ask CGI, networking, syntax, style, etc... types of questions. If your question has nothing at all to do with Perl, it will likely be ignored. If it has anything to do with Perl, it will likely be answered. 2.5 - I want to help, what should I do? Subscribe to the list! If you see a question which you can give an idiomatic and Good answer to, answer away! If you do not know the answer, wait for someone to answer, and learn a little. 2.6 - Is there anything I should keep in mind while answering? We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the beginner to the place in the FM they should R :) Please do not quote the documentation unless you have something to add to it. It is better to direct someone to the documentation so they hopefully will read documentation above and beyond that which answers their question. It also helps teach them how to use the documentation. 2.7 - I don't want to post a question if it is in an FAQ. Where should I look first? Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it. It can save everyone time if you look in the Perl FAQs first, instead of having a list of people refer you to the Perl FAQs :) You can learn about 'perldoc' by typing: perldoc perldoc At your command prompt. You can also view documentation online at: http://www.perldoc.com and http://www.perl.com 2.8 Is this a high traffic list? YES! You have been warned! If you don't want to get ~100 emails per day from this list, consider subscribing to the digest. 2.9 Other tips before posting to the list
Apache needs permissions to create file
This is my script open(OUTFILE, , survey.txt) or die $!; I am runing this script through the webserver using a browswer, (action=http://localhost/pathtothecgiscript/cgiscript.cgi;) and the file, survey.txt, does NOT get created. When running from the command line the file DOES get created. If I create the file in question, survey.txt, ahead of time and give it the permission 666, the webserver (Apache) can then write records to the file and the script runs with no problem. Alot of people have been telling me that the webserver, in my case Apache, usually runs as a different user with different permissions than the user I am logged in as. But NO ONE can yet tell me how to give Apache or any webserver the right to create a file. my syntax is okay and I have tried it like this also: open(OUTFILE, survey.txt) or die $!; like I said everything will work fine as long as I create the file ahead of time and give it the permission of 666. thanks in advance Elliot http://www.elliotholden.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Apache needs permissions to create file
Elliot Holden wrote: This is my script open(OUTFILE, , survey.txt) or die $!; I am runing this script through the webserver using a browswer, (action=http://localhost/pathtothecgiscript/cgiscript.cgi;) and the file, survey.txt, does NOT get created. When running from the command line the file DOES get created. If I create the file in question, survey.txt, ahead of time and give it the permission 666, the webserver (Apache) can then write records to the file and the script runs with no problem. Alot of people have been telling me that the webserver, in my case Apache, usually runs as a different user with different permissions than the user I am logged in as. But NO ONE can yet tell me how to give Apache or any webserver the right to create a file. In order to create a new file, the user must have write permission in the *directory* the file is to be created in. chmod 777 on the directory should do the trick. Or, change the ownership of the directory to the Apache user and chmod 755. Or, add the Apache user to the group that owns the directory and chmod 775. (P.S. Alot is not a word) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Filter Regular Expressions
Charles, I am still working with a siemmens platform, HLRi and the output from the HLRi machine is an XML document with the tags and subscriber data inside; i try to look into the significance tags and extract some information about mobile cellular fraud. Thanks beforehands for your help... Gonzalo Gómez -Mensaje original- De: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 07 de Febrero de 2005 11:52 a.m. Para: beginners@perl.org Asunto: RE: Filter Regular Expressions Gomez, Gonzalo [EMAIL PROTECTED] wrote: : Hi, I want to filter text using regular expressions, but i : don't know how to find in a file a string like this NONE , : or NONE/ , or /bsvgId , Etc. I try to use the little : script bellow with a count for the word but this scrit : doesn't work if i put symbols like / , \ , , (Reserved : Symbols). : : Anyone can help me ? Thanks. It looks like you're trying to parse XML. If you are, I would suggest using an XML parser module, and not roll your own routines. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response Este mensaje (incluyendo cualquier anexo) contiene información confidencial que se encuentra protegida por la Ley. La información que contiene, sólo puede ser utilizada por la persona o compañía a la cual está dirigido. Si usted no es un receptor autorizado, o por error recibe el mensaje, omita su contenido y elimínelo inmediatamente. Cualquier retención, difusión, distribución y/o copia así como la ejecución de cualquier acción basado en el contenido del mismo, se encuentra estrictamente prohibido, y esta amparado por la ley. -- This message (including any attachments) contains confidential information intented for a specific individual and purpose, and is protected by law. If you are not the intented recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Filter Regular Expressions
Gomez, Gonzalo [EMAIL PROTECTED] wrote: : How could i get or use this XML parser module ? There are many XML parser modules. They are kept on a network named CPAN. Follow this link to the CPAN FAQ. http://www.cpan.org/misc/cpan-faq.html#Where_find_Perl_modules : Thanks for your answer !!! You are welcome. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
grabbing print output
Hi all, I have tricky question, and I await answer will be not so simple, here is snippet: open (PIPE, |-, convert -negate -modulate 200,0 -negate - pbm:- | gocr -) or warn $!\n; print PIPE $file; #file is image content close PIPE; prints to STDOUT everything I need (it is one line, lets say This is test). How I can grab this, so I have in $var = This is test ? ofcourse $var = print PIPE $file; doesn't work and I don't expect it should. I looked on IPC::Open2 and IPC::Run but these modules are over my knowledge. Could anyone help me on this point ? thanks a lot! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: grabbing print output
open (PIPE, |-, convert -negate -modulate 200,0 -negate - pbm:- | gocr -) or warn $!\n; print PIPE $file; #file is image content close PIPE; prints to STDOUT everything I need (it is one line, lets say This is test). How I can grab this, so I have in $var = This is test ? ofcourse $var = print PIPE $file; doesn't work and I don't expect it should. I looked on IPC::Open2 and IPC::Run but these modules are over my knowledge. Could anyone help me on this point ? Redirect to a file and read the file: my $filename = '/tmp/output'; open (PIPE, |-, convert -negate -modulate 200,0 -negate - pbm:- | gocr - $filename 21) or warn $!\n; open IN, $filename or die .. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Reg parameters to a perl script
Hi , I have a perl script which accepts few predefined parameters and values for them. It is like this : myscript.pl -param1 value1 -param2 value2 Now my requirement is , if value is also has and hyphen - then script should accept it and what ever i give after the -param option should be taken as a single string . Now the script is raising exception as unknown parameters . My code is like below == param=s = [EMAIL PROTECTED]); print Parameters passed are @PARAM\n; print paramerts in default ARGV are @ARGV\n; and calling the script as myscript.pl -noexecute -context MALLIK -param -pkg webring web/hosts --env === The output is == Unknown option: env Parameters passed are -pkg paramerts in default ARGV are webring web/hosts == Any help plz ... Thanks in advance Arjun Deserve before you desire Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.
Re: grabbing print output
Bakken, Luke [BL], on Monday, February 7, 2005 at 15:38 (-0800) thinks about: BL Redirect to a file and read the file: BL my $filename = '/tmp/output'; BL open (PIPE, |-, convert -negate -modulate 200,0 -negate - pbm:- | gocr - $filename 21) or warn $!\n; BL open IN, $filename or die .. yes, I thought about that, but this is simple way :) how to do this without any tempfile ? I don't want save anything on hdd. -- ...m8s, cu l8r, Brano. [I didn't STEAL your tagline, @FN@, I IMPROVED it!] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response