Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

editting hosts file

by Pearte (Beadle)
on Apr 26, 2012 at 18:53 UTC ( [id://967437]=perlquestion: print w/replies, xml ) Need Help??

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

Is there a clean interface via Perl to /etc/hosts?

I've been trying to use Config::Hosts, but it seems a little rough / unreliable. Just wondered if there's a better / easier way ... ???

Bonus points if it works on WIN32 as well.

Shine On

Replies are listed 'Best First'.
Re: editting hosts file
by jwkrahn (Abbot) on Apr 26, 2012 at 22:24 UTC
    Is there a clean interface via Perl to /etc/hosts?

    gethostent

Re: editting hosts file
by Anonymous Monk on Apr 26, 2012 at 21:49 UTC
    C:\> notepad.exe c:\Windows\System32\Drivers\etc\hosts

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found