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

Gunnar Hjalmarsson
Guest
Posts: n/a

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

perldoc perlintro

--
Gunnar Hjalmarsson
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..

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

>
> perldoc perlintro
>
> --
> Gunnar Hjalmarsson
> 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

anno4000@radom.zrz.tu-berlin.de
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
for example. Also, your syntax is already a simplification. The
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
> for example. Also, your syntax is already a simplification. The
> 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
yup! sorry about before....

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:
> yup! sorry about before....
>
> 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

Tad McClellan
Guest
Posts: n/a

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

> sorry about before....

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,

>

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

tim
Guest
Posts: n/a

 10-02-2006

Tad McClellan wrote:
> tim <(E-Mail Removed)> wrote:
>
> > sorry about before....

>
>
> No you're not.

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

> So long!

Bye

 Thread Tools

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Edward A. Falk C Programming 1 04-04-2013 08:07 PM JoeC C++ 12 09-21-2006 11:05 PM ss Java 1 06-22-2006 06:20 AM max Perl Misc 6 07-14-2005 07:51 PM Tom St Denis C Programming 9 07-10-2003 10:08 AM

Advertisments