in reply to Open() : Not reading all lines in my text file

Sorry I messed up with formatting earlier on. I'm re-posting my query again

Here's my text file below:

anusha ramegowda

<perl programming1234>

"23rd June 2016"

#Thursday, 11:05am#

<perl programming5678> problem encountered

I'm trying to read the contents of the text file(titlefile) using

 open (my $fp, "<", $titlefile) or die "Can't open <$titlefile: $!";

It reads all contents except the ones within <chevrons> for e.g. I don't read <perl programming1234> and <perl programming5678>.

I want to read the string within chevrons to able to distinguish between various values. Can anybody please help?

Replies are listed 'Best First'.
Re^2: Open() : Not reading all lines in my text file
by Corion (Patriarch) on Jun 23, 2016 at 10:39 UTC

    Your code only shows the opening of the file, but not how you actually read from the file and also not how you output the content. Please post the relevant code, preferrably within <code>...</code> tags, so that we can try to replicate your situation.

    If you are outputting data that is to be interpreted as HTML, note that you will need to escape the chevrons. See for example HTML::Entities on how to properly escape ><& (and some more).