<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thanks benh,<div><br></div><div>I think that's what I may have to do,</div><div>since I can't seem to find an easier way.</div><div><br></div><div>Fred </div><div><br>> Date: Thu, 10 Jun 2010 12:01:33 -0700<br>> Subject: Re: [Pdx-pm] Converting a monolithic program to mvc<br>> From: ben.hengst@gmail.com<br>> <br>> As Jeff and I found out last night you can create 'globals' (see<br>> below), it's not the cleanest thing that I've ever done but it works.<br>> <br>> package one;<br>> use two;<br>> <br>> $main::globalvar = { hello => 'Phred' };<br>> <br>> my $two = two->new;<br>> <br>> package two;<br>> print 'Hello ', $main::globalvar->{hello};<br>> <br>> 2010/6/10 Phred Bob <phredbob@hotmail.com>:<br>> > Hi All,<br>> ><br>> > I am trying to take a monolithic perl program (approx. 97k lines long) and<br>> > separate concerns (kind of an MVC-style division). I used AutoSplit to break<br>> > out the subroutines, but now I'm stuck. I tried separating the *.al<br>> > subroutines into a View directory if they contained a print statement and<br>> > into a Model directory if they didn't. The main part of the program (before<br>> > __END__) is about 4.6k lines that I am tentatively making the Controller.<br>> ><br>> > So -- the autoload works as long as the the files are left in the state in<br>> > which were originally generated (a bunch of .al files all in one directory).<br>> > That still leaves me with about 191 separate files with no classification on<br>> > them, so I'd like to organize them in further subdirectories to correspond<br>> > with my separation of them into models, views, and a controller.<br>> ><br>> > The problem is, if I move them, my autoload function no longer works. And if<br>> > I do put them in a subdirectory and load them as modules, they use their own<br>> > namespace and ignore all the lovely global variables the original developer<br>> > put in his vast, monolithic script.<br>> ><br>> ><br>> > Does anyone have any ideas on how to proceed?<br>> ><br>> > Thanks,<br>> > Fred Lowe<br>> > phredbob@hotmail.com<br>> > ________________________________<br>> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with<br>> > Hotmail. Get busy.<br>> > _______________________________________________<br>> > Pdx-pm-list mailing list<br>> > Pdx-pm-list@pm.org<br>> > http://mail.pm.org/mailman/listinfo/pdx-pm-list<br>> ><br>> -- <br>> benh~<br>> <br>> http://three.sentenc.es/<br></div>                                            <br /><hr />The New Busy is not the old busy. Search, chat and e-mail from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3' target='_new'>Get started.</a></body>
</html>