Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Copy rows of file to new document

by phineas629 (Novice)
on Jan 25, 2013 at 21:32 UTC ( #1015409=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Copy rows of file to new document
in thread Copy rows of file to new document

I've given this a couple attempts.I'm really trying to read over the notes but am just plain lost. This is the error I got with the code:

"my" variable $dir_path masks earlier declaration in same statement at parse.pl line 5. syntax error at parse.pl line 5, near "opendir" Can't use global $! in "my" at parse.pl line 5, near "die $!" syntax error at parse.pl line 7, near ") {" Global symbol "$file_content" requires explicit package name at parse.pl line 8. Execution of parse.pl aborted due to compilation errors.

#!/usr/bin/perl use strict; use warnings; my $dir_path="c:/incoming/temp;" opendir my $DIR, $dir_path or die $!; open my $OUT, '>>', 'c:/vehicles.txt' or die $!; while (my $file_name = readdir($DIR) {print "$file_name\n";} print MYFILE $file_content; close (MYFILE)


Comment on Re^4: Copy rows of file to new document
Download Code
Re^5: Copy rows of file to new document
by choroba (Canon) on Jan 25, 2013 at 21:49 UTC
    On line 4, exchange the double quote and the semicolon. Then, reread my comments.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2015-07-02 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls