sweetblood has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Net::Netrc; use Tie::File; use vars qw($CONF); $CONF = '/data/retprep/retlogs/retrieve.conf'; my @conf; tie @conf, 'Tie::File', $CONF or die("Unable to tie config file $CONF: + $!"); print "There are ". scalar(@conf), " records in config file $CONF\n"; foreach $_ (@conf) { chomp; my ($retid, $host, $files, $freq, $proto, $depricated, $prev_fdate +, $opts, $start_day) = split(/:/,$_,9); print "$host\n"; my $mach = Net::Netrc->lookup($host) || die $!; }
If I comment out the Net::Netrc lookup then the script works fine. This of course is only a very trimmed down version of my actual script for automated ftp retrieval.There are 3 records in config file /data/retprep/retlogs/retrieve.conf ftp.some_domain.com/pub
Prior to this I was not using Tie::File I was just openning the file and slurping it into an array. This too worked fine.
My system is an HP-UX 11 perl v5.6.1
If anyone has any suggestions I'd be eternally grateful.
TIA
Sweetblood
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem using Net::Netrc and Tie::File
by Zaxo (Archbishop) on Jun 12, 2004 at 05:08 UTC | |
by sweetblood (Prior) on Jun 12, 2004 at 15:05 UTC | |
by hsinclai (Deacon) on Jun 12, 2004 at 23:54 UTC | |
by sweetblood (Prior) on Jun 13, 2004 at 04:18 UTC |