Back in the '80s, Frank Zappa came out with an album entitled
Ship Arriving Too Late to Save a Drowning Witch.
My first forays into messing around with Taint mode are causing a similar message: "Too late for -T option..."
I realize that Taint mode
writ large is a complex topic. I have read the
Taint Mode FAQ and part of Lincoln Stein's Security FAQ (link available within previous link) so I know I have my work cut out for me. Which is fine.
For now, it would be oh-so helpful if someone could tell me why my two small snippets of code (borrowed from
PERLTOOT) are generating this error message:
Too late for -T option at persontest.pl line 1.
There's more than one way to do it, but the right way usually involves invoking Taint mode, according to Larry Wall, so please help me on this first step of what will be, I am sure, a long but rewarding journey.
Here's the code:
#!/usr/bin/perl5 -Tw
###### persontest.pl
###### perltoot
###### Person class Test code (page 4)
use Person;
$him = Person->new();
$him->name("Jason");
$him->age(23);
$him->peers( "Norbert", "Rhys", "Phineas" );
push @allRecs, $him; #save object in array for later use
printf "%s is %d years old.\n", $him->name, $him->age;
print "His peers are:", join (", ", $him->peers), "\n";
printf "Last rec's name is %s\n", $allRecs[-1]->name;
###### person.pm
###### perltoot Person class
###### page 5
package Person;
use strict;
# object constructor
sub new
{
my $self = {};
$self->{NAME} = undef;
$self->{AGE} = undef;
$self->{PEERS} = [];
bless $self;
return $self;
}
# per-object data access methods
# With args, set the value; without only retrieve value(s)
sub name
{
my $self = shift;
if (@_) { $self->{NAME} = shift; }
return $self->{NAME};
}
sub age
{
my $self = shift;
if (@_) { $self->{AGE} = shift;}
return $self->{AGE};
}
sub peers
{
my $self = shift;
if (@_) { @{ $self->{PEERS} } = @_ }
return @{ $self->{PEERS} }
}
1;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.