Hi I have text file in which I have the below mentioned lines This is a test start-first First Line testing end-first How are you Finally start-second Tested end-second
I have a perl file which reads the above file and stores in the variable say $message #!/usr/bin/perl use strict; open INPUT,"fp.txt" || die "File does not exist"; my $message=""; while(<INPUT>) { $message=$message.$_; } if ($message =~ (/start_first/../end_first/)) { print "The line is $1"; } What I expect is that from the variable, $message I wanted to print out this "First Line testing" as in the text file i have specified the pointers.. In Short I wanted to print the lines in between two words in a file/variable. Is my method correct? Thanks Anish