#!/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
In reply to Problem using Net::Netrc and Tie::File by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |