dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my %tests; BEGIN { %tests = ( # Stuff here ); } use Test::More tests => (keys(%tests) * 5 + 1); use_ok( Some::Class ); # Tests here
Is there a way to avoid having to declare %tests and then assign to %tests on another line?
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: BEGIN, strict, and variable assignment
by blokhead (Monsignor) on Mar 03, 2004 at 14:04 UTC | |
|
Re: BEGIN, strict, and variable assignment
by TimToady (Parson) on Mar 03, 2004 at 16:44 UTC | |
|
Re: BEGIN, strict, and variable assignment
by broquaint (Abbot) on Mar 03, 2004 at 13:53 UTC | |
by tye (Sage) on Mar 03, 2004 at 17:49 UTC | |
by broquaint (Abbot) on Mar 03, 2004 at 18:01 UTC | |
|
Re: BEGIN, strict, and variable assignment
by Anonymous Monk on Mar 03, 2004 at 16:04 UTC |