Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: Can a socket listen for multiple hosts?

by ikegami (Patriarch)
on Feb 01, 2010 at 15:13 UTC ( [id://820761]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Can a socket listen for multiple hosts?
in thread Can a socket listen for multiple hosts?

Adjust
$buf =~ s/\G(.*\n)//g
to match your definition of record. If your record terminator is "***", you can use
$buf =~ s/\G(.*?\*\*\*)//sg

If your records are double quoted strings, you can use

$buf =~ s/\G("(?:[^"\\]|\\.)*")//sg

If you're using fixed-length records, you can use

$buf =~ s/\G(.{128})//sg
etc.

Replies are listed 'Best First'.
Re^6: Can a socket listen for multiple hosts?
by sierpinski (Chaplain) on Aug 16, 2010 at 15:16 UTC
    I found this thread while super-searching on another Socket question I had, and realized I never updated it with how I ended up achieving this. I user Data::Dumper to flatten the hash into a scalar, sent that to the server, then used eval to turn it back into a hash, and it worked flawlessly.

    Of course now I'm trying the educational task of creating a two-way client-server app using IO::Socket without going back and copy/pasting a bunch of code. I'm learning much more this way, but it's taking me a bit longer to get it working. Thanks again for the responses ikegami!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found