in reply to Split function

Without the benefit of your code, I can't really tell you where you went wrong.
use strict; my $file; { local $/; $file = <>; } $file =~ s!$/!!g; my @elements = split /\|/, $file;
above code is untested

Update
By the way, there is more info about split in the library. I just noticed this was your first post, and that no one pointed you there, so I thought I would mention it as a reference.