[Israel.pm] typeglobs

Gabor Szabo szabgab at gmail.com
Wed Jun 27 02:28:19 PDT 2007


Do you really need to run this on perl < 5.6.0 ?
If not then why not use scalars as file handlers?

open (my $IN, "<", "$0") or die "$!\n";
call_good($IN);
call_bad($IN);


a lot less headache

Gabor


On 6/27/07, Levenglick Dov-RM07994 <dovl at freescale.com> wrote:
> Can someone please explain why call_bad doesn't print the file? What is
> the difference between it and call_good?
>
> open (IN, "$0") or die "$!\n";
> call_good(*IN);
> call_bad(*IN);
>
> sub call_bad
> {
>         print "Doesn't work\n";
>         print while <$_[0]>;
> }
> sub call_good
> {
>         print "Works\n";
>         *A = $_[0];
>         print while <A>;
> }
>
>
> Best Regards,
> Dov Levenglick
> DSP SoC System and Applications Engineer,
> Network and Computing Systems Group
> Freescale Semiconductor Israel
> Tel. +972-9-952-2804
> The information contained in this email is classified as:
> [ ] Freescale General Business Information
> [ ] Freescale Internal Use Only
> [ ] Freescale Confidential Proprietary
> [x] Personal Memorandum
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>


-- 
Gabor Szabo
http://www.szabgab.com/
Perl Training in Israel  http://www.pti.co.il/



More information about the Perl mailing list