<?xml version="1.0" encoding="windows-1252"?>
<node id="996472" title="This looks like whitespace in my CSV but doesn't seem to be" created="2012-09-30 03:59:01" updated="2012-09-30 03:59:01">
<type id="115">
perlquestion</type>
<author id="386673">
ghenry</author>
<data>
<field name="doctext">
&lt;p&gt;Dear all,&lt;/p&gt;
&lt;p&gt;I have the following in CSV:&lt;/p&gt;
&lt;code&gt;
"My Company","Gavin","Henry ","ghenry@ghenry.co.uk"," 1.00"&lt;/code&gt;
&lt;p&gt;I have:&lt;/p&gt;
&lt;code&gt;
    my $csv = Text::CSV_XS-&gt;new( { binary =&gt; 1, eol =&gt; $/ } );
    open my $io, '&lt;', $file or die "$file: $!";

    while ( my $row = $csv-&gt;getline($io) ) {
        my @fields = @$row;

        next unless $fields[4];
        $fields[4] =~ s/\s+//g;
        print $fields[4], "\n";
    }
&lt;/code&gt;
&lt;p&gt;This looks like whitespace but is never removed. What am I missing? This is soo basic it's driving me mental!&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-386673"&gt;
&lt;small&gt;Walking the road to enlightenment... I found a penguin and a camel on the way.....&lt;/small&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
