-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

$Bill Luebkert <[EMAIL PROTECTED]> wrote [1:46am -0700]

   BL > Marcos Lorenzo de Santiago wrote:
   BL > 
   BL > > But why? Is there any reason for not doing this? I guess maybe 
security
   BL > > problems? or unexpected script behaviour?
   BL > 
   BL > Good start.
   BL > 
   BL > If you went to the trouble of verifying each and every argument before
   BL > you created a var out of it (maybe using a pre-defined list of legal
   BL > values) you could limit the downside of the errors you could get.  The
   BL > interpreter is going to eval whatever you tell it to and if there were
   BL > a way to feed an evil config file to your program, it could be 
disastrous.
   BL > I would trust an eval if it was only my code that was being eval'd, but
   BL > not from an external source.

Ok, that's what I was thinking about. Then you're right, I'll forget that
eval function possibility. 

   BL > eval has it's uses, mostly for trapping errors in sub-code and 
debugging,
   BL > but most people avoid it in regular code.  There are differences between
   BL > V4 and V5 and memory leak problems that you could encounter; plus the 
fact
   BL > that you're adding a level of complexity to your code.

I'll follow your instructions, now that I know the main use of eval. I 
always thought its use was for this purposes, but now I see it clearly.

   BL > I'd still recommend using a short hash name instead and also be careful
   BL > of what 'value' these vars/keys can take on from the config file.

Ok, I'll keep my eyes wide open :)


Thanks for the advice!


Regards,
Marcos.

- -- 
,----------------------------------------------------------------------.
| "There are a billion people in China. And I want them to be able to  |
| pass notes to each other written in Perl. I want them to be able to  |
| write poetry in Perl. That is my vision of the Future. My chosen     |
| perspective."                                                        |
|   -- Larry Wall (Open Sources, 1999 O'Reilly and Associates)         |
|----------------------------------------------------------------------|
| Labs. Technician                          |                          |
| Department of Telematic Engineering       | Debian GNU/Linux Powered |
| Carlos III University of Madrid           |                          |
|-------------------------------------------|                .--.      |
|                                           |               |o_o |     |
|  _________                                |      .''`.    |:_/ |     |
| |~~      @| Marcos Lorenzo de Santiago    |     : :' :   //   \ \    |
| |  ====   | E-mail:  [EMAIL PROTECTED]    |     `. `'   (|     | )   |
| |  ====   | Telephone: (+34) 91-624-9959  |       `-   /'\_   _/`\   |
| |_________| Web: www.it.uc3m.es/marcos    |            \___)=(___/   |
|                                           |                          |
`----------------------------------------------------------------------'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFCUlPjckJQBlHCNUERAtI4AJ912/F8VMFv3Xa6EVDJwOg9Wew+9gCfRad/
48GCieUrHDCEDZ6H8nFNj98=
=LHlg
-----END PGP SIGNATURE-----
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to