in reply to Super newbie array question
Just push the anonymous arrays onto your array without quoting them. Otherwise you have an array of strings.
Note that if you used strict (you should always use strict), Perl would have told you what the problem was: Can't use string ("[172,178]") as an ARRAY ref while "strict refs" in use.my @ranges = (); push @ranges, [172,178]; push @ranges, [183,189]; push @ranges, [201,208];
Hope this helps!
update: clarified terminology
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Super newbie array question
by Anonymous Monk on May 22, 2023 at 22:08 UTC | |
by Anonymous Monk on May 22, 2023 at 22:10 UTC |