If I do this
Execute ({inputfile => 'findList.sub', import => 1});
Then this line in findList.sub will not be executed if it's outside the subs
in findList.sub:
[- $req = shift -]
But I'm using the $req object, so I'll try this:
Execute ('findList.sub');
OK except that the subs are not imported now.
Will I have to do this to get what I want - which is both the req object AND
the sub routines ?
Execute ({inputfile => 'findList.sub', import => 1}); Execute ('findList.sub');
If you need just the subs in a file you can import or use the "objet" syntax:
$obj = Execute({object => 'findList.sub'});
and then use a pseudo-constructor passing the $req object and store the $req inside the object:
$obj->initialize($req);
After this you call your subs as methods: $obj->do_something
But with this technique you have to change your subs to receive the $obj (or $self if you like) as the first parameter in @_.
You can make it even more smart if you are using EmbperlObject. If you execute your files with the "isa" syntax in the "base template" file you can call your subs as methods of the $req object.
This is just one of the alternatives.
Other solution is to pass the $req to every sub you call in the file imported.
-- Luiz Fernando B. Ribeiro Engenho Solu��es para a Internet
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
