in reply to Re: Re: Anon. array of refs to a range generated list of scalars.
in thread Anon. array of refs to a range generated list of scalars.

Actually, the error message from print do( 'fred' ); confuses me completly.
What error message? You are aware of the different variants of do? From perldoc -f do
do BLOCK [...] do SUBROUTINE(LIST) [...] do EXPR Uses the value of EXPR as a filename and executes the contents of the file as a Perl script.
so probably the file named 'fred' doesn't exist and do returns simply undef - at least that's what it does here (on perl 5.6.0) generating thus a warning about Use of uninitialized value in print ...

-- Hofmator

Replies are listed 'Best First'.
Re: Re3: Anon. array of refs to a range generated list of scalars.
by BrowserUk (Patriarch) on Jan 18, 2003 at 20:21 UTC

    Your right of course, I didn't think about the do EXPR; form at all.

    If I do print do('fred')|| warn $!;

    I get No such file or directory at ...


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.