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

Re^4: Export CSV v2

by Perl3r (Initiate)
on Oct 09, 2012 at 00:41 UTC ( #997904=note: print w/replies, xml ) Need Help??


in reply to Re^3: Export CSV v2
in thread Export CSV v2

Ok I have the script as follows:

my $csv = Text::CSV->new( { binary => 1, auto_diag => 2, } ) or die "Cannot use CSV: " . Text::CSV->error_diag(); $csv->eol ("\x0d\x0a"); for my $csvFile (@ARGV) { print "\nProcesing file $csvFile ...\n"; open my $csvfh, '<', $csvFile or die "Unable to open $csvFile: $!" +;

When I run the script, i still get the following error:

Can't use an undefined value as an ARRAY reference at test.pl line 23, <$csvfh> line 1.

This happens whether the CSV is in MS Excel format, or TXT

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997904]
help
Chatterbox?
[stevieb]: been thinking... if it wasn't for Perl, I believe that I'd be done in tech. I don't do social media or the like, if I'm not coding I'm not on a device at all, and don't miss comms at all when I'm not around. I code for my job (which I like), but I think..
[stevieb]: ...I haven't coughed up my laptop because of Perl.
[stevieb]: I think that Perl is the reason that I haven't gone 100% off grid :)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2017-03-29 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (343 votes). Check out past polls.