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',
>
>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
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. :-)
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 ha
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
>>
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?
>
>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
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";
> }
>
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 po
>
>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 =
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,
http://lose.yourself
"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 n
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 usef
"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:
14 matches
Mail list logo