Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Embperl question

Reply
Thread Tools

Embperl question

 
 
dogdog@noemail.com
Guest
Posts: n/a
 
      11-29-2004
Setup my apache with mod_perl and with Embperl::HTML

I've written my embedded perl into my webpage using the
[- -] tags to enclose some socket connection perl. Using
IO::Socket::Inet and I've setup the
connection according to some online documentation. It all
works great from the command line.

Now that I've embedded that same code into a webpage with the
above mentioned tags I'm getting this error

"Cant call method send on an undefined variable"

The line is in reference to my send command where I send
a command to the remote server.
I put in a define like this so I'm not sure why it would
fail to send.

$defined_variable="command";
$socket->send($defined_variable);

Any reason why it fails with a socket connect?

Also, I would like to use embperl to make calls to a text box and
or "radio" type buttons.
Where as I would have the user type in a command and hit submit,
then it would process the command and send it to the server plus
provide back the setting in the text box. Could
I get some ideas on how to write this in the html. I have
the perl scripts that work from command line but I have no
clue on how to put it into html. Plus I havent been able to
find anything on google or in
a reference for this while using embperl.

TIA
dogdog


 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      11-30-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> "Cant call method send on an undefined variable"
> Any reason why it fails with a socket connect?
> $defined_variable="command";
> $socket->send($defined_variable);


You're focusing on the wrong thing. Add this line between those two:
die "Socket creation failed" unless defined $socket;

Any further questions should be posted to comp.lang.perl.misc,
not this newsgroup (comp.lang.perl).
-Joe
 
Reply With Quote
 
 
 
 
dogdog@noemail.com
Guest
Posts: n/a
 
      12-01-2004
On Tue, 30 Nov 2004 10:05:45 +0000, Joe Smith wrote:

> (E-Mail Removed) wrote:
>
>> "Cant call method send on an undefined variable"
>> Any reason why it fails with a socket connect?
>> $defined_variable="command";
>> $socket->send($defined_variable);

>
> You're focusing on the wrong thing. Add this line between those two:
> die "Socket creation failed" unless defined $socket;
>
> Any further questions should be posted to comp.lang.perl.misc,
> not this newsgroup (comp.lang.perl).
> -Joe

joe,

thanks for the response, i'll subscribe to that newsgroup. I have
alot of questions related to perl and how I can better use it
with webpages.

thanks again
dogdog
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embperl and mod_perl support Hobo Salesman Perl Misc 1 06-20-2006 10:22 AM
Embperl Execute soup_or_power@yahoo.com Perl Misc 0 08-30-2005 08:37 PM
Sharing variables between embPerl and Perl webgirl Perl Misc 1 06-24-2005 07:36 PM
http_headers_out embperl soup_or_power@yahoo.com Perl Misc 0 05-02-2005 04:03 PM
[BEGINNER] Embperl question soup_or_power@yahoo.com Perl Misc 4 04-07-2005 05:01 PM



Advertisments