Help for this page

Select Code to Download


  1. or download this
      print "'$_' is empty string" if $_ =~ /^$/;
    
  2. or download this
    print "Empty   matches ^\$  --> ", ("" =~ /^$/ ? 'yes' : 'no'), "\n";
    print "Newline matches ^\$  --> ", ("\n" =~ /^$/ ? 'yes' : 'no'), "\n"
    +;
    print "Empty   matches ^\\z --> ", ("" =~ /^\z/ ? 'yes' : 'no'), "\n";
    print "Newline matches ^\\z --> ", ("\n" =~ /^\z/ ? 'yes' : 'no'), "\n
    +";