in reply to Re: Apply function "keys" directly to function returning hash
in thread Apply function "keys" directly to function returning hash

Hmm. Well, yes, this *does* get me the keys of the hash, but my intent was rather more general: I wanted to be able to call a perl internal function which takes a hash directly with a function call as a parameter, i.e. "somefunc func()".
But thanks anyways!.

daniel.
  • Comment on Re: Re: Apply function "keys" directly to function returning hash

Replies are listed 'Best First'.
Re: Re: Re: Apply function "keys" directly to function returning hash
by sgifford (Prior) on Aug 26, 2003 at 18:07 UTC
    It's not an internal function, but it does work exactly as you describe:
    #!/usr/bin/perl -sw use strict; sub somefunc(@) { my $i = 1; grep { $i++ % 2 } @_; } sub func { return ( 1 => "one", 2 => "two", 3 => "three", ); } print join(" ",somefunc func());