The problem in your example is not the
leading '-' but the
inline hyphen. Since
-font-family has the latter its gunna fail. And if you had used strict should have failed with an error. I say should because when I tested it it didnt (I am preparing a bug report right now), however with warnings enabled you do get a good idea of what is going on. Also B::Deparse gets this stuff wrong FWICT. (another bug report on the way)
D:\perl\psmail-1.0>perl -MData::Dumper -w -e "use strict; print Dumper
+({-font-family => 'not-valid'})"
Argument "family" isn't numeric in subtraction (-) at -e line 1.
Argument "-font" isn't numeric in subtraction (-) at -e line 1.
$VAR1 = {
'0' => 'not-valid'
};
D:\perl\psmail-1.0>perl -MData::Dumper -w -e "use strict; print Dumper
+({-fontfamily => 'not-valid'})"
$VAR1 = {
'-fontfamily' => 'not-valid'
};
# Deparse gets this one _wrong_
D:\perl\psmail-1.0>perl -MO=Deparse -MCGI -e "use strict; my $q = new
+CGI ; print $q->Tr({-fontfamily => 'not-valid'})"
my $q = 'CGI'->new;
print $q->Tr({-'fontfamily', 'not-valid'});
-e syntax OK
# Hard to say for sure, but apparently Deparse gets this right. But wh
+y doesnt it die?
D:\perl\psmail-1.0>perl -MO=Deparse -MCGI -e "use strict; my $q = new
+CGI ; print $q->Tr({-font-family => 'not-valid'})"
my $q = 'CGI'->new;
print $q->Tr({-'font' - 'family', 'not-valid'});
-e syntax OK
--- demerphq
my friends call me, usually because I'm late....
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.