in reply to Re: split a delimited file
in thread split a delimited file

Your second assumption is correct. I just looked up local, but I am not familiar with "$/". What does it do/mean? and where do I use it, within a {while (<open>)} statement, before/after the open (FILE, '$file') line? or do you mean to put my ($item1, $item2, $item3) in place of the "$/" ? Thaks for your help

Replies are listed 'Best First'.
Re: Re: Re: split a delimited file
by jweed (Chaplain) on Feb 08, 2004 at 04:45 UTC
    Start your program with
    local $/ = "\t::\t";
    Then, when you use <FH>, it won't give you the next line but the next record, that us, up to the next occurance of "/t::/t". Then, within your while loop, your $_ is now something like (if "\n::\n" is the field separator)
    uname :: categ :: title :: locat :: $desc etc.
    Then, just split that bad boy into individual fields like you do in your second code sample and you'll be set.

    HTH.



    Code is (almost) always untested.
    http://www.justicepoetic.net/
Re: Re: Re: split a delimited file
by ysth (Canon) on Feb 09, 2004 at 04:06 UTC
    You can read about $/ and its effect on the readline (aka <>) operator in perldoc perlvar.