in reply to Removing Newline Characters from File Data (chomp not working)
open(plate_file,'<',$filename.".csv") or die "Can't open: $!";
See open,perlopentut for some more details.
#!/usr/bin/perl use strict; use warnings; my @data; while(<DATA>) { my @row = split /,/,(/(.*)\n?/)[0]; # <-- nice and clear, right? shift(@row); push(@data,@row); } print join "\n", @data; __DATA__ 1,2,3,4 2,3,4,5 3,4,5,6
I could go on, but that should give you plenty to chew on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removing Newline Characters from File Data (chomp not working)
by mlux (Initiate) on Aug 27, 2009 at 16:56 UTC | |
by kennethk (Abbot) on Aug 27, 2009 at 17:13 UTC | |
by mlux (Initiate) on Aug 27, 2009 at 17:20 UTC |