in reply to Re: How can one create an array of the indices at which a given character appears in a string?
in thread How can one create an array of the indices at which a given character appears in a string?
Exactly, how does this work? The following code prints 2 2 and not 1 6.
use warnings; use strict; my $input = 'rnbqkbnr'; $input =~ /(n)/g; print "@+\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How can one create an array of the indices at which a given character appears in a string? (updated)
by LanX (Saint) on Jan 29, 2015 at 14:36 UTC | |
by Not_a_Number (Prior) on Jan 29, 2015 at 14:42 UTC | |
by LanX (Saint) on Jan 29, 2015 at 14:50 UTC | |
by DanBev (Scribe) on Jan 29, 2015 at 14:54 UTC |