Applications From Scratch: http://appsfromscratch.berlios.de/
--- On Sat, 6/14/08, walt <[EMAIL PROTECTED]> wrote: > From: walt <[EMAIL PROTECTED]> > Subject: The syntax of Gnome2::Canvas::Line? > To: [email protected] > Date: Saturday, June 14, 2008, 7:57 AM > Hi list, > > This is an example from the tarball of how to draw a line: > > Gnome2::Canvas::Item->new ($group, > 'Gnome2::Canvas::Line', > points => [200.0, 0.0, 200.0, > 450.0], > fill_color => 'black', > width_units => 4.0); > > My puzzle is why the syntax is any different from > Rectangle, i.e. > why use 'points' instead of x1,y1,x2,y2? > > Second, the use of brackets instead of () to describe > points is > a complete surprise to me. I'm new to perl and > I've never seen > that syntax used in any of the perldocs I've read (so > far). > What's the difference in this context between [] and > ()? > > Thanks. > > _______________________________________________ > gtk-perl-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/gtk-perl-list (...) means list; [...] means anonymous array reference. You'll have to read a tutorial on Perl references, but before you need to understand Perl in its referenceless part. Probably dealing with GUI stuff is too complex for a newbie. Regards, Sergei. _______________________________________________ gtk-perl-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtk-perl-list
