>Today around 11:48am, Tom Christiansen hammered out this masterpiece: >: >So basically, it would be nice if each, keys, values, etc. could all deal >: >with being handed a hash from a code block or subroutine... >: >: In the current Perl World, a function can only return as output to >: its caller a LIST, not a HASH nor an ARRAY. Likewise, it can only >: receive a LIST, not those other two. >So, this is really a bug? >#!/usr/local/bin/perl -w >use strict; >$|++; >sub func { > return qw/KeyOne Value1 KeyTwo Value2/; >} >print "$_\n" foreach keys &func(); No. keys() expects something that starts with a %, not something that starts with a &. --tom
- functions that deal with hash should be more liberal Jerrad Pierce
- Re: functions that deal with hash should be more ... Tom Christiansen
- Re: functions that deal with hash should be m... Casey R. Tweten
- Re: functions that deal with hash should ... Tom Christiansen
- Re: functions that deal with hash sho... Casey R. Tweten
- Re: functions that deal with has... Tom Christiansen
- Re: functions that deal with... Casey R. Tweten
- Re: functions that deal with has... Nathan Torkington
- Re: functions that deal with... Chaim Frenkel
- Re: functions that deal with has... Jonathan Scott Duff
- Re: functions that deal with hash should ... John Porter
- Re: functions that deal with hash sho... Casey R. Tweten
- Re: functions that deal with hash should be more ... Jerrad Pierce
- Re: functions that deal with hash should be m... Tom Christiansen