in reply to Re: passing a hash to module function
in thread passing a hash to module function

That won't help, for two reasons. One is that the code accesses $param as a hash reference. The more important reason is that the function gets called as a method but doesn't deal with the invocant.

Replies are listed 'Best First'.
Re^3: passing a hash to module function
by kosta (Sexton) on Feb 15, 2011 at 19:08 UTC
    ok so how do I fix it? I dont know how to pass it properly... I am okey just passing it somehow. I want to have a hash passed to that funtion
      When you pass a hash to a function, this "flattens out" as a sequence of key, value. No need to worry, follow the below formula:

      ### Create a new multipart message: $msg = MIME::Lite->new ( From => 'me@myhost.com', To => 'you@yourhost.com', Cc => 'some@other.com, some@more.com', Subject => 'A message with 2 parts...', Type => 'multipart/mixed' ); ### use Net:SMTP to do the sending $msg->send('smtp','some.host', Debug=>1 ); Same as: $msg->send('smtp' => 'some.host', 'Debug' => 1 );
      you were passing a reference to a hash instead of the actual hash which is key value pairs.

      Update: Ooops. What Wind has written is correct. I missed that you were passing a hash ref to a very, very thin layer. My bad.