Velocity Reviews > Perl > How to make 2 dimensinal aray in Perl \$mat(x,y)?

# How to make 2 dimensinal aray in Perl \$mat(x,y)?

Joza
Guest
Posts: n/a

 10-02-2006
How to make 2 dimensinal aray in Perl \$mat(x,y)?

Thanks

Guest
Posts: n/a

 10-02-2006
Joza wrote:
> How to make 2 dimensinal aray in Perl \$mat(x,y)?

perldoc perlintro

--
Email: http://www.gunnar.cc/cgi-bin/contact.pl

paul
Guest
Posts: n/a

 10-02-2006
You can check in Perl doc along with the installation..

> Joza wrote:
> > How to make 2 dimensinal aray in Perl \$mat(x,y)?

>
> perldoc perlintro
>
> --
> Email: http://www.gunnar.cc/cgi-bin/contact.pl

tim
Guest
Posts: n/a

 10-02-2006
Hello

The syntax is like so:

\$mat[x][y]

where x and y are >= 0

Joza wrote:
> How to make 2 dimensinal aray in Perl \$mat(x,y)?
>
> Thanks

Guest
Posts: n/a

 10-02-2006
tim <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> Joza wrote:

[top posting corrected, please don't do that]

> > How to make 2 dimensinal aray in Perl \$mat(x,y)?
> >
> > Thanks

> Hello
>
> The syntax is like so:
>
> \$mat[x][y]

That's not Perl, unless x and y are predefined functions, constants
correct syntax is

\$mat[ \$x]->[ \$y]

Strictly speaking, even that is a simplification. The basic syntax is

\${ \$mat[ \$x] }[ \$y]

> where x and y are >= 0

Wrong. Perl allows access through negative indices.

Anno

tim
Guest
Posts: n/a

 10-02-2006
sure, i realise that x and y aren't proper perl variables, i just used
them because Joza did in his post!

didn't know about the negative array indices though - thanks for that!

http://www.velocityreviews.com/forums/(E-Mail Removed)-berlin.de wrote:
> tim <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> > Joza wrote:

>
> [top posting corrected, please don't do that]
>
> > > How to make 2 dimensinal aray in Perl \$mat(x,y)?
> > >
> > > Thanks

>
> > Hello
> >
> > The syntax is like so:
> >
> > \$mat[x][y]

>
> That's not Perl, unless x and y are predefined functions, constants
> correct syntax is
>
> \$mat[ \$x]->[ \$y]
>
> Strictly speaking, even that is a simplification. The basic syntax is
>
> \${ \$mat[ \$x] }[ \$y]
>
> > where x and y are >= 0

>
> Wrong. Perl allows access through negative indices.
>
> Anno

tim
Guest
Posts: n/a

 10-02-2006

Michele Dondi wrote:
> On 2 Oct 2006 04:20:47 -0700, "tim" <(E-Mail Removed)> wrote:
>
> >sure, i realise that x and y aren't proper perl variables, i just used
> >them because Joza did in his post!
> >
> >didn't know about the negative array indices though - thanks for that!
> >
> >
> >(E-Mail Removed)-berlin.de wrote:

> [snip full quoted content]
>
> Thank you in advance for not top-posting next time! You won't, will
> you?!?
>
>
> Michele
> --
> {\$_=pack'B8'x25,unpack'A8'x32,\$a^=sub{pop^pop}->(map substr
> ((\$a||=join'',map--\$|x\$_,(unpack'w',unpack'u','G^<R<Y]*YB='
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,\$_,
> 256),7,249);s/[^\w,]/ /g;\$ \=/^J/?\$/:"\r";print,redo}#JAPH,

David Squire
Guest
Posts: n/a

 10-02-2006
tim wrote:
>
> Michele Dondi wrote:
>>
>> Thank you in advance for not top-posting next time! You won't, will
>> you?!?

Tim, you did it again! If you don't know what top-posting is, please
read the posting guidelines for this group that are posted here twice
weekly (and are thus all over the archive at Google).

Not many chances left...

DS

Guest
Posts: n/a

 10-02-2006
tim <(E-Mail Removed)> wrote:

No you're not.

So long!

> Michele Dondi wrote:
>> On 2 Oct 2006 04:20:47 -0700, "tim" <(E-Mail Removed)> wrote:
>>
>> >sure, i realise that x and y aren't proper perl variables, i just used
>> >them because Joza did in his post!
>> >
>> >didn't know about the negative array indices though - thanks for that!
>> >
>> >
>> >(E-Mail Removed)-berlin.de wrote:

>> [snip full quoted content]
>>
>> Thank you in advance for not top-posting next time! You won't, will
>> you?!?
>>
>>
>> Michele
>> --
>> {\$_=pack'B8'x25,unpack'A8'x32,\$a^=sub{pop^pop}->(map substr
>> ((\$a||=join'',map--\$|x\$_,(unpack'w',unpack'u','G^<R<Y]*YB='
>> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,\$_,
>> 256),7,249);s/[^\w,]/ /g;\$ \=/^J/?\$/:"\r";print,redo}#JAPH,

>

--
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas

tim
Guest
Posts: n/a

 10-02-2006

> tim <(E-Mail Removed)> wrote:
>

>
>
> No you're not.

Yes I am, I just didn't know what it was before!

> So long!

Bye