Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
hey:
one of the problems im trying to solve is in my last post
java development is very expensive in terms of dev time and project budget

and for eai
perl could do things a lot faster
and with less difficulty


this site has java eai examples
http://tecfa.unige.ch/guides/vrml/examples/eai/

ok i havent tested these code pieces
thoughoughly but check it out
there are some differences in the way they currently work
mostly because there is no activex/pluing for perl!!
here is the java directory of code for changing rgb
http://tecfa.unige.ch/guides/vrml/examples/eai/rgb-change/
check out RGBChange.java its the core of it all
there is an html page there you should be able to load if you hava a vrml plugin:
say http://www.parallelgraphics.com/ plugin under windows

here is the perl code
# Very simple: just get the TouchSensor event and give # a random color to the other box. # NOTE - this does not work very well, at all!!!! Have # to figure out how best to fix it. JAS. $PORT=90000; use IO::Socket; $server = IO::Socket::INET->new(Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, Reuse => 1) or die("Can't set up server"); system("perl /usr/bin/freewrl t1.wrl -best -eai localhost:$PORT eai &" +); $sock = $server->accept(); $sock->autoflush(1); sub getlines { print "jt1.pl getlines starting\n"; my @arr; for(1..$_[0]) { print "jt1.pl EXPECTING ROW $_\n"; my $str = <$sock>; chomp $str; print "jt1.pl GOT '$str'\n"; push @arr, $str; } print "jt1.pl returning from getlines @arr\n"; return @arr; } # Test the sample EAI protocol. $a = <$sock>; $sock->print("TJL EAI CLIENT 0.02\n"); $sock->print("1\nGN TS\n"); my @l = getlines(4); # print "\njt1.pl ok, REAL node of TS is $l[3]\n\n"; $sock->print("2\nGN MAT\n"); my @m = getlines(4); # print "\njt1.pl ok, node of MAT is $m[3]\n\n"; # print "jt1.pl SENDING 3 RL $l[3] TouchTime XX\n"; $sock->print("3\nRL $l[3] touchTime XX\n"); my @l2 = getlines(4); # print "jt1.pl - Touchtime returned @l2\n"; # XXX This is fragile - it breaks if user clicks quickly and two event +s # come before our response gets to them while(@x = getlines(3)) { print "jt1.pl in while loop with @x\n"; if($x[1] ne "XX") {die("Invalid ev '$x[1]'")} $sock->print("15\nSE $m[3] diffuseColor\n".(join ' ',map {rand +} 0..2)."\n"); #@y = getlines(4); #print "jt1.pl finishing while loop with @y\n"; }

please keep in mind this is the first
implementation of perl eai in freewrl
no other vrml viewer/browser
has the capability of running perl...yet

hope that helps in understanding!


back in the day we didnt have no old school

In reply to Re: Re: possible: a perl plugin for web browsers? by drfrog
in thread possible: a perl plugin for web browsers? by drfrog

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found