in reply to Re^2: Finding the sum of individual columns
in thread Finding the sum of individual columns

split returns a list. Adding a list to a scalar does not really make sense in this context. Maybe you want a loop?

my @items = qw(1 2 3 4 5 6); my $val = 10; $val += $_ for @items;

Replies are listed 'Best First'.
Re^4: Finding the sum of individual columns
by jwkrahn (Abbot) on Apr 13, 2010 at 15:14 UTC
    split returns a list.

    In list context but in scalar context it returns the number of fields in the list and puts the list into @_ and issues a warning.

Re^4: Finding the sum of individual columns
by thillai_selvan (Initiate) on Apr 13, 2010 at 09:22 UTC
    Yeah. It works great. Thanks!!!