From the lines and expected outputs you have shown it looks like you want a character range from within a string. You can use substr for this. Note that Perl uses zero-based offsets into strings.
$ perl -E ' > $line = q{abcdefghijklmno}; > say $line; > say substr $line, 0, 3; > say substr $line, 5, 6; > say substr $line, 13;' abcdefghijklmno abc fghijk no $
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: print and extract the line
by johngg
in thread print and extract the line
by vis1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |