Text-CSV-Simple - Having Problem with Text-CSV-Simple

Posted on Tue Nov 28 11:17:46 2006 by mizan76
Having Problem with Text-CSV-Simple
Hi, My name is Samn. I'm a newbie in Perl Programming. Currently I'm working with a lot of raw data tha +t must be reformatted. So try to use this module to read the CSV File Format. When I compiled the +script the error below occured. Error ===== C:\Perl\eg>perl -w test7.pl Name "main::datafile" used only once: possible typo at test7.pl line 3. Use of uninitialized value in sysopen at c:/Perl/site/lib/File/Slurp.pm line 136 . Use of uninitialized value in concatenation (.) or string at c:/Perl/site/lib/Fi le/Slurp.pm line 137. read_file '' - sysopen: No such file or directory at c:/Perl/site/lib/Text/CSV/S imple.pm line 153 The script that I run is as below (Test7.pl). SCRIPT ======= use Text::CSV::Simple; my $parser = Text::CSV::Simple->new; my @data = $parser->read_file($datafile); print @$_ foreach @data; # Only want certain fields? # my $parser = Text::CSV::Simple->new; # $parser->want_fields(1, 2, 4, 8); # my @data = $parser->read_file($datafile); For your info that I'm currently running ActivePerl Version 5.8 for Windows. Tq. samn mizan_76@yahoo.com
Direct Responses: 5299 | Write a response