in reply to Re: Reading in Text File and skipping lines
in thread Reading in Text File and skipping lines

If you just want to slurp a file into a scalar then this is a pretty simple way to do it, no need to worry about do's, while loops undefs etc.
my $outputpage = join('',<TEMPLATE>) ;

Dingus


Enter any 47-digit prime number to continue.

Replies are listed 'Best First'.
Re: Re: Re: Reading in Text File and skipping lines
by BrowserUk (Patriarch) on Nov 08, 2002 at 09:58 UTC

    True. But you do have to worry about opening the file, checking the return code, outputing a sensible error message if it fails.

    The nice thing about juerd's slurp idiom (as shown in wonko the sane's post above) is that it takes care of that for you.


    Nah! You're thinking of Simon Templar, originally played (on UKTV) by Roger Moore and later by Ian Ogilvy