in reply to Please tell

As posted, this is incomprehensible (to me, anyway).

So I made an effort to determine how to format your data (begining with "direct is-->") but couldn't come up with anything satisfactorily consistent and providing context to understand your problem.

In other words, I'm still not sure what you're trying to show us.

So please, reformat your post using Markup in the Monastery to make it readable.

And perhaps you can clarify the underlying issue, as well. And you may wish to heed the advice at point 1. of On asking for help.

Replies are listed 'Best First'.
Re^2: Please tell
by Anonymous Monk on Aug 17, 2011 at 11:51 UTC
    To me looks like "direct" has "ory" omitted, and "filename1" is a variable which is being modified 4 times instead of using four different variables. OP, then, seems to be asking about how to obtain base file name prefix (from a absolute path component) to generate four different file names from a list of four suffixes.
      Plausible.

      You certainly made better progress than I!

      Maybe (do we think?)... maybe OP should read the PerlMonks FAQ and include code?

        Maybe (do we think?)... maybe OP should read the PerlMonks FAQ and include code?

        For the love of sanity, certainly.

        Or, perhaps OP should just visit http://jobs.perl.org/.

      On second thought, never mind my interpretation for the OP does know about fileparse().

        Hi Monks,

        I have one file which contains a header and rest details. Now I have to read the file header. There are around 30 fields in the header and each separated by "|".

        There will be a fixed pattern in the header "LASTUPDATE" , I need to find out the position of this in the header.

        Now after taking the position of this fixed pattern , I need to read the subsequent second line from the file and take out the date field which will be in the same position.

        My question is that

        in file reading if I am reading the file from the very first line can I refer the first line as line[0] and then the second line as line1

        I will read the first line and assign it to an array and then I will match the pattern and take the position of that element.

        Then I will read the second line as line1 and then again assign it to a new array and then read the position as got from first line.

        Kindly advice