in reply to How can i take a file loaded into an array and split it up into different...

my @array; { local $/ = ':'; open INPUT, 'file.txt' or die "blah: $!"; @array = <INPUT>; close INPUT; }

--
AltBlue.

  • Comment on Re: How can i take a file loaded into an array and split it up into different...
  • Download Code

Replies are listed 'Best First'.
Re: Re: How can i take a file loaded into an array and split it up into different...
by bbfu (Curate) on Jan 27, 2001 at 06:57 UTC

    Assuming that the file is also broken w/ newlines (which may very well not be the case) (ie, similar to a CSV), wouldn't just setting $/ mean that at every newline, one of the array elements would contain two fields (specifically, the last one of one line combined w/ the first one of the new line)?

    Blah, I'm probably just making invalid assumptions and should go back to work. :-p

    bbfu