Is there a Perl equivalent to Python's `if __name__ == '__main__'`?

前端 未结 3 2141
北恋
北恋 2021-02-06 23:31

Is there a way to determine if the current file is the one being executed in Perl source? In Python we do this with the following construct:

if __name__ == \'__m         


        
3条回答
  •  Happy的楠姐
    2021-02-06 23:54

    See the "Subclasses for Applications (Chapter 18)" portion of brian d foy's article Five Ways to Improve Your Perl Programming.

提交回复
热议问题