<br><font size=2><tt>> (I am an ex-perler gone clean. Been straight
for 5 years now with only <br>
> the occasional work forced binges.)<br>
> <br>
> Perl was designed by a linguist. He wanted it to act like human language
<br>
> -- which is not very consistent.<br>
</tt></font>
<br><font size=2><tt>And from what I gather, quite effective. :-)</tt></font>
<br><font size=2><tt> <br>
<br>
> Personally, the thing that keeps me away from Perl is nested datastructures.<br>
> <br>
> Python:<br>
> <br>
> my_list = [....]<br>
> a_dict = {.....}<br>
> b_dict = {.....}<br>
> my_list.append(a_dict)<br>
> my_list.append(b_dict)<br>
> <br>
> if my_list[0].has_key("foo"): print "Yes"<br>
> <br>
> easy. Try that in Perl.<br>
</tt></font>
<br><font size=2><tt>OK, sounds like fun:</tt></font>
<br>
<br><font size=2><tt>my %a_dict = (...);</tt></font>
<br><font size=2><tt>my %b_dict = (...);</tt></font>
<br><font size=2><tt>my @my_list = (\%a_dict, \%b_dict);</tt></font>
<br><font size=2><tt>if (exists $my_list->[0]{foo}) print "Yes\n";</tt></font>
<br>
<br><font size=2><tt>And if you want to do it another way:</tt></font>
<br>
<br><font size=2><tt>my @my_list = ( (...), (...) ); #define hashes in
the (...)'s</tt></font>
<br><font size=2><tt>print "Yes\n" if (exists $my_list->[0]{foo});</tt></font>
<br>
<br>
<br><font size=2><tt>Btw, I'm skeptical that the code below does what you
want it to do. :-)</tt></font>
<br><font size=2><tt> <br>
> my @my_list; # remember those semicolons<br>
> my %a_dict, %b_dict;<br>
> push @my_list, %a_dict;<br>
> push @my_list, %b_dict;<br>
> if (exists $my_list->[0], "foo") print "Yes\n";<br>
> # yes, references required, in Perl ick.<br>
> _______________________________________________<br>
> Tutor maillist - Tutor@python.org<br>
> http://mail.python.org/mailman/listinfo/tutor<br>
</tt></font>