Larry Wall ha scritto:
but the autocall into MAIN is not yet implemented. You can emulate by
putting something like this as the last line in your file:
MAIN(@ARGS), exit if $?FILE eq $*PROGRAM_NAME;
or maybe
MAIN(@ARGS), exit unless caller;
if/when that works as in Perl 5. When the
Larry Wall ha scritto:
On Fri, Jan 05, 2007 at 01:40:44PM +0200, Gaal Yahas wrote:
: > I think it should be possible and nice to use a macro (possibly a
: > standard subroutine, I'm not sure) like
: >
: > testing {
: > ok foo;
: > }
: >
: > would it make sense or I'm just crazy?
:
: I like
On Fri, Jan 05, 2007 at 01:40:44PM +0200, Gaal Yahas wrote:
: > I think it should be possible and nice to use a macro (possibly a
: > standard subroutine, I'm not sure) like
: >
: > testing {
: > ok foo;
: > }
: >
: > would it make sense or I'm just crazy?
:
: I like the approach.
I think you
gabriele renzi skribis 2007-01-05 4:14 (+0100):
> I think it should be possible and nice to use a macro (possibly a
> standard subroutine, I'm not sure) like
> testing {
> ok foo;
> }
> would it make sense or I'm just crazy?
Possible, presumably easy to implement, and a great idea.
I love it!
On Fri, Jan 05, 2007 at 04:14:27AM +0100, gabriele renzi wrote:
> supposing that I want to keep code and tests in one single file, is
> there a common idiom to do that?
Nice idea!
> At the moment I'm going with something like:
>
> if $?FILE == $*PROGRAM_NAME {
> use Test;
> plan 1;
> ok
Hi everyone,
supposing that I want to keep code and tests in one single file, is
there a common idiom to do that?
At the moment I'm going with something like:
if $?FILE == $*PROGRAM_NAME {
use Test;
plan 1;
ok foo();
}
but this seem unnecessarily verbose.
Is there some standard idio