in reply to Re: Re: Re: HTML and CGI coding
in thread HTML and CGI coding

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....