blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:
Consider the following code:
When that is run I get an error:#!/usr/bin/perl use strict; use File::Remote; my $rp=new File::Remote( rsh=>"/usr/bin/ssh", rcp=>'/usr/bin/scp'); $rp->open (ARPFILE,"xeng-mon01:/usr/local/router-walk/data/arp.csv") or die $!; my $line=<ARPFILE>; print $line;
which confuses the heck out of me. When I do something likeBareword "ARPFILE" not allowed while "strict subs" in use at testFileR +emote.pl line 8.
it gives me the first line of my /etc/passwd file just like I'd expect. What gives here? Anybody else see this?#!/usr/bin/perl use strict; open FIN,"</etc/passwd" or die $!; my $line=<FIN>; print $line;
Or am I getting senile in my old age?
UPDATE: Since posting this and before reading the replies from folks (Thanks shmem, rblaschand Herkum!) I had two beers and tried an experiment and it worked. By changing the first example's open call to
strict was happy again. Then I read the replies and discovered why it worked. Thanks again gang! </code>$rp->open(*ARPFILE....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Remote wierdness. (problems using strict?)
by shmem (Chancellor) on Jun 21, 2006 at 18:11 UTC | |
|
Re: File::Remote wierdness. (problems using strict?)
by Herkum (Parson) on Jun 21, 2006 at 19:51 UTC | |
|
Re: File::Remote wierdness. (problems using strict?)
by rblasch (Monk) on Jun 21, 2006 at 19:43 UTC |