Hi Paul, yeah that's how I've been doing it (roughly). It works fine, I just thought there might be some nifty syntax.<br><br>Thanks<br>Jay<br><br><div class="gmail_quote">On Wed, Dec 2, 2009 at 8:27 PM, Paul Mantz <span dir="ltr"><<a href="mailto:pcmantz@gmail.com">pcmantz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Wed, Dec 2, 2009 at 7:38 PM, Jay Strauss <<a href="mailto:me@heyjay.com">me@heyjay.com</a>> wrote:<br>
> Hi All, hope you had a nice thanksgiving.<br>
><br>
> If I have a 10x10 array of arrays like:<br>
><br>
> [40 8 79 8 73 71 77 35 12 67]<br>
> [4 79 10 90 45 17 30 29 65 86]<br>
> [56 86 5 34 23 79 17 83 24 85]<br>
> [58 85 46 53 15 31 34 4 14 15]<br>
> [68 15 97 21 81 95 71 82 26 90]<br>
> [59 70 11 82 39 25 36 84 88 13]<br>
> [66 6 85 1 84 17 27 58 60 94]<br>
> [34 10 38 90 32 0 56 14 23 70]<br>
> [71 23 5 97 4 71 27 20 11 87]<br>
> [5 8 23 30 97 16 10 93 16 67]<br>
><br>
> Is there any notation I can use to get "column 1", i.e. $a[0][0], $a[1][0],<br>
> $a[2][0]... without looping over the whole structure<br>
><br>
> I need to find the max value in each column<br>
><br>
> I know how to do it in a loop, but I thought maybe there was some neato way<br>
> in a slice.<br>
><br>
> Thanks<br>
> Jay<br>
><br>
</div></div>> _______________________________________________<br>
> Chicago-talk mailing list<br>
> <a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
><br>
<br>
I don't know how you'd go about doing it with slices, but I like using<br>
map for things like this.<br>
<br>
map { $_->[$col] } @grid;<br>
<br>
will pretty much give you what you're looking for.<br>
<br>
--<br>
<font color="#888888">Paul Mantz<br>
<a href="http://www.mcpantz.org" target="_blank">http://www.mcpantz.org</a><br>
BackupPC - Network Backup with De-Duplication <a href="http://www.backuppc.com" target="_blank">http://www.backuppc.com</a><br>
Zmanda - Open source backup and recovery <a href="http://www.zmanda.com/" target="_blank">http://www.zmanda.com/</a><br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
</font></blockquote></div><br>