in reply to Re: Class::Struct problem
in thread Class::Struct problem

It would work, but I form the viewpoint of code organization, I would strongly prefer having the struct stuff near the end of my file instead of at the beginning.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Class::Struct problem
by FunkyMonk (Bishop) on Jun 08, 2010 at 12:56 UTC
    Just put your class inside a BEGIN block and put it wherever you want.

      Actually, I'm using now an INIT block, but the effect is the same in this case.

      -- 
      Ronald Fischer <ynnor@mm.st>

        BEGIN has less issues than INIT, and it parallels use.

        In fact, if you want to completely mimic use, you can do the following:

        BEGIN { package Foo::Bar; use Class::Struct; struct('field' => '$'); $INC{'Foo/Bar.pm} = 1; }

        Then you can do use Foo::Bar qw( ...imports... ); at a later point.