Re: Programming style: using Classes or inline

2006-03-17 Thread A. Pagaltzis
* muppet <[EMAIL PROTECTED]> [2006-03-17 15:50]: >I think a "require" of a file that does not define a package may >behave similarly to what C does. Sort of. `require`ing a file multiple times won’t load it multiple times. In Perl, you get that using `do $filename`, which equates to `eval slurp($f

Re: Programming style: using Classes or inline

2006-03-17 Thread muppet
David wrote: > What I was trying to > do was something I guess not appropriate in Perl. What I had attempted > was to keep it modular - I had three component files - but none were > defined as packages. I'd attempted to keep the related portions of the > code in separate files, and then just inc

Re: Programming style: using Classes or inline

2006-03-17 Thread David
On Thu, Mar 16, 2006 at 08:16:12PM -0500, muppet wrote: > On Mar 16, 2006, at 2:30 PM, David wrote: > >What came as a surprise to me was that I couldn't have global > >variables. > >Again, I'm quite new to Perl and some of the rules are a bit > >unexpected. > "strict" doesn't prevent you fro

Re: Programming style: using Classes or inline

2006-03-16 Thread muppet
On Mar 16, 2006, at 2:30 PM, David wrote: On Thu, Mar 16, 2006 at 09:52:20PM +1300, Grant McLean wrote: On Wed, 2006-03-15 at 21:13 -0600, David wrote: [...] "use strict" and separate files. No, that's right, before you added 'use strict' all your variables were global variables. When y

Re: Programming style: using Classes or inline

2006-03-16 Thread David
On Thu, Mar 16, 2006 at 02:48:26PM +1100, Daniel Kasak wrote: > David wrote: > >I first tried to keep my perl source separated into 3 files, all inline > >code without making any packages, including the other two into the main > >program by "use" statements, > >For a little perspective, my code n

Re: Programming style: using Classes or inline

2006-03-16 Thread David
On Thu, Mar 16, 2006 at 09:52:20PM +1300, Grant McLean wrote: > On Wed, 2006-03-15 at 21:13 -0600, David wrote: [...] "use strict" and separate files. > No, that's right, before you added 'use strict' all your variables were > global variables. When you declared the variables with 'my', you > re

Re: Programming style: using Classes or inline

2006-03-16 Thread Grant McLean
On Wed, 2006-03-15 at 21:13 -0600, David wrote: > I first tried to keep my perl source separated into 3 files, all inline > code without making any packages, including the other two into the main > program by "use" statements, but when I added "use strict", I found that > I had to tie the variables

Re: Programming style: using Classes or inline

2006-03-15 Thread Daniel Kasak
David wrote: I suppose this is more of a Perl question, but since I'm working with Gtk, maybe it will pass.. :) I'm quite new to Perl programming, and for starters, I have built a gtk-perl interface to my PostGresql business records database. Cool. That's almost what I'm doing, but with MySQL

Programming style: using Classes or inline

2006-03-15 Thread David
I suppose this is more of a Perl question, but since I'm working with Gtk, maybe it will pass.. :) I'm quite new to Perl programming, and for starters, I have built a gtk-perl interface to my PostGresql business records database. Some of my windows are built with glade using libglade and some are