Dear Sir, I am writing to thank you for your letter and hope that you will tolerate this probably stupid reply ..
On Mon, Feb 14, 2005 at 01:10:39PM -0700, Southern, David wrote: .. [snip] > > So, the problem: In order for this to work, I have to have DynTrans.pm > in the directory where I run my application. I want to remove this > requirement, I want the entire application to be completely > self-contained. I have gone so far as to modify my code like this: > > perl_setup_module(); > eval_pv("use DynTrans;", FALSE); > perl_cleanup_module(); > > [snip] > So, the question: Is there a way that I can make XSUBs availiable to my > perl interpreter without having to have the .pm file around at all? I > tried building the entire .pm file into my application with a series of > eval_pv() for every line, but of course that didn't work. > Why not eval_pv(STRING_CONTAINING_YOUR_PM) ? This is good for evaluating arbitrary Perl from C eg #define DO_READLINE \ "$_ = defined($term) " \ " ? $term->readline($prompt) " \ " : do { " \ " print $prompt; " \ " chomp($_ = <>); " \ " $_; " \ " }; " \ "die qq(That's all folks.\\n) " \ " unless $_ && ! /^\\s*$/ ; " \ "$_; " #define INIT_TERM_READLINE \ "use vars qw($term $prompt $OUT); " \ \ "eval { require Term::ReadLine; }; " \ "unless ($@) { " \ " $term = new Term::ReadLine 'new_mini_epn'; " \ "} else { " \ " warn qq(Install Term::ReadLine for arrow key access to history, filename completion etc.); " \ "} " \ .. yada yada. (This is to use Term::ReadLine from C [via other eval_pv()s], but I think you get the picture. In this case, I have embedded Perl for other reasons so using Term::ReadLine to provide a nice UI seems reasonable.) > What I would really like is a programatic interface into whatever the > use DynTrans; perl stuff does. I have read and re-read perlembed, > perlxs, perlguts, perlapi, perlcall, several perl books, forums, > SuperSearch, etc. and I cannot find a way to do this. > > Can anyone save me from the dreaded .pm file? Thanks in advance. > > _____________________________________________________________________ HTH, or someone corrects it. Yours sincerely. -- Stanley Hopcroft IP Australia Ph: (02) 6283 3189 Fax: (02) 6281 1353 PO Box 200 Woden ACT 2606 http://www.ipaustralia.gov.au
-- This message contains privileged and confidential information only for use by the intended recipient. If you are not the intended recipient of this message, you must not disseminate, copy or use it in any manner. If you have received this message in error, please advise the sender by reply e-mail. Please ensure all e-mail attachments are scanned for viruses prior to opening or using.