2009-12-01から1ヶ月間の記事一覧

Apacheエラーログ Malformed UTF-8 character (byte 0xff) in eval "string" at (eval **) line *

プログラム my $komoji = 'aiueoAIUEO0123456789,./%-'; print "komoji : ".$komoji."<br>"; my $oomoji = Jcode->new($komoji)->tr('a-zA-Z0-9-!(),./%%','a-zA-Z0-9!−(),./%')->sjis; print "oomoji : ".$oomoji."<br>"; Apacheエラーログ Malformed …

PERLでURLエンコード

sub url_encode($) { my $str = shift; $str =~ s/([^\w ])/'%'.unpack('H2', $1)/ego; $str =~ tr/ /+/; return $str; }

PerlでHttpRequest

my $content = httpRequest("http://www.hoge.com/"); print $content; sub httpRequest{ my $url = shift; my($request, $userAgent, $response, $content); $request = HTTP::Request->new(GET => $url); $userAgent = LWP::UserAgent->new; $response = $…