On 3/6/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"John W. Krahn" schreef:
> Dr.Ruud:
>> John W. Krahn:
>>> Dr.Ruud:
Yes, "passing the bareword test" is a better phrase than only
mentioning "word" characters.
snip
> perldoc perlop
> -bareword is equivalent to "-bareword"
Yes, but un
"John W. Krahn" schreef:
> Dr.Ruud:
>> John W. Krahn:
>>> Dr.Ruud:
Yes, "passing the bareword test" is a better phrase than only
mentioning "word" characters.
There are border cases though:
perl -Mstrict -MData::Dumper -wle'
$_ = { AB => 1, +AB => 2, -AB => 3 }
Dr.Ruud wrote:
>
> "John W. Krahn" schreef:
>>
>> Dr.Ruud wrote:
>>>
>>> Yes, "passing the bareword test" is a better phrase than only
>>> mentioning "word" characters.
>>>
>>> There are border cases though:
>>>
>>> perl -Mstrict -MData::Dumper -wle'
>>> $_ = { AB => 1, +AB => 2, -AB => 3 };
>
"John W. Krahn" schreef:
> Dr.Ruud wrote:
>> "Chas Owens" schreef:
>>> Dr.Ruud:
>>
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 $_
Dr.Ruud wrote:
> "Chas Owens" schreef:
>> Dr.Ruud:
>
>>> 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' =>
"Chas Owens" schreef:
> Dr.Ruud:
>> 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' =>
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',
"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
Chas Owens wrote:
> On 2/27/07, Neal Clark <[EMAIL PROTECTED]> wrote:
> snip
>> sorry about saying you had the wrong syntax earlier, i thought it
>> was. i never knew you could do hashes with the comma operator. neat.
>> i don't think its very clear syntactically but if it works it works :-)
> snip
Neal Clark wrote:
> you are working with two different variables.
>
> On Feb 27, 2007, at 12:24 PM, Ravi Malghan wrote:
>
>> what am I doing wrong here when trying to access the
>> value john for node1
>> =
>> $SESSION{FirstRun} = 1;
>
> this line creates a _hash_, %SESSION with one elem
On 2/27/07, Neal Clark <[EMAIL PROTECTED]> wrote:
snip
sorry about saying you had the wrong syntax earlier, i thought it
was. i never knew you could do hashes with the comma operator. neat.
i don't think its very clear syntactically but if it works it works :-)
snip
In Perl 5 the only differenc
On 2/27/07, Ravi Malghan <[EMAIL PROTECTED]> wrote:
what am I doing wrong here when trying to access the
value john for node1
=
$SESSION{FirstRun} = 1;
%nodeowner = ("node1", "john", "node2", "nancy");
push(@SESSION, %nodeowner);
print "node1: $SESSION{$nodeowner{node1}}\n";
snip
Off t
you are working with two different variables.
On Feb 27, 2007, at 12:24 PM, Ravi Malghan wrote:
what am I doing wrong here when trying to access the
value john for node1
=
$SESSION{FirstRun} = 1;
this line creates a _hash_, %SESSION with one element (keyed by
FirstRun, value is 1).
On 2/27/07, Ravi Malghan <[EMAIL PROTECTED]> wrote:
Hi: I just can't seem to figure this out.
I am trying to declare two associative array
Just call them hashes, everybody else does.
(%nodeowner and %nodeseverity) within another array
called %SESSION
For example
%nodeowner = ("node1", "john"
what am I doing wrong here when trying to access the
value john for node1
=
$SESSION{FirstRun} = 1;
%nodeowner = ("node1", "john", "node2", "nancy");
push(@SESSION, %nodeowner);
print "node1: $SESSION{$nodeowner{node1}}\n";
==
Thanks
Ravi
--- Neal Clark <[EMAIL PROTECTED]> wrote:
Ravi Malghan wrote:
> Hi: I just can't seem to figure this out.
> I am trying to declare two associative array
> (%nodeowner and %nodeseverity) within another array
> called %SESSION
>
> For example
> %nodeowner = ("node1", "john", "node2", "nancy");
> %nodeseverity = ("node1", 5, "node2", 10);
>
ah. well in that case
@SESSION = ( \%nodeowner, \%nodeseverity );
On Feb 27, 2007, at 11:59 AM, Ravi Malghan wrote:
One correction: SESSION is just a single dimensional
array @SESSION.
Thanks
Ravi
--- Ravi Malghan <[EMAIL PROTECTED]> wrote:
Hi: I just can't seem to figure this out.
I am try
well first of all you're using the syntax for non-associative arrays
(normal @arrays). your hash declarations should look like this:
%nodeowner = (node1 => "john", node2 => "nancy");
%nodeseverity = (node1 => 5, node2 => 10);
as for %SESSION, you could make a hash with reference to hash value
One correction: SESSION is just a single dimensional
array @SESSION.
Thanks
Ravi
--- Ravi Malghan <[EMAIL PROTECTED]> wrote:
> Hi: I just can't seem to figure this out.
> I am trying to declare two associative array
> (%nodeowner and %nodeseverity) within another array
> called %SESSION
>
> For
19 matches
Mail list logo