Re: Is this possible to override print() ?
- From: exilepanda@xxxxxxxxx (Panda-X)
- Date: Tue, 26 Feb 2008 10:43:06 +0800
Sorry... the email is unfinished, the reason why I need to do this is
because
I don't want to pollute the existed codes / context ... the original print
statements would
like to retain, but I can still do the translations by adding :
use OverridePrint;
in a common module that all existed scripts are now using.
package OverridePrint;
use strict;
# WHAT CAN I DO HERE ???
1;
# Main Program
use OverridePrint;
print "Goodbye World" ; # I got "GBK : Goodbye World"
$mode = "BIG5" ;
print "Hello World" ; # I got "BIG5 : Hello World"
I don't want to write another sub like Print ( $case, $mesg ) , but
directly override the print behavior.
In the real story, the structure is more complex. Default will print in
English, with user request ( argv ),
will print in BIG5 CHinese, and with Browser detection, will translate to
GBK.
- Follow-Ups:
- Re: Is this possible to override print() ?
- From: Chas. Owens
- Re: Is this possible to override print() ?
- References:
- Is this possible to override print() ?
- From: Panda-X
- Is this possible to override print() ?
- Prev by Date: Is this possible to override print() ?
- Next by Date: Re: scalar / hash problem in HTML::Parser
- Previous by thread: Is this possible to override print() ?
- Next by thread: Re: Is this possible to override print() ?
- Index(es):
Relevant Pages
|