Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: I'm trying to get a numeric array

by Gangabass (Vicar)
on Sep 03, 2012 at 11:22 UTC ( #991397=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: I'm trying to get a numeric array
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991397]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-06 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (82 votes), past polls