Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Divine Monks, I currently have a file that is a list of HTTP statements. I want open a socket (or a socket for each HTTP statement), and print the http command:
so far, this is my direction...and this may be wrong (hence the post)
I plan to open the file
$file = '/home/steven/http.list'; open(INFO, $file); @lines = <INFO>; close(INFO);

then I was thinking use a "for, foreach"
foreach $i(@lines){

and this is where i need a socket???
I have heard that I could use IO::Socket, but not really knowing the semantics of perl, it's not quite as easy to piece together the scraps of sample code I've borrowed from all corners of the world....
here's my socket :
#!/usr/bin/perl -w use strict; use IO::Socket; my $sock = new IO::Socket::INET ( PeerAddr => '', PeerPort => '80', Proto =>'tcp', ); die "Could not create socket: $!\n" unless $sock; print $sock ""this is where i need my http statement to go (from the f +ile list"; close($sock);

my green horns are clearly poking through.....
I appreciate any help ..cheers..... stevenrh

UPDATE: Thanks all for your help, and for being so cool to a noob, who could've RTFM (for a while).
I really appreciate it

In reply to open a socket and print from stdin....i think by stevenrh

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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-09-30 22:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found