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