Re: The syntax of Gnome2::Canvas::Line?





Applications From Scratch: http://appsfromscratch.berlios.de/


--- On Sun, 6/15/08, walt <wa1ter myrealbox com> wrote:

From: walt <wa1ter myrealbox com>
Subject: Re: The syntax of Gnome2::Canvas::Line?
To: gtk-perl-list gnome org
Date: Sunday, June 15, 2008, 2:36 PM
muppet wrote:

...
If the [] style arrays are giving you trouble, i
recommend reading
perlref and the Data Structures Cookbook, perldsc. You
really can't use
gtk2-perl effectively without understanding perl data
structures
intimately.

Wow, muppet, Sergei, zentara, you folks are wonderful. 
Thanks to your
great help I'm now looking at a bar chart of the Dow
Jones Industrial
Average from 1929 to today :o)  Of course I still have a
long way to
go, but to get this far in less than a week is beyond my
expectations.

Many of my remaining questions are about perl, not about
gtk, so where
would you go for advice when/if you can't understand
the perl docs?

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Personal advice WRT references: for the beginning, forget about "->"
as a way to dereference.

Remember just _one_ simple rule: reference inside a pair of curlies
behaves like regular name.

Examples:

use strict;

my %hash =
  (
  one => 1,
  two => 2
  );

warn "\$hash{one}=$hash{one}"; will print 1

my $hash_ref = \%hash;

warn "\${\$hash_ref}{one}=${$hash_ref}"; # will also print 1
.

The point is that

hash is equivalent to {$hash_ref}

- as I wrote above.

The same rule applies to array and code references.

Regards,
  Sergei.


      



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]