Recommended approaches for exceptions, stacktraces, error messages

2005-05-16 Thread Siegfried Heintze
Is anybody (perhaps book authors) promoting a best practices for perl CGI programming? I've been doing the use warning; use strict; use CGI; # this is from memory, but you get the idea. my $q = CGI-new; my $html = ; eval { $html .= p $data /p; $html .= div more stuff $data2 /div;

Re: Recommended approaches for exceptions, stacktraces, error messages

2005-05-16 Thread Sean Davis
Hi, Siegfried. Did you look in the browser error_log? It typically contains more information. On many unices, it is in /usr/local/apache/logs. However, I'm not sure where it is on your system. A more perl approach is to do: use CGI::Carp qw(fatals_to_browser); This will redirect fatal errors

Recomdations for Template Plugins for Windows/CGI/ApacheHTTP

2005-05-16 Thread Siegfried Heintze
Does anyone use Template::Plugin on windows/cgi/ApacheHTTP? Template::Plugin::GD::Text looks very intriguing and I'm wondering if I should go thru the trouble to try to install it on windows. I assume I need to understand Template::Plugin first. Are these plugins using the Template Toolkit

getting filename in

2005-05-16 Thread Ramprasad A Padmanabhan
Hi all, I have a script that reads all input from the files specified in commandline like this while(){ ... } Inside the loop can I get the filename of the file from which is being read Thanks Ram -- Netcore Solutions Pvt. Ltd.

Re: getting filename in

2005-05-16 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Hi all, Hello, I have a script that reads all input from the files specified in commandline like this while(){ ... } Inside the loop can I get the filename of the file from which is being read Yes, it is in the variable $ARGV John -- use Perl; program

RE: Threads related document to refer in perl

2005-05-16 Thread Manav Mathur
|-Original Message- |From: Gayatri [mailto:[EMAIL PROTECTED] |Sent: Monday, May 16, 2005 10:40 AM |To: beginners@perl.org |Subject: Threads related document to refer in perl | | |Hello Friends, | | | |I want to create threads using perl. | |So if any documents or links are there to

Re: Help with subroutines

2005-05-16 Thread John Doe
Am Montag, 16. Mai 2005 06.03 schrieb Madhur Kashyap: Have a look at the code snippet from the perl program I have written Hello, use strict; use FileHandle; use IPC::Open2; use vars { ... $topCellName ...}; sub setup { .. $topCellName=crm_com; ... } sub loadNxfDB {

Re: Help with subroutines

2005-05-16 Thread Madhur Kashyap
Ohh I am extremely sorry ... When I was trying to write the code exceprt I forgot to add some lines but showed the log generated from complete code. sub loadNxfDB { print $_[0]; my $nxfDBFH=new FileHandle; open ($nxfDBFH,$_[0]) or die Error: Cannot open netname cross-reference

select system call

2005-05-16 Thread Gayatri
Dear Friends, I am facing one problem please let me know if anybody knows the solution. The problem is as follows use IO::Select; use IO::Socket; The variable $sock will be handling my socket id for TCP, AF_INET/PF_INET family and the code is as shown

Re: Help with subroutines

2005-05-16 Thread John Doe
Am Montag, 16. Mai 2005 11.57 schrieb Madhur Kashyap: Ohh I am extremely sorry ... When I was trying to write the code exceprt I forgot to add some lines but showed the log generated from complete code. sub loadNxfDB { print $_[0]; my $nxfDBFH=new FileHandle; open

RE: Create Excel spreadsheets

2005-05-16 Thread Bob Showalter
Peter Rabbitson wrote: I am about to start on a project that will be creating various excel files. Cpan yields quite a number of posibilities, among which Spreadsheet::WriteExcel looks most promising. I just wanted to hear some opinions on the best tool for the job before I delve into a

Anyone installed Net::LDAPapi

2005-05-16 Thread Ramprasad A Padmanabhan
I am not able to install Net::LDAPapi , I looked up google, seems that the module is no longer supported. Sad, I thought the interface of Net::LDAPapi is really gr8 Ram -- Netcore Solutions Pvt. Ltd. Website: http://www.netcore.co.in

Re: Anyone installed Net::LDAPapi

2005-05-16 Thread Peter Scott
On Mon, 16 May 2005 17:57:16 +0530, Ramprasad A Padmanabhan wrote: I am not able to install Net::LDAPapi , I looked up google, seems that the module is no longer supported. Sad, I thought the interface of Net::LDAPapi is really gr8 Net::LDAP is still supported and has a very good interface.

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi all, I have tried to use XML:Twig to parse a 2GB XML file instead of using XML:Simple, but I still got an error The memory couldn't be written. My Perl is the latest and my RAM is 1GB. Anyone got suggestions? Thanks a lot, Nan From: Peter Rabbitson [EMAIL PROTECTED] To: beginners@perl.org

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Peter Rabbitson
I have tried to use XML:Twig to parse a 2GB XML file instead of using XML:Simple, but I still got an error The memory couldn't be written. My Perl is the latest and my RAM is 1GB. Are you issuing a $twig-purge at the end of each handler? Without it memory is not implicitly released (no

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi Peter, Basically, the XML file has two key parallelled nodes: Topic/ and ExternalPage/. If there is a link/ child existing in Topic/, ExternalPage/ node will be existing for showing more detailed information about the content of this link/ such as d:Title/ and d:Description/. However, not

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Peter Rabbitson
Basically, the XML file has two key parallelled nodes: Topic/ and ExternalPage/. If there is a link/ child existing in Topic/, ExternalPage/ node will be existing for showing more detailed information about the content of this link/ such as d:Title/ and d:Description/. However, not every

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi Peter, The codes which are quite straightforward are below: #!/usr/bin/perl use warnings; use strict; use XML::Twig; my $twig= new XML::Twig; $twig-parsefile( ./content.example.txt); #open XML file my $root = $twig-root; #set root chdir F:/httpserv; #set initial directory foreach my $topic

Re: How to get the numeric index of a element in an array

2005-05-16 Thread Frank
Hi, thanks all! I have solve my problem. But I have another question now, How to determin whether I reach the end of file in Perl program? Also , can you tell me where I can get these informations . I scan the programing perl by Larry Wall, But it is diffculty to find what I want

Re: How to get the numeric index of a element in an array

2005-05-16 Thread Ing. Branislav Gerzo
Frank [F], on Monday, May 16, 2005 at 21:34 (+0800) wrote the following: F How to determin whether I reach the end of file in Perl program? Also F , can you tell me where I can get these informations . I scan the F programing perl by Larry Wall, But it is diffculty to find what I F want

Re: $variables in a string

2005-05-16 Thread Jeff 'japhy' Pinyan
On May 15, Paul D. Kraus said: Hello, my $image = Image::Magick-new; # trouble open(IMAGE, 'images/products/unprocessed/$sku_unprocessed.jpg'); open(IMAGE, images/products/unprocessed/$sku_unprocessed.jpg); That needs to be open(IMAGE, images/products/unprocessed/${sku}_unprocessed.jpg); That's

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Peter Rabbitson
On Mon, May 16, 2005 at 01:33:15PM +, Nan Jiang wrote: While I think Topic/ and ExternalPage/ are not randomly intermixed as Topic/ nodes are generated in relevant categories such as Arts/ - Arts/Movie - Arts/Movie/Title and then if the Topic/ has link/ children which means it is a

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi Peter, Thank you so much for your advice. I'll try to understand what you write and let you know the results! Best wishes, Nan From: Peter Rabbitson [EMAIL PROTECTED] To: beginners@perl.org Subject: Re: Errors on processing 2GB XML file by using XML:Simple Date: Mon, 16 May 2005 09:31:15

Re: Threads related document to refer in perl

2005-05-16 Thread Dave Gray
I want to create threads using perl. So if any documents or links are there to refer please send me. Here's some pretty basic threading code: http://coding.derkeiler.com/Archive/Perl/perl.beginners/2004-10/0504.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Attempt to free unreferenced scalar

2005-05-16 Thread Octavian Rasnita
Hi, After running a program, I saw the following errors: Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: 0x162445c at E:/usr/lib/Errno.pm line 15 (#1) Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: 0x162445c at E:/usr/lib/Errno.pm line 15. I can't see

RE: Help with subroutines

2005-05-16 Thread Charles K. Clarkson
Madhur Kashyap mailto:[EMAIL PROTECTED] wrote: : Ohh I am extremely sorry ... When I was trying to write the code : exceprt I forgot to add some lines but showed the log generated from : complete code. Can you reproduce the error in an example which we can run? If not, we will probably need

Re: How to get the numeric index of a element in an array

2005-05-16 Thread Frank
Thanks! Mr. Clarkson's program really works. but because my array (data) is more complex. So I made an adjustment but it did not work very well. BTW: John W. Krahn suggested I can change Input Record Separator, it does work and help me to solve the problem! But I just wonder why the

RE: How to get the numeric index of a element in an array

2005-05-16 Thread Charles K. Clarkson
Frank mailto:[EMAIL PROTECTED] wrote: : The results given like this, it seems the loop works only for one time : : common_white : paper : milk_white : milk This is what you asked perl to do. Let's walk the script. First time through $item is blue. Since $after_white tests false,

Re: Attempt to free unreferenced scalar

2005-05-16 Thread Dave Gray
After running a program, I saw the following errors: Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: 0x162445c at E:/usr/lib/Errno.pm line 15 (#1) Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: 0x162445c at E:/usr/lib/Errno.pm line 15. The only

Re: Attempt to free unreferenced scalar

2005-05-16 Thread Octavian Rasnita
My program just prints a web page and it doesn't use threads. It should run under mod_perl (but it gives those errors when running it from command line). It uses more functional modules that get data from a MySQL database, and an OOP module that prints the header, initialize the CGI object, the

Time::localtime help

2005-05-16 Thread Matt Kopeck
Hi, I have the following code: use strict; use Time::localtime; my $now = localtime; printf(The current date is %04d-%02d-%02d\n, $now-year+1900, ($now-mon)+1, $ now-mday); It outputs the date in such a format: The current date is 2005-05-16. I would like the name of the month(ex. 'May')

Re: Time::localtime help

2005-05-16 Thread Peter Rabbitson
printf(The current date is %04d-%02d-%02d\n, $now-year+1900, ($now-mon)+1, $ now-mday); It outputs the date in such a format: The current date is 2005-05-16. I would like the name of the month(ex. 'May') displayed instead of 05. What is the easiest way to do this? The most most easiest

RE: Time::localtime help

2005-05-16 Thread Charles K. Clarkson
Matt Kopeck mailto:[EMAIL PROTECTED] wrote: : use strict; : : use Time::localtime; : my $now = localtime; : : printf(The current date is %04d-%02d-%02d\n, $now-year+1900, : ($now-mon)+1, $ : now-mday); : : It outputs the date in such a format: The current date is : 2005-05-16. I would like

Programs that code themselves

2005-05-16 Thread BJ
I was wondering how people approach problems that call for some of teh code to be generated on teh fly. I think a simple example would be a program for a teacher that imports a file, students.txt and produces a tk form with each students name and a pull down menu with the 5 possible grades for

Re: columnwise analysis

2005-05-16 Thread Xavier Noria
On May 14, 2005, at 19:47, Aditi Gupta wrote: there are actuaaly no fields specified.. i have strings in each row (with intermittent hyphens) and i've to find which alphabet occurs how many times in each column and then perform reg exp operations.. but i've never dealt with such columnwise

Re: Programs that code themselves

2005-05-16 Thread Chris Devers
On Mon, 16 May 2005, BJ wrote: I was wondering how people approach problems that call for some of [the] code to be generated on [the] fly. Yes. See perldoc -f eval You can build up a string with arbitrary Perl code, then eval it to execute it in place. People do this sort of thing all

Re: Net:FTP -quot issue cmd to AS/400

2005-05-16 Thread Wiggins d'Anconia
Brian Volk wrote: Hi All, I would like to issue a command to an AS/400 using Net:FTP - quot(CMD [,ARGS]) but I'm having a little trouble. Has anyone ever done this before? Any help would be greatly appreciated. I have done this before but couldn't find the sample code. Here is what I

Re: Time::localtime help

2005-05-16 Thread John W. Krahn
Matt Kopeck wrote: Hi, Hello, I have the following code: use strict; use Time::localtime; my $now = localtime; printf(The current date is %04d-%02d-%02d\n, $now-year+1900, ($now-mon)+1, $ now-mday); It outputs the date in such a format: The current date is 2005-05-16. I would like the name of the

Re: Threads related document to refer in perl

2005-05-16 Thread Wiggins d'Anconia
Dave Gray wrote: I want to create threads using perl. So if any documents or links are there to refer please send me. Here's some pretty basic threading code: http://coding.derkeiler.com/Archive/Perl/perl.beginners/2004-10/0504.html Good article on the subject:

Very simple question.

2005-05-16 Thread Tony Marquis
I'm creating a script that open a directory. create a file call lock Work in the directory. delete the lock file and quit. my ($rep_em) = /test; opendir (DIR, $rep_em) || die (Error open directory $rep_em.); chdir($rep_em) || die (Error change directory to $rep_em); my @fic = readdir(DIR);

Re: Very simple question.

2005-05-16 Thread Philip M. Gollucci
Tony Marquis wrote: I'm creating a script that open a directory. create a file call lock Work in the directory. delete the lock file and quit. my ($rep_em) = /test; opendir (DIR, $rep_em) || die (Error open directory $rep_em.); chdir($rep_em) || die (Error change directory to $rep_em); my @fic =

Compare to multiple numbers

2005-05-16 Thread christopher . l . hood
Why doesn't this work to check the STDIN until it is one of the numbers 1 2 3 4 5 ?? I have tried multiple variations of this with different brackets ie. [ ] , and ( ) . until($type_number == 1 .. 5 ){ print Enter the number that corresponds to the type of offense you would like a report

RE: Compare to multiple numbers

2005-05-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: Why doesn't this work to check the STDIN until it is one of the numbers 1 2 3 4 5 ?? I have tried multiple variations of this with different brackets ie. [ ] , and ( ) . until($type_number == 1 .. 5 ){ I know that you could use a character class [1-5]

Re: columnwise analysis

2005-05-16 Thread Aditi Gupta
hey Xavier, thanks a lot.. i'm sure that's going to help.. if i have any problem applying the regex then i'll come back to the list:-) thanks again aditi On 5/17/05, Xavier Noria [EMAIL PROTECTED] wrote: On May 14, 2005, at 19:47, Aditi Gupta wrote: there are actuaaly no fields