<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&nbsp;</div><div><br>&gt; Date: Thu, 10 Jun 2010 12:01:33 -0700<br>&gt; Subject: Re: [Pdx-pm] Converting a monolithic program to mvc<br>&gt; From: ben.hengst@gmail.com<br>&gt; <br>&gt; As Jeff and I found out last night you can create 'globals' (see<br>&gt; below), it's not the cleanest thing that I've ever done but it works.<br>&gt; <br>&gt; package one;<br>&gt; use two;<br>&gt; <br>&gt; $main::globalvar = { hello =&gt; 'Phred' };<br>&gt; <br>&gt; my $two = two-&gt;new;<br>&gt; <br>&gt; package two;<br>&gt; print 'Hello ', $main::globalvar-&gt;{hello};<br>&gt; <br>&gt; 2010/6/10 Phred Bob &lt;phredbob@hotmail.com&gt;:<br>&gt; &gt; Hi All,<br>&gt; &gt;<br>&gt; &gt; I am trying to take a monolithic perl program (approx. 97k lines long) and<br>&gt; &gt; separate concerns (kind of an MVC-style division). I used AutoSplit to break<br>&gt; &gt; out the subroutines, but now I'm stuck. I tried separating the *.al<br>&gt; &gt; subroutines into a View directory if they contained a print statement and<br>&gt; &gt; into a Model directory if they didn't. The main part of the program (before<br>&gt; &gt; __END__) is about 4.6k lines that I am tentatively making the Controller.<br>&gt; &gt;<br>&gt; &gt; So -- the autoload works as long as the the files are left in the state in<br>&gt; &gt; which were originally generated (a bunch of .al files all in one directory).<br>&gt; &gt; That still leaves me with about 191 separate files with no classification on<br>&gt; &gt; them, so I'd like to organize them in further subdirectories to correspond<br>&gt; &gt; with my separation of them into models, views, and a controller.<br>&gt; &gt;<br>&gt; &gt; The problem is, if I move them, my autoload function no longer works. And if<br>&gt; &gt; I do put them in a subdirectory and load them as modules, they use their own<br>&gt; &gt; namespace and ignore all the lovely global variables the original developer<br>&gt; &gt; put in his vast, monolithic script.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Does anyone have any ideas on how to proceed?<br>&gt; &gt;<br>&gt; &gt; Thanks,<br>&gt; &gt; Fred Lowe<br>&gt; &gt; phredbob@hotmail.com<br>&gt; &gt; ________________________________<br>&gt; &gt; The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with<br>&gt; &gt; Hotmail. Get busy.<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Pdx-pm-list mailing list<br>&gt; &gt; Pdx-pm-list@pm.org<br>&gt; &gt; http://mail.pm.org/mailman/listinfo/pdx-pm-list<br>&gt; &gt;<br>&gt; -- <br>&gt; benh~<br>&gt; <br>&gt; 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>