====== Perl deprecated or obsolete functions or modules ======
最近透過 checkmarx 掃描 perl 的原始碼, 只要出現
open(FH, '<', $file) or die $!;
就會有以下這個風險項目 \\ {{:tech:image_43.png?650}}
* 由 [[https://wiki.sei.cmu.edu/confluence/display/perl/SEI+CERT+Perl+Coding+Standard|SEI CERT Perl Coding Standard]] 所建議的解決方式如下:
* 原本
:
open(FH, '<', $branch_env_file) or die $!;
:
* 改成
use Carp;
:
open(FH, '<', $branch_env_file) or croak "error opening $branch_env_file: stopped";
:
===== 參考網址 =====
* https://wiki.sei.cmu.edu/confluence/display/perl/EXP30-PL.+Do+not+use+deprecated+or+obsolete+functions+or+modules
{{tag>perl 資安風險}}