http://www.perlmonks.org?node_id=991397


in reply to I'm trying to get a numeric array

You need to replace:
my @chwhs = (<STDIN>);
with:
my $chwhs = <STDIN>; chomp $chwhs; my @chwhs = split /\s+/, $chwhs;
Same thing for the @cogs. You're reading a line from standard input and you need to tell perl that this line contain several space separated values.

Replies are listed 'Best First'.
Re^2: I'm trying to get a numeric array
by fatmac (Acolyte) on Sep 03, 2012 at 12:21 UTC
    Thankyou very much Gangabass for your reply, I shall put your code into my program, & go try with that.
      Your solution worked perfectly, thankyou.