What is $@ in Perl?

前端 未结 2 630
有刺的猬
有刺的猬 2021-01-02 07:50

I have a Perl script which I cannot understand.

for $i(@myarr)
{
    #some stuff
    eval {
        #some stuff
    };
    if($@)
    {
        print \"*** $         


        
2条回答
  •  借酒劲吻你
    2021-01-02 07:54

    $@ The Perl syntax error or routine error message from the last eval, do-FILE, or require command. If set, either the compilation failed, or the die function was executed within the code of the eval. please read this doc http://perldoc.perl.org/perlvar.html

提交回复
热议问题