Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Doubts of a perl beginner on PERLEMBED

by jithoosin (Scribe)
on Dec 19, 2005 at 06:10 UTC ( [id://517664]=note: print w/replies, xml ) Need Help??


in reply to Re: Doubts of a perl beginner on PERLEMBED
in thread Doubts of a perl beginner on PERLEMBED

Hi ,
Sorry for disturbing you again. As I had to call subroutine named "test" in file 'file1.pl i used
char *my_argv[] = {"","-e","require 'file1.pl';require 'file2.pl';" }
and then used
call_argv("test",G_DISCARD,args);
But i am getting error Undefined subroutine &main::test called.What could be the reason

UPDATE : The error was not shown when i included "perl_run" after perl_parse.What could be the possible reason?

Replies are listed 'Best First'.
Re^3: Doubts of a perl beginner on PERLEMBED
by robin (Chaplain) on Dec 19, 2005 at 08:47 UTC
    The files file1.pl and file2.pl are loaded by the require statements. If you don't execute the require statements (by running the script) then the files won't be loaded. Simply compiling the one-liner isn't enough to load the files.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://517664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found