Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MIME::Base64::decode()で厳密なパラメーターを持つPHP base64_decode関数のように機能を取得するにはどうすればよいですか?
my $c = '[A-Za-z0-9+/]'; my $strict = qr/ ^ (?:$c{4})*+ (?:$c(?:==|$c(?:=|$c))=)?+ \z /x; sub php_base64_decode { return undef if $_[1] && $_[0] !~ $strict; return decode_base64($_[0]); }
PHPbase64_decodeが正確に何をするかわからないので、$strict.
base64_decode
$strict