Skip to main content
added 117 characters in body
Source Link
brian d foy
  • 133.6k
  • 31
  • 214
  • 613

Truth and Falsehood in man perlsyn explains:

The number 0, the strings '0' and "", the empty list "()", and "undef" are all false in a boolean context. All other values are true.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false. (Note: Perl v5.38 introduced true and false through the new builtin pragma).

Truth and Falsehood in man perlsyn explains:

The number 0, the strings '0' and "", the empty list "()", and "undef" are all false in a boolean context. All other values are true.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

Truth and Falsehood in man perlsyn explains:

The number 0, the strings '0' and "", the empty list "()", and "undef" are all false in a boolean context. All other values are true.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false. (Note: Perl v5.38 introduced true and false through the new builtin pragma).

Add "source of wisdom" (manual page) together with a citation
Source Link
U. Windl
  • 4.7k
  • 39
  • 65

Truth and Falsehood in man perlsyn explains:

The number 0, the strings '0' and "", the empty list "()", and "undef" are all false in a boolean context. All other values are true.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

Truth and Falsehood in man perlsyn explains:

The number 0, the strings '0' and "", the empty list "()", and "undef" are all false in a boolean context. All other values are true.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

Added ('')
Source Link
Alan Haggai Alavi
  • 74.7k
  • 19
  • 105
  • 129

In Perl, the following evaluate to false in conditionals:

0
"0"'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

In Perl, the following evaluate to false in conditionals:

0
"0"
undef
''  # Empty scalar
()  # Empty list

The rest are true. There are no barewords for true or false.

In Perl, the following evaluate to false in conditionals:

0
'0'
undef
''  # Empty scalar
()  # Empty list
('')

The rest are true. There are no barewords for true or false.

Source Link
Alan Haggai Alavi
  • 74.7k
  • 19
  • 105
  • 129
Loading