Perl CGI charset magic thingy (was: How to be an expert)

Mark Komarinski mkomarinski at wayga.org
Tue Jun 13 09:59:01 EDT 2006


On Tue, Jun 13, 2006 at 09:31:14AM -0400, Ben Scott wrote (and I 
changed):
> >... but, if so, then I don't understand why.  Anyone care to give
> >me their interpretation?  [From /usr/share/perl5/Bugzilla/CGI.pm]
> >
> >    $self->charset(Param('utf8') ? 'UTF-8' : '');
> 
>  Well, that looks like the ternary operator (conditional expression).
> To break it out:
> 
> if (Param('utf8')) {
> 	$self->charset("UTF-8");
> 	}
> else {
> 	$self->charset("");	# empty string
> 	}
> 

Fixed it for you.  I think.

-Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20060613/dc8bdd18/attachment.bin


More information about the gnhlug-discuss mailing list