CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate: Re: [mkeith123] loop: Edit Log


Mar 28, 2008, 10:19 PM

Views: 23921
Re: [mkeith123] loop

You are only using the name of the file you want to read ($current_file):

open ($IN, $current_file) or die "$!";

so that file would have to be in the same directory as the script or you have to change directory to the directory where to $current_file resides or use the full path to the file:

open ($IN, "path/to/$current_file") or die "$!";

Also, in your first post in this thread, the filename has an underscore in it but in the code you posted there is no underscore in the filename. So remove the underscore in this line if it should not be there:

my $current_file = sprintf "mv_%07d.txt", $file;

(This post was edited by KevinR on Mar 28, 2008, 10:22 PM)

Edit Log:
Post edited by KevinR (Veteran) on Mar 28, 2008, 10:22 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives