Is there an equivalent of JavaScripts escape() function in Perl?
Submitted by: AdministratorTry This:
require CGI;
$escaped = CGI::escape( $normal );
# ...or...
sub escape {
my $str = shift || '';
$str =~ s/([^w.-])/sprintf("%%%02X",ord($1))/eg;
$str;
}
$escaped = escape( $normal );
Submitted by: Administrator
require CGI;
$escaped = CGI::escape( $normal );
# ...or...
sub escape {
my $str = shift || '';
$str =~ s/([^w.-])/sprintf("%%%02X",ord($1))/eg;
$str;
}
$escaped = escape( $normal );
Submitted by: Administrator
Read Online CGI Programming Job Interview Questions And Answers
Top CGI Programming Questions
☺ | What is a CGI bin directory? |
☺ | Can I pass JavaScript variables to a CGI Perl program? |
☺ | How can I stop my CGI script reading and writing files as nobody? |
☺ | How can I run my CGI program live in a debugger? |
☺ | What do I absolutely need to know in CGI? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |