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....
In reply to File::Remote wierdness. (problems using strict?) by blue_cowdawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |