in reply to find the string in the file and print its subsequent strings

Hello saro and welcome to the monastery and to the wonderful world of Perl!

to make a program you must have a plain solution to then translate it into a program. Let's see:

open a file named DATA.TXT read all lines of this file if the string 'NINE' is found save the whole string for later use -or (not clear in your question)- if the string 'NINE' is found split this string into 8 parts close the file print the result

useful reads:

Try some code on your own and post your code and questions here.

Dont forget to start your program with:

use strict; use warnings;

You can also add use diagnostics; after the above lines to get more help from Perl itself

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: find the string in the file and print its subsequent strings
by saro (Initiate) on Apr 23, 2020 at 17:39 UTC

    Thanks for this inputs. I will try my own code and learn from there