in reply to Re: Auto linking to words in a text file
in thread Auto linking to words in a text file

my $data; { local $/; #sets input list separator to undef #so we can 'slurp' the file in $data = <TEXTFILE>; } close TEXTFILE;

Why didn't I think of that :)

These are the sort of things I love about such forums as Perl Monks.

--

Brother Marvell

Replies are listed 'Best First'.
Re: Re: Re: Auto linking to words in a text file
by btrott (Parson) on Dec 01, 2000 at 23:31 UTC
    If you like that then you'll probably like to know that it can be done w/ even less keystrokes:
    my $data = do { local $/; <TEXTFILE> };
    No, this isn't golf, but all the same it's a nice construct to know.
      Or even:
      { local $/=<TEXTFILE>; ## Do stuff with $/ directly }