On 9/16/11 Fri  Sep 16, 2011  11:27 AM, "Brandon McCaig"
<bamcc...@gmail.com> scribbled:

> On Fri, Sep 16, 2011 at 11:32 AM, Brandon McCaig <bamcc...@gmail.com> wrote:
>>    my @column_headers = map { $_ = trim($_); $_; }
>>            split /\|/, $header_line;
> 
> Sorry, that should be:
> 
>   my @column_headers = map trim($_), split /\|/, $header_line;

You can also exclude the whitespace surrounding the pipe symbols by
modifying the delimiter pattern for split:

  my $column_headers = split( /\s*\|\s*/, $header_line);

But that will not trim the whitespace at the beginning of the first column
or at the end of the last column.



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to