Can't call method "getline" on an undefined value at cpucsv.pl line 10.


>>> Simon Oliver <[EMAIL PROTECTED]> 11/21/01 07:12AM >>>
Mike Singleton wrote:
> 
> Anyone have a clue how to accomplish this?? I have a CSV file (from perfmon output) 
>and I need to create an array from that file to feed into JPGraph for graph 
>generation.... I have looked all over and the answer I keep getting is fget for PHP. 
>Can Perl do this in a simpler manner? I could us a snippet of code as well to help me 
>work this... thnx


See Text-CSV_XS - code examples are included.

I don't know what input JPGraph takes but to create an two dimensional
array of rows and columns you could try something like this (untested):

use IO::File;
use Text::CSV_XS;

$fh = new IO::File "< file";

$csv = Text::CSV_XS->new();

my @rows;

while (my $columns = $csv->getline($fh)) {
        push @rows, $columns;
}

--
  Simon Oliver
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED] 
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

DaVita Inc.

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


Reply via email to