Re: Perl constants with modules

2002-07-17 Thread Jenda Krynicky
From: Wiggins d'Anconia <[EMAIL PROTECTED]> > Possibly time to step in here and suggest XML rather than creating > some new or using some pre-existing config file standard. I am not an > XML zealot, in fact I have been rather resistant to it for a while, > but this sounds like opportunity knocki

Re: Perl constants with modules

2002-07-17 Thread Wiggins d'Anconia
Possibly time to step in here and suggest XML rather than creating some new or using some pre-existing config file standard. I am not an XML zealot, in fact I have been rather resistant to it for a while, but this sounds like opportunity knocking for it. That way "coming up with parsing algori

Re: Perl constants with modules

2002-07-16 Thread Daniel Gardner
Kevin Old wrote: > I am writing a script for a client and they have requested an easy way > to configure their script.without having to enter the script code > itself. > Second, which sytax (in your opinion) should I use? > > $CDMA::USER = "myusername"; > > or > > use constant USER => "

RE: Perl constants with modules

2002-07-16 Thread Jeff 'japhy' Pinyan
On Jul 16, Kevin Old said: >Do you have any code for processing a config file and/or an example >config file? There are plenty of config-file modules on CPAN. Search for "config" at http://search.cpan.org/. >%mar_omc_and_mms = ( > 'clt' => { 'omc2' => [qw(mm3 mm4)] }, > 'clt1x' => { 'omc1' =

RE: Perl constants with modules

2002-07-16 Thread Kevin Old
2002-07-16 at 11:55, Nikola Janceski wrote: > I still think you are safer with a config file. > With a module they can screw up the script so when it fails they will be > calling you. > with a config file you can program in the error checking. > > > > -Original Message--

Re: Perl constants with modules

2002-07-16 Thread Mike(mickalo)Blezien
Kevin, I have found, with experience, with clients who need to have scripts written, that are going to need some sort of global variables assigned to be used by various script, to use a separate configuration file or module. This prevents the client from messing up the main script(s) for your pro

RE: Perl constants with modules

2002-07-16 Thread Jeff 'japhy' Pinyan
On Jul 16, Michael Pastore said: >$Split1 = "@ARGV[2]"; >$Split2 = "@ARGV[3]"; >$WorkPath = "@ARGV[4]"; >$DataPath = "@ARGV[5]"; Useless use of quotes on @ARGV[2]. Scalar value @ARGV[2] better written as $ARGV[2]. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/

Re: Perl constants with modules

2002-07-16 Thread Jeff 'japhy' Pinyan
On Jul 16, Kevin Old said: >$CDMA::USER = "myusername"; vs. >use constant USER => "myusername"; >(called like CDMA::USER.correct?) Well, it's really quite a trifle. I would stick with variables (as opposed to constants) unless you REALLY need the benefit of a constant. -- Jeff "japhy" P

RE: Perl constants with modules

2002-07-16 Thread Nikola Janceski
, July 16, 2002 11:48 AM > To: [EMAIL PROTECTED] > Subject: Perl constants with modules > > > Hello all, > > I am writing a script for a client and they have requested an easy way > to configure their script.without having to enter the script code > itself. > >

RE: Perl constants with modules

2002-07-16 Thread Michael Pastore
Kevin, You could consider using input parameters as well... $Split1 = "@ARGV[2]"; $Split2 = "@ARGV[3]"; $WorkPath = "@ARGV[4]"; $DataPath = "@ARGV[5]"; so that when running from the command line they would be passed after the ..pl HTH, Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Perl constants with modules

2002-07-16 Thread Kevin Old
Hello all, I am writing a script for a client and they have requested an easy way to configure their script.without having to enter the script code itself. I'm not to crazy about using a config file like VARIABLE=VALUE, so I thought that since I am using a module anyway, why not have the v