newbie with a question on syntax

2009-02-03 Thread Tina
Hello, I just started programming in perl and currently am working in an OOP sort of program. I am writing the constructor and I wasn't sure of the differences between the following syntax: 'count' => 0 @count = 0 Both seem to work fine, but I would like to know how they are different and whethe

Re: newbie with a question on syntax

2009-02-03 Thread Chas. Owens
On Mon, Feb 2, 2009 at 16:43, Tina wrote: > Hello, I just started programming in perl and currently am working in > an OOP sort of program. I am writing the constructor and I wasn't sure > of the differences between the following syntax: > > 'count' => 0 > > @count = 0 > > Both seem to work fine,

Re: newbie with a question on syntax

2009-02-04 Thread Dr.Ruud
Chas. Owens wrote: > [fat comma] it treats the thing on its left like a string if the thing on the left matches this pattern /^[-_a-zA-Z][-\w]*$/ I don't believe that pattern. So lets test: perl -wle ' $,=" => "; my %h = ( -- => "x"); print %h; ' syntax error at -e line 3, near "-- =>"

Re: newbie with a question on syntax

2009-02-04 Thread Chas. Owens
On Tue, Feb 3, 2009 at 18:32, Dr.Ruud wrote: > Chas. Owens wrote: > >> [fat comma] >> >> it treats the thing on its left >> like a string if the thing on the left matches this pattern >> /^[-_a-zA-Z][-\w]*$/ > > I don't believe that pattern. So lets test: > > > perl -wle ' > $,=" => "; > my %h =