Undef's error

xiaoxiao2021-03-06  42

Perl is a computer language that is very close to the natural language. It is a computer language that can be written as a prose.

It is because of this, today I have made the following mistakes, I spent an hour, I know that I am so crazy.

Just discovered.

This from a class, only one method

#! / usr / bin / perl -w

Use strict;

Use Data :: Dumper :: Simple;

SUB CRAZY

{

MY $ SELF = Shift;

Die "Rent NOT Paied: $!" Unless UndEf $ Self -> {Rent}; #here!

# .... do sth with $ self-> {rent}

} "If there is no rent, you will die" - how natural! But Undef is not a defense of defined, in fact, she is a way to make everything. Under the role of UNLESS, this sentence becomes nonsense.

转载请注明原文地址:https://www.9cbs.com/read-64402.html

New Post(0)