On Fri, Apr 06, 2001 at 07:57:28PM +0100, Simon Cozens wrote:
> On Fri, Apr 06, 2001 at 07:55:26PM +0100, Graham Barr wrote:
> > Ah OK. So I assume that 
> >   do "you";
> > will do the file in a void context
> 
> Theoretically, yes. (ie, probably not.)

>From bleadperl t/op/do.t:

if (open(DO, ">$$.16")) {
    print DO "print qq{ok 16\n} if defined wantarray && not wantarray\n";
    close DO;
}

my $a = do "$$.16";

if (open(DO, ">$$.17")) {
    print DO "print qq{ok 17\n} if defined wantarray &&     wantarray\n";
    close DO;
}

my @a = do "$$.17";

if (open(DO, ">$$.18")) {
    print DO "print qq{ok 18\n} if not defined wantarray\n";
    close DO;
}

do "$$.18";

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to