> chen li wrote: >> >> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: >> >>> chen li wrote: >>> >>>> 6)$mean = eval(join("+", @data)) / @data; >>>> >>>> Depending on how you understand Perl and what >>> progress >>>> you are I prefer 6). >>> Depending on how you understand Perl, 6 is the worst >>> solution. >> >> Could you explaind why 6) is the worst? > > Because it uses string eval which means that the code has to be compiled at > run-time and it could introduce a security hole if you don't know what @data > contains and it's a cute trick and cute tricks should only be used in cute > programs.
I'll take that as a compliment -- thanks, John! (And no, I really don't think my own submission, #6, is a great idea... What if the line above said --- @data = ('`rm -rf /`'); --- ? Bad stuff, don't try it.) - B -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>