Skip Menu |

This queue is for tickets about the Config-Hosts CPAN distribution.

Report information
The Basics
Id: 96480
Status: open
Priority: 0/
Queue: Config-Hosts

People
Owner: Nobody in particular
Requestors: Ty_Young [...] Dell.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: FW: UPDATE: inquiry on Config::Hosts
Date: Mon, 16 Jun 2014 20:58:41 +0000
To: <bug-Config-Hosts [...] rt.cpan.org>
From: <Ty_Young [...] Dell.com>
Dell - Internal Use - Confidential What would it take to enable Config::Hosts to add/modify/delete a comment for an entry in /etc/hosts ? More of a feature request than anything else, I guess ... From: Young, Ty Sent: Monday, June 16, 2014 8:52 AM To: 'roman@parparov.com' Subject: inquiry on Config::Hosts Dell - Internal Use - Confidential Hey Roman, thank you for providing the Config::Hosts CPAN module. I have a question about its usage, and I will confess that I'm not the world's most experienced Perl scripter. So I want to read in a local /etc/hosts file. My belief, from your documentation (perldoc Config::Hosts) is that I need to create a new object: my $hosts = Config::Hosts->new(); ... and then, to read the contents of /etc/hosts into a hash ... %lines = $hosts->read_hosts(); ... and then just cycle through each entry, evaluating it to see if it contains a valid IP: $valid = $hosts->determine_ip_or_host ($key); ... and test to see if $valid is a 1 or a -1. Is that basically it ? -ty Ty Young Sr Data Protection Engineer Data Management Team for Wolters Kluwer, USA 972-577-7957 (o) | 469-301-5821 (m) [dell_logo] Dell | Dedicated Infrastructure Services Delivery
Download image001.jpg
image/jpeg 2.5k
image001.jpg
What's this "Dell - Internal Use - Confidential" stuff? Anyways, you can specify comment in %param parameter for insert_host and update_host. R. On Mon Jun 16 14:01:01 2014, Ty_Young@Dell.com wrote: Show quoted text
> Dell - Internal Use - Confidential > What would it take to enable Config::Hosts to add/modify/delete a > comment for an entry in /etc/hosts ? More of a feature request than > anything else, I guess ... > > > > From: Young, Ty > Sent: Monday, June 16, 2014 8:52 AM > To: 'roman@parparov.com' > Subject: inquiry on Config::Hosts > > > Dell - Internal Use - Confidential > Hey Roman, thank you for providing the Config::Hosts CPAN module. > > I have a question about its usage, and I will confess that I'm not the > world's most experienced Perl scripter. > > So I want to read in a local /etc/hosts file. My belief, from your > documentation (perldoc Config::Hosts) is that I need to create a new > object: > > my $hosts = Config::Hosts->new(); > > ... and then, to read the contents of /etc/hosts into a hash ... > > %lines = $hosts->read_hosts(); > > ... and then just cycle through each entry, evaluating it to see if it > contains a valid IP: > > $valid = $hosts->determine_ip_or_host ($key); > > ... and test to see if $valid is a 1 or a -1. > > Is that basically it ? > -ty > > > > Ty Young > Sr Data Protection Engineer > Data Management Team for Wolters Kluwer, USA > 972-577-7957 (o) | 469-301-5821 (m) > [dell_logo] > Dell | Dedicated Infrastructure Services Delivery
Subject: RE: [rt.cpan.org #96480] FW: UPDATE: inquiry on Config::Hosts
Date: Fri, 4 Jul 2014 13:58:19 +0000
To: <bug-Config-Hosts [...] rt.cpan.org>
From: <Ty_Young [...] Dell.com>
Dell - Internal Use - Confidential Haha, sorry about the 'Dell internal use' stuff ... they auto-insert those in all our e-mails and we have to manually delete 'em, which I forgot to do. :) Thank you for your response and thanks for supplying this module! -ty Show quoted text
-----Original Message----- From: Roman Parparov via RT [mailto:bug-Config-Hosts@rt.cpan.org] Sent: Monday, June 16, 2014 4:11 PM To: Young, Ty Subject: [rt.cpan.org #96480] FW: UPDATE: inquiry on Config::Hosts What's this "Dell - Internal Use - Confidential" stuff? Anyways, you can specify comment in %param parameter for insert_host and update_host. R. On Mon Jun 16 14:01:01 2014, Ty_Young@Dell.com wrote:
> Dell - Internal Use - Confidential > What would it take to enable Config::Hosts to add/modify/delete a > comment for an entry in /etc/hosts ? More of a feature request than > anything else, I guess ... > > > > From: Young, Ty > Sent: Monday, June 16, 2014 8:52 AM > To: 'roman@parparov.com' > Subject: inquiry on Config::Hosts > > > Dell - Internal Use - Confidential > Hey Roman, thank you for providing the Config::Hosts CPAN module. > > I have a question about its usage, and I will confess that I'm not the > world's most experienced Perl scripter. > > So I want to read in a local /etc/hosts file. My belief, from your > documentation (perldoc Config::Hosts) is that I need to create a new > object: > > my $hosts = Config::Hosts->new(); > > ... and then, to read the contents of /etc/hosts into a hash ... > > %lines = $hosts->read_hosts(); > > ... and then just cycle through each entry, evaluating it to see if it > contains a valid IP: > > $valid = $hosts->determine_ip_or_host ($key); > > ... and test to see if $valid is a 1 or a -1. > > Is that basically it ? > -ty > > > > Ty Young > Sr Data Protection Engineer > Data Management Team for Wolters Kluwer, USA > 972-577-7957 (o) | 469-301-5821 (m) > [dell_logo] > Dell | Dedicated Infrastructure Services Delivery