develooper Front page | perl.perl5.porters | Postings from March 2003

Re: Core modules w/o "1;" [Was: Re: Pod::Man has no "1;"...]

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
March 30, 2003 14:41
Subject:
Re: Core modules w/o "1;" [Was: Re: Pod::Man has no "1;"...]
Message ID:
20030331004354.385048cb.rgarciasuarez@free.fr
Michael G Schwern wrote:
> On Mon, Mar 31, 2003 at 12:28:28AM +0200, Rafael Garcia-Suarez wrote:
> > 142 is the number of elements in %ESCAPES, last var to be defined
> > in Pod::Man.
> > 
> > As Dan said, this is a context problem :
> > (not sure how to turn this into a good regression test, though)
> 
> The below looks more like 5.8.0 is doing the right thing.  wantarray()
> should be undef.

Don't confuse me while I'm writing the summaries ;-)
looks like wantarray should always be "" (scalar context).

> So your test is easy.  Write a small dummy module which has nothing in it
> but a hash.  require it in an eval, see if $@ is set.

No, turn the thingy below in a test, with numbered and commented "ok"'s,
and without pain : (I'll look at it another day)

> > $ cat foo.pm
> > package foo;
> > print "wantarray:",defined wantarray ? wantarray : 'undef';
> > print "\n";
> > 1;
> > $ cat foo.t
> > $foo = eval q{require foo}; delete $INC{"foo.pm"};
> > @foo = eval q{require foo}; delete $INC{"foo.pm"};
> >        eval q{require foo}; delete $INC{"foo.pm"};
> > $foo = eval {require foo}; delete $INC{"foo.pm"};
> > @foo = eval {require foo}; delete $INC{"foo.pm"};
> >        eval {require foo}; delete $INC{"foo.pm"};
> > $ perl5.6.0 foo.t
> > wantarray:
> > wantarray:
> > wantarray:
> > wantarray:
> > wantarray:
> > wantarray:
> > $ perl5.8.0 foo.t 
> > wantarray:
> > wantarray:
> > wantarray:undef
> > wantarray:
> > wantarray:
> > wantarray:
-- 
Unconvinced is not *NIX

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About