Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

copying file using Net::SCP module

by jesuashok (Curate)
on Sep 19, 2006 at 05:44 UTC ( #573636=perlquestion: print w/replies, xml ) Need Help??
jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

dear monks,

use Net::SCP qw(scp); $scp = Net::SCP->new( "155.226.206.195", "metrica"); $scp->get("/apps/inst1/metrica/sample.txt") or die $scp->{errstr};
I have taken the above code from Net::SCP pod. when I executed the above code, I got the following error message
C:\Antony\Perl>perl l.pl Died at l.pl line 5.
help would be appreciated.

"Keep pouring your ideas"

Replies are listed 'Best First'.
Re: copying file usnig Net::SCP module
by ysth (Canon) on Sep 19, 2006 at 06:29 UTC
    So what's on line 5? (You've only shown us 4 lines.)

    What does this do?

    use Net::SCP qw(iscp); iscp("metrica\@155.226.206.195:/apps/inst1/metrica/sample.txt", ".");
    (update: escaped @)
      ysth,

      nothing is there on line 5. I have only 4 lines of code.

      "Keep pouring your ideas"
Re: copying file usnig Net::SCP module
by Khen1950fx (Canon) on Sep 19, 2006 at 08:41 UTC
    I think that you have the procedural interface confused with the OO interface. Your code mixes the two. It seems that your intent was to use the procedural interface:

     use Net::SCP qw(scp); is procedural---not OO.

    $scp = Net::SCP->new( "155.226.205.195", "metrica"); $scp->get("/apps/instl/metrica/sample.txt") or die $scp->{errstr};
    ---is OO.

    I would stick with procedural and take another look at the code that ysth posted.

      Khen1950fx

      use Net::SCP; $scp = Net::SCP->new( "155.226.206.195", "metrica"); $scp->get("/apps/inst1/metrica/antony.txt") or die $scp->{errstr};
      Still I am getting the same issue.

      "Keep pouring your ideas"
        Does the code run if you change the die to a warn?

        I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: copying file usnig Net::SCP module
by Anonymous Monk on Sep 19, 2006 at 07:03 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://573636]
Approved by mugwumpjism
help
Chatterbox?
[marto]: yep :)
[Discipulus]: being her marto, can you explain what "Par for the course I'm afraid." means?
Discipulus here..
[marto]: "what is normal or expected in any given circumstances."
[marto]: better: "If a type of behaviour, event, or situation is par for the course, it is not good but it is normal or as you would expect"
[Discipulus]: thanks i was unable to decide where to split the sentece
[marto]: FWIW search.cpan rarely has issues, see http://noc.perl. org for a route to report problems
[oakbox]: thanks, marto.
[marto]: there was a period where search.cpan had some frequent outages for (IIRC) a couple of weeks. I've not had any problems since, until today.
[marto]: this was about 16 months ago maybe. the noc team are, in my experience, very responsive to reports of issues, so please raise the issue after checking known problems/outages

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-07-26 10:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (388 votes). Check out past polls.