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 sp

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 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-

Compare to multiple numbers

2005-05-16 Thread christopher . l . hood
Why doesn't this work to check the 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 for\n"

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 @fi

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: 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: > > Good article on the subject: http://www.p

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

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 w

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 t

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 ana

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: Time::localtime help

2005-05-16 Thread Charles K. Clarkson
Matt Kopeck 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 woul

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 mos

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: 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 CG

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

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

2005-05-16 Thread Charles K. Clarkson
Frank 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 fal

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 foll

RE: Help with subroutines

2005-05-16 Thread Charles K. Clarkson
Madhur Kashyap 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

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: 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: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

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 -05

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 and are not randomly intermixed as > nodes are generated in relevant categories such as -> > -> and then if the has > children which means it is a final category, then nodes > appeared immediatly below the with

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, 'open(IMAGE, "That needs to be open(IMAGE, " That's because the variable name is 'sku', not 'sku_unprocessed'. -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734

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> wa

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 f

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: 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: and > . If there is a child existing in , > node will be existing for showing more detailed information > about the content of this such as and . > > However, not every node has one or more child, so I need > to write a loop to fi

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: and . If there is a child existing in , node will be existing for showing more detailed information about the content of this such as and . However, not every node has one or more child, so I need to write a loop to find o

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 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: 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 interfac

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 Spa

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 > c

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; > > >

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 bellow

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-re

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 l

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 refer

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 fulfil

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. L