Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: How to write the perl script for the following linux command?

by finddata (Sexton)
on Mar 14, 2017 at 08:42 UTC ( #1184540=note: print w/replies, xml ) Need Help??


in reply to Re^5: How to write the perl script for the following linux command?
in thread How to write the perl script for the following linux command?

the error ocurrs at this line if($_ =~ /.csv/){
  • Comment on Re^6: How to write the perl script for the following linux command?

Replies are listed 'Best First'.
Re^7: How to write the perl script for the following linux command?
by Corion (Pope) on Mar 14, 2017 at 08:56 UTC

    Please post a self-contained, small example that reproduces the behaviour you see.

    Using the below code, I cannot reproduce your problem:

    #!perl -w use strict; my $sorce_direcrtory = '.'; my $new_directory = './target/'; opendir(my $dh, $sorce_direcrtory) || die $!; while(readdir $dh) { print "Found directory entry [$_]\n"; if($_ =~ /.csv/){ print qq{copy("$sorce_direcrtory/$_", "$new_directory/$_")\n}; } } closedir $dh;
      How it is possible to $_ wihtout using my

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2020-01-26 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?