Can anyone tell me why the following prints out both SCALAR and CODE? What am I missing?
#!/usr/bin/perl -l use strict; use warnings; { package Foo; sub bar {}; } foreach my $type ( qw<SCALAR ARRAY HASH CODE IO FORMAT> ) { print $type if defined *Foo::bar{$type}; }
I only want that to print CODE. How do I fix it?
Cheers,
Ovid
New address of my CGI Course.
In reply to Misbehaving typeglob by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |