Scribble: Yet Another Attempt To Make Perl ...

Yet another bright idea (I think) to make Perl look and act like something else ....

# so basically this would load classes on-the-fly using Module::Runtime (or the like) if not already loaded, and provide simple and cute access to class methods, etc. Obviously there are times (most-times) when you'd rather know about a problem at compile-time versus run-time but my brain dumps could care less about those types of particulars.

package App::Controller::Root;

use Class::Path class => 'App';

my $obj;

$obj = class '/database'; # App::Database->new

$obj = class '/database.connect'; # App::Database->connect

$obj = class '/database.connect' => [...]; # App::Database->connect(...)

$obj = class './admin'; # App::Controller::Admin->new

$obj = class 'admin'; # App::Controller::Root::Admin->new

$obj = class 'adminDB'; # App::AdminDB->new

$obj = class 'admin-db'; # App::AdminDb->new


1 Comment

Not especially difficult to do, but Class::Path is probably a poor choice of name given that there's already a very popular Path::Class module.

Leave a comment

About awnstudio

user-pic Al Newkirk is a web application developer from Philadelphia, PA in the United States who specializes in Perl development with MySQL on a Windows platform using Strawberry Perl. I do a bunch of other stuff too, stick around and find out what!