Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Help with passing of ports and xml files...

by basicdez (Pilgrim)
on Nov 22, 2001 at 03:02 UTC ( #126881=perlquestion: print w/replies, xml ) Need Help??

basicdez has asked for the wisdom of the Perl Monks concerning the following question:

I am creating a program that takes a flat file and creates an XML file to send back out to one part of the world through a defined port with an IP address.

Can any of you please share with me the best resource for ports and passing of files. I would be grateful for any advice in this area of perl.

Oh, and Happy Thanksgiving. Gobble, Gobble,

peace, LOVE and ((code))

Edit by tye

  • Comment on Help with passing of ports and xml files...

Replies are listed 'Best First'.
Re: Help with passing of ports and xml files...
by growlf (Pilgrim) on Nov 22, 2001 at 14:51 UTC

    Well, for what ports to use (assuming you are talking about the TCP/UDP ports, not slang for "modules") then you might want to take a gander at your local services file. On a windows2k box it is typically in c:\winnt\system32\drivers\etc\services. In most *nix boxes, look for it as /etc/services. This file is a list of all defined ports (not all of them are necessarily in use, but these are the definitions that your box understands for those ports).  From this list, choose one that does not conflict with an existing service/program/daemon or whatnot.

    Now, if on the other hand, you are looking for "modules" to use in your code, here are a few ideas that I recently used on a pet project of my own that is very similar.

    1. XML:Simple is a fine quick start for XML handling.  Watch it though, it does no DTD or validity testing for you.
    2. DBD::CSV and DBI to get the flat file into the program.
    3. And then for your connections, you could use any one of a number of programs - all depending on exactly what you want to do in more specific detail.  If you are going to stay within the standard protocols (like FTP and HTTP) you night want to look into LWP::Simple or Net::FTP for a one stop solution and easy use.  If you need more specific port control, and perhaps more customization of the protocol is needed (a home-brew security, compression, or other modification) you could start out with IO:socket or for a more daemon/server style service you may want to look into adding in POE.

    Hope this helps either way. Cheers! ..and happy turkey day!


by basicdez (Pilgrim) on Nov 22, 2001 at 03:05 UTC
    I know there is someone wiser than me out there, but I inadvertantly made a type and need you to ignore this one and not be to harsh on me for accidently posting this out there.

    peace, LOVE and ((code))

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://126881]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-01-21 12:41 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (57 votes). Check out past polls.