Re: Incrementing letters in for loop

2010-04-13 Thread C.DeRykus
On Apr 13, 8:54 am, shawnhco...@gmail.com (Shawn H Corey) wrote: > C.DeRykus wrote: > > Clear as mud?  Did you say 'Hell, no'...?  Go then and > > meditate on  autoincrement magic,  grasshopper. When > > enlightenment comes, please report back and  explain it > > to us too... > > Actually, it is be

Re: free memory

2010-04-13 Thread C.DeRykus
On Apr 13, 8:46 am, philip.g.pot...@gmail.com (Philip Potter) wrote: > On 13 April 2010 16:25, Patrick Dupre wrote: > > > > > Hello, > > > I have the a hash of hash of ... of array > > (see below hwo I can list it) whose i wish to free the memory at one > > point. Right now the desallocation is no

Re: the range of an array

2010-04-13 Thread Brad Baxter
On 4/13/2010 7:13 AM, WashingtonGeorge wrote: > > Sorry,my expressions had something wrong a moment ago.i wanted to say > in case i must to use a number bigger than 2**31-1,what should i do? > Regards, > George "use a number bigger than 2**31-1" See Math::BigInt Use an array that big? Diff

Re: Incrementing letters in for loop

2010-04-13 Thread Brandon McCaig
2010/4/13 Magne Sandøy : > Thanks for all the good info. I think I have a grasp on incrementing and > comparison, but now, what puzzles me, is the fact that when I use "le" less > than or equal, why does it actually increment the "z"? It is by then passed > the less than, and already at equal to "z

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
Shawn H Corey wrote: Owen wrote: On Tue, 13 Apr 2010 05:35:51 +0200 Magne Sandøy wrote: Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second for loop actually counts way passed what I expected, and actually stops at "yz" and not "z"

Re: Nested if and elsif and else

2010-04-13 Thread Kenneth Wolcott
Hi; On Tue, Apr 13, 2010 at 19:54, Uri Guttman wrote: >> "JG" == Jim Gibson writes: > >  JG> On 4/13/10 Tue  Apr 13, 2010  4:35 PM, "Mimi Cafe" > >  JG> scribbled: > >  >> I think this will work, but is it elegant.? > >  JG> Yes, it will work, and yes, it is elegant, as long as it encapsul

Re: Nested if and elsif and else

2010-04-13 Thread Uri Guttman
> "JG" == Jim Gibson writes: JG> On 4/13/10 Tue Apr 13, 2010 4:35 PM, "Mimi Cafe" JG> scribbled: >> I think this will work, but is it elegant.? JG> Yes, it will work, and yes, it is elegant, as long as it encapsulates the JG> logic that is required by your program. i disagree

Re: free memory

2010-04-13 Thread Peter Scott
On Tue, 13 Apr 2010 16:25:32 +0100, Patrick Dupre wrote: > I have the a hash of hash of ... of array (see below hwo I can list it) > whose i wish to free the memory at one point. Right now the > desallocation is not clean, ie that evert time that I reallocate the > hash, the programme requires more

Re: Nested if and elsif and else

2010-04-13 Thread Jim Gibson
On 4/13/10 Tue Apr 13, 2010 4:35 PM, "Mimi Cafe" scribbled: > I think this will work, but is it elegant.? Yes, it will work, and yes, it is elegant, as long as it encapsulates the logic that is required by your program. Be sure and watch your indenting, so you can mentally group the correct b

Nested if and elsif and else

2010-04-13 Thread Mimi Cafe
I think this will work, but is it elegant.? If (condition){ if (nexted_condition){ do this. } Elsif (nexted_condition){ Do that... } else{ Do something else. } } else{ Do something else.. } Mimi

Re: File Type

2010-04-13 Thread Parag Kalra
In case you are working on Unix, you can call the command on '*file*' through Perl's function - '*system*' Cheers, Parag On Tue, Apr 13, 2010 at 9:52 AM, Arun P Menon wrote: > Hi All, > > Could you tell which is the best perl module for finding file type? > > I am currently using File::Type b

File Type

2010-04-13 Thread Arun P Menon
Hi All, Could you tell which is the best perl module for finding file type? I am currently using File::Type but its missing out some (Shared libraries, c programs etc...). Is there any modules to search those files. -- Regards, Arun Menon -- To unsubscribe, e-mail: beginners-unsubscr...@perl.o

Re: Incrementing letters in for loop

2010-04-13 Thread Shawn H Corey
C.DeRykus wrote: Clear as mud? Did you say 'Hell, no'...? Go then and meditate on autoincrement magic, grasshopper. When enlightenment comes, please report back and explain it to us too... Actually, it is because string-comparison operators order strings differently than auto-increment.

Re: free memory

2010-04-13 Thread Philip Potter
On 13 April 2010 16:25, Patrick Dupre wrote: > Hello, > > I have the a hash of hash of ... of array > (see below hwo I can list it) whose i wish to free the memory at one > point. Right now the desallocation is not clean, ie that evert time that > I reallocate the hash, the programme requires more

free memory

2010-04-13 Thread Patrick Dupre
Hello, I have the a hash of hash of ... of array (see below hwo I can list it) whose i wish to free the memory at one point. Right now the desallocation is not clean, ie that evert time that I reallocate the hash, the programme requires more and mor space and finally swap the memory ! How can I f

Re: Incrementing letters in for loop

2010-04-13 Thread C.DeRykus
On Apr 12, 8:35 pm, msan...@gmail.com (Magne Sandøy) wrote: > Hi. > > I'm new to perl, and I stumbled across a strange behavior in my for loop. > In the following code, the second for loop actually counts way passed > what I expected, and actually stops at "yz" and not "z" as expected. > As shown b

Perl get host's IP

2010-04-13 Thread Peng YH
Is there a general way to get linux OS's bound ip addresses? for example, the IP on eth0, eth1 etc. Thanks.

Re: html print

2010-04-13 Thread Shawn H Corey
Shlomi Fish wrote: Which arguments do you give in favour of using << shift(@_); >> instead of << shift; >>? The fact that << shift; >> extracts out of @_ or @ARGV by default is documented in "perldoc -f shift;" http://perldoc.perl.org/functions/shift.html and, like I noted, the programmer know

Re: Incrementing letters in for loop

2010-04-13 Thread Shawn H Corey
Owen wrote: On Tue, 13 Apr 2010 05:35:51 +0200 Magne Sandøy wrote: Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second for loop actually counts way passed what I expected, and actually stops at "yz" and not "z" as expected. As shown

Re: Pattern matching problem - Why won't this work?

2010-04-13 Thread Shawn H Corey
Owen Chavez wrote: Hello! I have a pattern matching question using Perl 5.10, Windows 7. Suppose I have a file containing the following block of text: Hello there TODD I my We Us ourselves OUr I. The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns that I have no inter

Re: Pattern matching problem - Why won't this work?

2010-04-13 Thread Peter Scott
On Mon, 12 Apr 2010 23:04:53 -0500, Owen Chavez wrote: > Can you suggest a reference on hashes that will provide some clue as to > how they can be used for the problem I posted? I've looked over > Programming Perl (3rd) and it's not entirely clear to me how to proceed > with a hash. Learning Perl

Thread Queues and Sockets

2010-04-13 Thread Iker Perez de Albeniz Villarroel
Hi, I am having problems creating a multithread queued Server because i can not enqueue sockets.. For example is not possible to make something like this.. my $Qwork = new Thread::Queue; our $server = new Net::SMTP::Server($host) || while(my $conn = $server->accept()) { $Qwork->

Re: the range of an array

2010-04-13 Thread Philip Potter
2010/4/13 WashingtonGeorge : > Sorry,my expressions had something wrong a moment ago.i wanted to say in > case i must to use a number bigger than 2**31-1,what should i do? Please quote the message you are replying to. If you have a dataset with more than 2**31-1 elements, you probably shouldn't b

RE: the range of an array

2010-04-13 Thread WashingtonGeorge
Sorry,my expressions had something wrong a moment ago.i wanted to say in case i must to use a number bigger than 2**31-1,what should i do? Regards, George _ 想知道明天天气如何?必应告诉你! http://cn.bing.

Re: SCALAR ref

2010-04-13 Thread Shlomi Fish
On Tuesday 13 Apr 2010 12:29:37 Akhthar Parvez K wrote: > Got that, thanks Shlomi! However, can this be done by referencing $1 > directly with strict refs on? I definitely feel it can be done and would > be nice to know how! It cannot be done directly using ${$idx} as you've shown but as a wise ma

Re: Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-13 Thread Rene Schickbauer
Hi! The OS is Windows 7 with x64 chipset. I downloaded the ActivePerl 5.10 for x64 ( http://downloads.activestate.com/ActivePerl/releases/5.10.1.1007/ActiveP erl-5.10.1.1007-MSWin32-x64-291969.msi ). After installation, it shows: - -couldn't make registry entry: -could

Re: the range of an array

2010-04-13 Thread Philip Potter
2010/4/13 Xubo : > > thank you for responding to me,but supposing i want to use an array which > should includes plenty of elements,what should i do? Do you really need an array with > 2,000,000,000 elements? If you use such large arrays, you're probably not using Perl in the best way that you can

Re: Display the actual values in an array

2010-04-13 Thread Shlomi Fish
Hi Kenneth, On Tuesday 13 Apr 2010 12:35:57 CHAN, KENNETH 1 [AG/7721] wrote: > Thanks Uri and Shlomi. The dumper works but still not getting the proper > results, please see comment in text. Thanks. Thanks for not top-posting. :-) > > > -Original Message- > > From: Uri Guttman [mailto:u

RE: the range of an array

2010-04-13 Thread Xubo
thank you for responding to me,but supposing i want to use an array which should includes plenty of elements,what should i do? Regards, George _ 想知道明天天气如何?必应告诉你! http://cn.bing.com/search?

Re: the range of an array

2010-04-13 Thread Philip Potter
2010/4/13 Xubo : > > Hi,all: > the "learning perl" say an array can have any number of elements,but when i > run such codes: > #!perl > @abc=1..9; > print @abc; > it shows "range iterator outside integer range at 123 line 2." > Regards, > George (You should ask you

the range of an array

2010-04-13 Thread Xubo
Hi,all: the "learning perl" say an array can have any number of elements,but when i run such codes: #!perl @abc=1..9; print @abc; it shows "range iterator outside integer range at 123 line 2." Regards, George _

RE: Display the actual values in an array

2010-04-13 Thread CHAN, KENNETH 1 [AG/7721]
Thanks Uri and Shlomi. The dumper works but still not getting the proper results, please see comment in text. Thanks. > -Original Message- > From: Uri Guttman [mailto:u...@stemsystems.com] > > first off, learn to bottom post and edit the quoted emails. i deleted > tons of stuff below this

Re: SCALAR ref

2010-04-13 Thread Akhthar Parvez K
Got that, thanks Shlomi! However, can this be done by referencing $1 directly with strict refs on? I definitely feel it can be done and would be nice to know how! Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to

Re: Incrementing letters in for loop

2010-04-13 Thread Shlomi Fish
On Tuesday 13 Apr 2010 11:17:12 Magne Sandøy wrote: [SNIP] > > Hi again. > > Does this mean this is a bug? It's not a bug - this is how it works. > My point is to get "z" at the end. Using "eq" or lt" wont work. You need to evaluate the condition at the end of the loop instead of at the begin

Re: SCALAR ref

2010-04-13 Thread Shlomi Fish
On Tuesday 13 Apr 2010 11:40:44 Akhthar Parvez K wrote: > Hi all, > > I've a hash that contains some regex strings as keys and some numbers as > their values. The value for each keys will primarily be used to identify > which part to print for that particular rx. eg:- for the first rx string, > ${

SCALAR ref

2010-04-13 Thread Akhthar Parvez K
Hi all, I've a hash that contains some regex strings as keys and some numbers as their values. The value for each keys will primarily be used to identify which part to print for that particular rx. eg:- for the first rx string, ${$rx{$string1}} (eg: $2) and for the second, $1 etc. And I want to

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
Shlomi Fish wrote: Hi Magne, On Tuesday 13 Apr 2010 10:37:15 Magne Sandøy wrote: Shlomi Fish wrote: Hi Magne, On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote: Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second fo

Re: Display the actual values in an array

2010-04-13 Thread Uri Guttman
> "CK1[" == CHAN, KENNETH 1 [AG/7721] writes: CK1[> Hi YH, CK1[> Thanks a lot for your reply. I just tried it but it outputs: CK1[> *** CK1[> $VAR1 = 'ARRAY(0x1883454) CK1[> '; CK1[> *** CK1[> which is still the similar p

Re: Display the actual values in an array

2010-04-13 Thread Shlomi Fish
On Tuesday 13 Apr 2010 10:17:13 CHAN, KENNETH 1 [AG/7721] wrote: > Hi all, > > I wanted to display the actual values in an array by the following > simple codes: > > * > Always add "use strict;" and "use warnings;" (and correct all reported problems). Not that

Problem in installing ActivePerl 5.10 on Windows 7 with x64 chipset

2010-04-13 Thread CHAN, KENNETH 1 [AG/7721]
Hello all, I was helping a friend to install activeperl but encountered a weird error. The OS is Windows 7 with x64 chipset. I downloaded the ActivePerl 5.10 for x64 ( http://downloads.activestate.com/ActivePerl/releases/5.10.1.1007/ActiveP erl-5.10.1.1007-MSWin32-x64-291969.msi ). After ins

Re: Incrementing letters in for loop

2010-04-13 Thread Shlomi Fish
Hi Magne, On Tuesday 13 Apr 2010 10:37:15 Magne Sandøy wrote: > Shlomi Fish wrote: > > Hi Magne, > > > > On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote: > >> Hi. > >> > >> I'm new to perl, and I stumbled across a strange behavior in my for > >> loop. In the following code, the second for loo

RE: Display the actual values in an array

2010-04-13 Thread CHAN, KENNETH 1 [AG/7721]
Hi YH, Thanks a lot for your reply. I just tried it but it outputs: *** $VAR1 = 'ARRAY(0x1883454) '; *** which is still the similar problem. Any more idea? Thanks a lot. To be exact, I used this code: *** #!/usr/

Re: Incrementing letters in for loop

2010-04-13 Thread Magne Sandøy
Shlomi Fish wrote: Hi Magne, On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote: Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second for loop actually counts way passed what I expected, and actually stops at "yz" and not "z" as exp

Display the actual values in an array

2010-04-13 Thread CHAN, KENNETH 1 [AG/7721]
Hi all, I wanted to display the actual values in an array by the following simple codes: * use Class::Inspector; use Bio::Graphics; my @methods = Class::Inspector->methods( 'Bio::Graphics', 'full', 'public'); foreach (@methods) { print $_ . "\n"; }

Re: html print

2010-04-13 Thread Shlomi Fish
Hi Chris, On Monday 12 Apr 2010 14:25:04 Chris Coggins wrote: > Shlomi Fish wrote: > > Hi Chris, > > > > A few comments on your code - some of which may help you. > > > > On Monday 12 Apr 2010 12:06:16 Chris Coggins wrote: > >> I'm having trouble getting a piece of data from a form input to prin

Re: about split and \d or . (.)

2010-04-13 Thread John W. Krahn
Hack, Gabi (ext) wrote: Shawn H Corey writes: if ( my ( $year, $mnth, $mday, $extra ) = $_ =~ m{ \A \s* ev \s* (\d\d)(\d\d)(\d\d) \s* (\d+)? \s* \Z }msx ) { just a little side question. i would have written (\d*) Returns the empty string "" if not found. instead of (\d+)? Re