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

Re: Passing a hash into a subroutine

by tune (Curate)
on Jan 08, 2004 at 08:55 UTC ( #319752=note: print w/ replies, xml ) Need Help??

in reply to Passing a hash into a subroutine

You should provide the code where you are trying to collect the values of the hash. It is very hard to find one's error until the code is remaining hidden.

Here is a tip until you do that:

#!/usr/bin/perl use strict; use Data::Dumper; convert ( 'MIME-Type' => 'application/ms-word', 'Input' => '[In file]', 'Output' => '[Out file]' ); sub convert { my %hash = @_; # show the full thing print Dumper(\%hash); # or just one value print $hash{'Output'},"\n"; }
I prefer passing hashrefs though...


Comment on Re: Passing a hash into a subroutine
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://319752]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-11-25 19:27 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (686 votes), past polls