in reply to Re: Re: Re: Re: Re: Re: opening a file in a subroutine
in thread opening a file in a subroutine
$/ is the end of record seperator. It defaults to "\n".
What my code, which is in essence
does is to read the whole file into a buffer then split it up by newlines and then return them, which should be more or less the same asmy @list=split /\n/,do {local $/; <$fh>};
(at least under default conditions) but obviously isn't on AS 5.6.my @list=<$fh>;
I hope you didnt do it naively as otherwise youll only have one entry in the array, which will contain the whole file.
--- demerphq
my friends call me, usually because I'm late....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Re: Re: opening a file in a subroutine
by abhishes (Friar) on Feb 09, 2003 at 17:38 UTC |