D2K2
11-12-2002, 09:57 PM
Hi, how do i use a CSV file? ATM i'm only getting the last value from the lot...
File:
thing1,0,thing2,1
CGI (Only the Split bit, the rest SHOULD work...):
open (LINKS, "nonactive/pages/$sela/$selb/$selc.d2k2page") || die "Failed to open nonactive/pages/$sela/$selb/$selc.d2k2page - $!\n";
my @page = <LINKS>;
close (LINKS);
my @pag;
if ($selc eq "index"){
@pag = split (/,/, @page);
}
Output:
1
Thanks in advance for any help :)
File:
thing1,0,thing2,1
CGI (Only the Split bit, the rest SHOULD work...):
open (LINKS, "nonactive/pages/$sela/$selb/$selc.d2k2page") || die "Failed to open nonactive/pages/$sela/$selb/$selc.d2k2page - $!\n";
my @page = <LINKS>;
close (LINKS);
my @pag;
if ($selc eq "index"){
@pag = split (/,/, @page);
}
Output:
1
Thanks in advance for any help :)