How to run perl script which is loaded into a string?

Y

yong

I load some perl script from socket,and store them into some
strings.Can I send the strings to perl directly and run them?

thanks
 
J

Josef Moellers

yong said:
I load some perl script from socket,and store them into some
strings.Can I send the strings to perl directly and run them?

You can create a gaping security hole by using eval().
 
Y

yong

Thanks a lot. :)

And by the way,if I load the script to string with other language for
exmaple C,how can I do this?

thanks
 
A

Anno Siegel

yong said:
Thanks a lot. :)

And by the way,if I load the script to string with other language for
exmaple C,how can I do this?

You ask a group that concerns itself with C.

Anno
 
S

Samwyse

yong said:
Thanks a lot. :)

And by the way,if I load the script to string with other language for
exmaple C,how can I do this?

Not nearly as easily. You need to write the string to a file, invoke
your favorite C compiler, and run the resulting executable. All of the
above needs to be done in a way that avoids collisions if multiple
instances of your parent script are running simultaneously.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top