Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: using strict and a config file

by mce (Curate)
on Nov 12, 2001 at 13:55 UTC ( [id://124785]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: using strict and a config file
in thread using strict and a config file

Hi,
I have a similar setup and the way I work is fully qualifing the variable using the package name. This will prevent strict from complaining. For Example: The config_mail file
Package MailConfig; use strict; @MailConfig::fields=qw /to from subject message/;
etc... And in your actual program, do:
use strict; require "config_mail.pl"; ...your print code... <tr> <td>From:</td> <td><select name='$MailConfig::fields[1]" size="1"> more code... </select></td> </tr> <tr> <td>Subject:</td> <td><input type="text" name="$MailConfig::fields[2]" size="24"></t +d>
This is the most readable solution, as you know where to look for when you want to change a variable.
Dr. Mark Ceulemans

Senior Consultant

IT Masters, Belgium

Replies are listed 'Best First'.
Re (tilly) 4: using strict and a config file
by tilly (Archbishop) on Nov 12, 2001 at 14:30 UTC
    Glancing at your print code strongly suggests to me that you have a lot to learn about separation of presentation and content.

    A good first link I would therefore recommend is the following paper on how to use the template toolkit in building web sites.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://124785]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found