I'm trying to parse a file in perl. I want to print all lines after the regex match
For example, the file is
num_of_dogs,10,#start_reading
num_of_cat,15
num_birds,20
num_of_butterfly,80
.....
I want all the lines after the match #start_reading
I've tried this, but it just prints next line
while (my $line = <$csv_file>) {
next unless $line =~ /(.*),#end_of_tc/;
if ($line =~ /(.*)/){
print $file = $1;
}
}
The output would look like this
num_of_cats,15
num_of_birds,20
......
Thanks in advance