in reply to Re: Passing HASH values to a abc.pl file from command line
in thread Passing HASH values to a abc.pl file from command line

Thanks Cmapuk. This helps.

Actually I am trying to send key value pairs that represent name and associated email ID to a perl file which in turn calls a send_mail.pl that uses the Hash values passed.

was thinking of another way to do it, if possible

Ananda

  • Comment on Re: Re: Passing HASH values to a abc.pl file from command line

Replies are listed 'Best First'.
Re: Re: Re: Passing HASH values to a abc.pl file from command line
by BrowserUk (Patriarch) on Dec 04, 2002 at 12:35 UTC

    Ananda You might get a better response to your question if you would clarify your needs. I've read your original post and this one several times, and it's still not clear to me what it is you are trying to do.

    What do you mean by "send key value pairs that represent name and associated email ID to a perl file"?

    In your original post you ask "Is it possible to pass hash values (%a, %b) to perl script files (abc.pl) from command line", and then show a comand line with %a and %b.

    Where would these variables/values come from? Another script, a database? WOuld you type them?

    In this post you mention that you want to pass key/value pairs (name/emailid) into a script...but you don't say where you would get those pairs from?

    Reading between the lines, it sounds like your have an existing script that has a hash with the key/value pairs in it, and you have another script that takes a name & emailid pair and uses it to call sendmail, and you wish to call the second script from within the first and pass the key/value pairs from the first to the second, either individually or en-masse.

    If either of these is what you want, then both are possible, but you need to explain your problem more clearly, perhaps show a little code of how/where the hash is built and how/when you want to pass the data.

    Given a little more information, any number of monks would be only to pleased to help.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

      Greetings

      Verry sorry for not having given the exact requirement!!.

      The Requirement was something like this......

      A pre-populated HASH pair is made available to a script, which after certain validations, passes these HASH values to another perl script that sends out mails (sendmail.pl).

      This sendmail.pl retreives the email ids from HASH pair and forwards mails to these id's.

      I hope, the Case is a bit clear now.

      The problems encountered were with passing these HASH values to the sendmail.pl from within the script.

      ALAS! I have found a solution , though may not be the best approach, in converting the Sendmail.pl to a subroutine and then passing these HASH pair.

      I will be submitting the code shortly. (both the initial one and the modified one).

      Kindly excuse for the delay

      CHEERS!!

      Ananda

Re: Re: Re: Passing HASH values to a abc.pl file from command line
by cmapuk (Novice) on Dec 04, 2002 at 11:47 UTC
    Maybe you need "require" ?
    perldoc -f require



    Save me, St.Perldoc!