Re: undefined...

2005-05-22 Thread Offer Kaye
On 5/22/05, Ley, Chung wrote: > > Upon further inspection of the array that I passed into the call, I find out > that for some reasons, > my array's last couple of elements are "defined" but without any values. My > first thought was > that somehow I might have did something like this in my c

efficiency of hash of hashes/lists

2005-05-22 Thread Zhenhai Duan
Hi, I am wondering if the performance (time efficiency) of hash of hash is bad. I has this impression from the code I developed. Basically my structure needs to hold the members of different groups. I have different choices: hash: $groups{$g1} = "$member1:$member2:$member3..."; but everytime

Re: efficiency of hash of hashes/lists

2005-05-22 Thread Jeff 'japhy' Pinyan
On May 22, Zhenhai Duan said: I am wondering if the performance (time efficiency) of hash of hash is bad. I has this impression from the code I developed. Basically my structure needs to hold the members of different groups. I have different choices: hash of hash $groups{$g1}{$member1} = 1; b

RE: efficiency of hash of hashes/lists

2005-05-22 Thread Charles K. Clarkson
Zhenhai Duan wrote: : Can anyone give me some suggestions which one is better? Whichever is easiest to read is probably the better solution. Unless you are dealing with a finished program where you need additional speed, let readability be your guide. HTH, Charle

Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
Hi, everyone, I want know whether perl support recursive sub routine call? if not, how I can meet this requirement?   thanks in advance.   Best regards, - TOPSEC, THE FIRS

Re: Can perl support recursive call?

2005-05-22 Thread Wijaya Edward
Hi, Of course! This is the example of a script with recursive call that produces a list of the directory paths and filenames of all ".htm" and ".shtm" files contained within the subdirectory assigned to the $base variable. __BEGIN__ #!/usr/local/bin/perl $base = "/home/users/myspace/html/"; $d

Re: Can erpl support recursice call?

2005-05-22 Thread John Doe
Am Montag, 23. Mai 2005 05.54 schrieb bingfeng zhao: > Hi, everyone, > I want know whether perl support recursive sub routine call? [..] Hi, It does: perl -le' use warnings; use strict; sub recursive { my $cnt=shift; print "recursion level $cnt"; recursive(++$cnt) if $cnt<10; } recursive(0); '

Re: Can erpl support recursice call?

2005-05-22 Thread Wijaya Edward
That's very clever John, I'm wondering why ($cnt++) won't work instead of this > recursive(++$cnt) if $cnt<10; I tested it, it gave endless recursion. And what's the meaning of "0" here? Why didn't you pass "1" as for recursive(1), which is more sensible to me? Which also works. > recursive(0);

答复: Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
oh, thanks a lot. but if you declare prototype of a sub routine, like sub recursive($$), perl report "main::() called too early to check prototype at sample.pl line XX." is it important and honw to avoid it? |-邮件原件- |发件人: John Doe [mailto:[EMAIL PROTECTED] |发送时间: 2005年5月23日 12:43 |收

Re: Can erpl support recursice call?

2005-05-22 Thread John Doe
Am Montag, 23. Mai 2005 06.54 schrieb Wijaya Edward: > That's very clever John, > I'm wondering why ($cnt++) won't work instead of this > > > recursive(++$cnt) if $cnt<10; > > I tested it, it gave endless recursion. Yes, spontaneosly I used $cnt++ first, too :-) ++$cnt is called "pre increment" -

Re: 答复: Can erpl support recursice call?

2005-05-22 Thread John Doe
Hi Am Montag, 23. Mai 2005 06.58 schrieb bingfeng zhao: > oh, thanks a lot. > > but if you declare prototype of a sub routine, like sub recursive($$), perl > report "main::() called too early to check prototype at sample.pl line > XX." > is it important The warning says that the prototype ca

答复: Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
I'm sorry I may misled by the question. the real qurstion I met is not recursicve but another one involve recursive. In the sub, I open a file and then call the same sub recursively. Of cource, the recursive call will open another file also. when the flow return from recursive call, the file handl

XML::LibXML on Cygwin

2005-05-22 Thread marcos rebelo
It is possible to install this Perl module in the Cygwin. When I do 'perl Makefile.pl' the script blows up and creats the file 'perl.exe.stackdump' I changed the code of the Makefile.pl inside the 'sub backtick' from open(STDOUT, ">$DEVNULL"); open(STDERR, ">$DEVNULL"); my $result

Re: 答复: Can erpl support recursice call?

2005-05-22 Thread John Doe
Hi Am Montag, 23. Mai 2005 07.24 schrieb bingfeng zhao: > I'm sorry I may misled by the question. the real qurstion I met is not > recursicve but another one involve recursive. I don't understand what you mean here. > In the sub, I open a file and then call the same sub recursively. Of > cource,

Re: 答复: Can erpl support recursice call?

2005-05-22 Thread Xavier Noria
On May 23, 2005, at 7:24, bingfeng zhao wrote: I'm sorry I may misled by the question. the real qurstion I met is not recursicve but another one involve recursive. In the sub, I open a file and then call the same sub recursively. Of cource, the recursive call will open another file also. when