in reply to print number of characters after specific character

Your expectation does not meet the specification, unless you are using the heptadecimal notation.

You can use index to find a substring in a string. Its third argument tells Perl where to start searching.

#!/usr/bin/perl use warnings; use strict; my $input = "471234973798375754773971832374974447889743725345932"; my $pos = 0; while (-1 != ($pos = index $input, '47', $pos)) { print substr($input, $pos++, 10), "\n"; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: print number of characters after specific character
by amparida (Initiate) on Sep 12, 2013 at 23:18 UTC
    thanks it is working fine.