From: Jamie C. <jca...@we...> - 2001-03-27 07:58:27
|
Joe Cooper wrote: > > Ok... I'm almost there. But I'm stumped now. My perl ignorance is showing. > > Is there a way for me to pass the hash to a foreign_call? > > I've confirmed that everything is correct in the hashes (%user and %group): > > %user = > shell/bin/shhome/home/httpd/test7uid504realtest7gid504pass$1$85678922$2XoiZBuEZP.uSqRpjCRuP/usertest7 > > %group = gid504grouptest7 > > (Correct?) > > But I don't think it is being passed to the foreign_call to create_user > and create_group. All is get in my passwd and group files is this: > > :x::::: > > and > > :x:: > > I've tried all three of the following with no luck: > > &foreign_call("useradmin", "create_user", "%user"); > &foreign_call("useradmin", "create_user", "\%user"); > &foreign_call("useradmin", "create_user", %user); > > I've found references to lots of very roundabout methods of passing a > hash to a function (by converting them to arrays or a string), all of > which have me confused. So will the function accept an array or a > string and fit it back into being a correct hash, or should I, perhaps > copy the function into my module-lib.pl? You just have to pass it as a reference .. like so : &foreign_call("useradmin", "create_user", \%user); I don't think there is any way to pass an actual hash to a perl function .. - Jamie |