in reply to Re^3: Reading a CSV file
in thread Reading a CSV file

I think i gave Perl a path to find the file but there is still no output. To be sure I did the right thing here's what I changed:
open(my $fh, '<', 'C:\bio stuff\Aubrey\'s project\dev.csv') or die "Un +able to open 'dev.csv' for read
Is that what you meant?

Replies are listed 'Best First'.
Re^5: Reading a CSV file
by Limbic~Region (Chancellor) on Mar 31, 2008 at 14:58 UTC
    alchang,
    Yes, that is an absolute path. I apologize if the following sounds a bit hand-holdy, but it is difficult to troubleshoot without seeing what you see:
    C:\>cd "bio stuff\Aubrey's project" C:\bio stuff\Aubrey's project>more dev.csv hit q once you are satisfied that the file is not empty C:\bio stuff\Aubrey's project>notepad testit.pl Copy and paste my code exactly into testit.pl - without absolute path C:\bio stuff\Aubrey's project>perl testit.pl
    If that produces no output and all the steps leading up to it appear to be successful, I give up.

    Cheers - L~R

      Hmm, when I use the more command nothing comes out at all and pressing q doesn't quit, I have to use ctrl-c. When I use notepad to view dev.csv it definitely has lines of data though.
Re^5: Reading a CSV file
by radiantmatrix (Parson) on Mar 31, 2008 at 16:28 UTC

    The backslash is an escape character! If you want to use a windows-style path, you need to escape the backslashes:

    open(my $fh, '<', 'C:\\bio stuff\\Aubrey\'s project\\dev.csv')
    <radiant.matrix>
    Ramblings and references
    The Code that can be seen is not the true Code
    I haven't found a problem yet that can't be solved by a well-placed trebuchet