| [reply] [d/l] [select] |
# check whether or not a scalar variable is tainted
# (code straight from the Camel, 3rd ed., page 561)
sub is_tainted_pp {
my $arg = shift;
my $nada = substr( $arg, 0, 0 ); # zero-length
local $@;
eval { eval "# $nada" };
return length($@) != 0;
}
# We need a function that checks if a scalar is tainted.
# Either use the # Scalar::Util module's tainted() function
# or our (slower) pure Perl
# fallback is_tainted_pp()
{
local $@;
eval { require Scalar::Util };
*is_tainted = $@ ? \&is_tainted_pp : \&Scalar::Util::tainted;
}
And i'm banging my head against a wall to understand it. This code mucked my day ;-)
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
| [reply] [d/l] [select] |
6) *name ...
This is a Perl typeglob: see Typeglobs on perldata
Typeglobs are the internal data of which the symbol table is filled. Hic sunt leones .. here black magic begins..
See also many links on my homenode
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [d/l] |
PPI::Document
PPI::Token::Whitespace '\n'
PPI::Statement
PPI::Token::Symbol '*foo'
PPI::Token::Whitespace '\n'
So PPI::Token::Symbol says: The PPI::Token::Symbol class is used to cover all tokens that represent variables and other things that start with a sigil.
So perltoc or perl -> perldata - Perl data types -> http://perldoc.perl.org/perldata.html#Typeglobs-and-Filehandles
Would it be easier if PPI::Token::Symbol linked perldata all on its own? Yes :D | [reply] |