Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Can't copy file

by marinersk (Priest)
on Mar 30, 2015 at 21:10 UTC ( #1121904=note: print w/replies, xml ) Need Help??


in reply to Can't copy file

novice2015 has asked for the wisdom of the Perl Monks concerning the following question:

     I am a total beginner

Excellent -- and welcome to the Monastary. Please add the following to your script; I strongly urge you to never remove them:

     #!/usr/bin/perl
     use strict;
     use warnings;
     my $server = `uname -n`;
     print $server;
     chomp $server;
     # Display all the files in /tmp directory.
     
my $dir = "/usr/ent/newdir/db/sign/*";
     my @files = </usr/ent/newdir/db/sign/*files*>;
     open(my $outfh, '>', '/tmp/output1.txt') or die "cannot open file";
     foreach
my $LINE (@files ){
         print $outfh $LINE;
         close FH;
     }
     use File::Copy;
     {
         
my $oldlocation = "/tmp/output1.txt";
         
my $newlocation = "/tmp/output3.txt";
         copy($oldlocation, $newlocation);
     }
     exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1121904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2022-01-20 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?