From: Mark D. <mar...@zn...> - 2006-09-12 22:21:21
|
Hi Daniel DanielMS wrote: > Hi Mark, > I'm not sure of what exactly means $panel->{button}{"pl_button"} but it > works fine! I found this in another sample programm. That's perl 'auto instancing' for you. $panel is a reference to (I assume) a panel object which is a perl hash and panel class. So I could do: $panel->{myvalue} = 1; $panel->{myothervalue} = 2; and the keys 'myvalue' and 'myothervalue' would be paired with the values 1 & 2 in my hash. if I do $panel->{another}{thing} = 5; then perl works out that I want the key 'another' in my panel hash to be paired with an anonymous hash, and I want the key 'thing' in that second hash to be paired with the value 5; So: $panel->{button}{plbutton} = Wx::Button->new(....); just means that $panel->{button}{plbutton} is exactly the same as above except that the value held is a Wx::Button object. $panel->{x}{y} = Wx::Button->new(....); would work exactly the same. If you are just starting out with Perl, not just wxPerl, I think you will find wxPerl quite difficult to get to grips with just from example code - not least because Perl allows you to do everything in 101 different ways. Its hard work at first, but you just have to read the 'perldocs'. Once you are comfortable with how hashes, arrays and references work in perl, you'll find wxPerl much easier to progress with. Good luck - and don't give up! best regards Mark |