On 6/27/07, Levenglick Dov-RM07994 <[EMAIL PROTECTED]> wrote: > Can you elaborate? Why is opening into a scalar better than opening into > a file handle?
1) The 2 params version creates a security risk: my $filename = get_from_external_user(); open FH, $filename or die; # open for reading What if the user sends you ">a_critical_file" as the filename? 2) open my $fh, $fh is scoped to the enclosing block while FH is global 3) You can pass $fh to functions without typeglob magic and without asking questions on mailing lists :-) Gabor -- Gabor Szabo http://www.szabgab.com/ Perl Training in Israel http://www.pti.co.il/ _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
