Re: Characters from encryption

2007-03-04 Thread Dr.Ruud
Ned Cunningham schreef: The character is a right arrow? When I read it I only get up to that character. The remaining characters are dropped. MSDOS-text-mode, Ctrl-Z? -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: private method

2007-03-04 Thread D. Bolliger
Jeff Pang am Sonntag, 4. März 2007 08:35: by convention any function, variable, or hash key that begins with an underscore, '_', is considered to be private. Seems not useful. [ example snipped] Hello Jeff Chas referred to a _convention_ - which does not enforce privacy. IMO it's useful,

Re: help with array within another array

2007-03-04 Thread Dr.Ruud
John W. Krahn schreef: Chas Owens: In Perl 5 the only difference between the '=' and ',' operators is that the '=' operator treats the word on the left like a string. The '=' is preferred when working with hashes because it provides a visual cue that you are not dealing with a normal list.

Ascending numbers

2007-03-04 Thread Somu
I'm unable to arrange the numbers in an array in ascending order.. I tried the following @asc = sort{$a=$b} @list; but it didnt work. I did a subroutine sub con{ my ($a,$b); $a=$b;} Then i tried @asc = sort con @list; #didnt work Can anyone please help? -- Love, Somu,

Re: Ascending numbers

2007-03-04 Thread Jeff Pang
I'm unable to arrange the numbers in an array in ascending order.. I tried the following @asc = sort{$a=$b} @list; but it didnt work. I did a subroutine What's your array's content? It do can work using Perl's sort (see below),also please see 'perldoc -f sort'. $ perl -le '@arr =

Re: Ascending numbers

2007-03-04 Thread Tom Phoenix
On 3/4/07, Somu [EMAIL PROTECTED] wrote: I'm unable to arrange the numbers in an array in ascending order.. I tried the following @asc = sort{$a=$b} @list; but it didnt work. It works for me. What are you doing differently? Can you reduce your problem to a small test case that you can post?

Re: private method

2007-03-04 Thread Rob Dixon
Jeff Pang wrote: Chas Owens wrote: by convention any function, variable, or hash key that begins with an underscore, '_', is considered to be private. Seems not useful. $ cat t.pl { package A; use strict; sub _foo { print hello,world\n; } } {

Re: private method

2007-03-04 Thread Jeff Pang
What are you trying to achieve Jeff? Are you concerned that someone may write malicious code that calls package functions that are meant to be private? Or are you more interested in avoiding coding mistakes caused by calling the wrong function? In fact nothing at all.I'm also using Perl's OO

Re: Ascending numbers

2007-03-04 Thread Somu
Hi Jeff Ji, your program worked. But i couldn't understand the second line.. That long print statement. What happened there? My 'simple' sort arranged numbers in dictionary style.. Like 0 then 1 then 17 then 2 and then 29.. And how come in using strict module, that $a and $b didnt make any noise?

Re: Treating a split() as an array

2007-03-04 Thread Jay Savage
On 3/3/07, Rob Dixon [EMAIL PROTECTED] wrote: Jay Savage wrote: [snip] The LIMIT parameter can be used to split a line partially ($login, $passwd, $remainder) = split(/:/, $_, 3); When assigning to a list, if LIMIT is omitted, or zero, Perl

Re: private method

2007-03-04 Thread Chas Owens
On 3/4/07, Jeff Pang [EMAIL PROTECTED] wrote: snip In fact nothing at all.I'm also using Perl's OO well.But when programming with Python,I sometime would like to declare a subroutine as private.For this private method,someone can't access it from out of the class.So I think that Perl doesn't

Re: private method

2007-03-04 Thread Ken Foskey
On Sun, 2007-03-04 at 14:31 +0100, D. Bolliger wrote: Chas referred to a _convention_ - which does not enforce privacy. IMO it's useful, otherwise it would not be widely used, and for example, Test::Pod::Coverage would require subroutines starting with an underscore to be documented. :-)

Re: Ascending numbers

2007-03-04 Thread Jeff Pang
Hi Jeff Ji, your program worked. But i couldn't understand the second line.. That long print statement. What happened there? My 'simple' sort arranged numbers in dictionary style.. Like 0 then 1 then 17 then 2 and then 29.. And how come in using strict module, that $a and $b didnt make any

Re: help with array within another array

2007-03-04 Thread Chas Owens
On 3/4/07, Dr.Ruud [EMAIL PROTECTED] wrote: snip Some evaluation is done first: perl -Mstrict -MData::Dumper -wle' $_ = {0b1_0 = A, 01_0 = B, 0x1_0 = C, 1_0 = D, _1_0 = E, *_ = F, \_ = G}; print Dumper $_ ' $VAR1 = { '8' = 'B', '_1_0' = 'E', '*main::_' = 'F',