• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1505
  • Last Modified:

Argument .. isn't numeric in array slice

I'm not sure I understand this error in the context of my code

    map {
        my $mySTR = "sample";
        $myArr[$_][0] = $mySTR;                             
    } 0..$#myArr

Argument "sample" isn't numeric in array slice

error is shown for line
my $mySTR = "sample";
0
NewtonianB
Asked:
NewtonianB
  • 2
1 Solution
 
ozoCommented:
What is in @myArr and what are you trying to do?
Did you mean something like
do {
        my $mySTR = "sample";
        $myArr[$_][0] = $mySTR;                            
    } for 0..$#myArr
0
 
NewtonianBAuthor Commented:
well that solved it thanks!
After trying your method I realized its what I was wrapping around the map was causing the disturbance.
0
 
NewtonianBAuthor Commented:
cheers!!!
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now