Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

RE: (jcwren) RE: RE:

by tye (Sage)
on Aug 06, 2000 at 08:35 UTC ( #26404=note: print w/replies, xml ) Need Help??

in reply to (jcwren) RE: RE:
in thread

I'll jump in. Here is how to use a hash slice:

$csv->print ($fh, [ $nodehash->{$_}->{nodeid}, $nodehash->{$_}->{title}, $nodehash->{$_}->{rep}, $nodehash->{$_}->{date} ] ) # Can be written like: $csv->print ($fh, [ @{ $nodehash->{$_} }{ qw(nodeid title rep date) } ] )

Note that the syntax for getting a hash slice from a reference is a bit ugly. Being able to use

$hashref->@{qw(this that other)}
has been proposed but I haven't seen a patch for it.

        - tye (but my friends call me "Tye")

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://26404]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2017-06-23 04:43 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (534 votes). Check out past polls.