in reply to Hashes as return values
---Output---#!/usr/bin/perl -l use strict; use warnings; package Module; sub new { bless { ACLS => {foo => 1, bar => 2} }, shift; } sub acls { my ($self , $callbackref) = @_; while ( my ($k,$v) = each %{ $self->{ACLS} }){ &$callbackref($k,$v); } } package main; my $mod=Module->new; $mod->acls ( sub{ print "@_\n"; } );
bar 2 foo 1
You're just jealous cause the voices are only talking to me.
No trees were killed in the sending of this message. However, a large number of electrons were terribly inconvenienced.
|
|---|