Help for this page

Select Code to Download


  1. or download this
    $ perl -MData::Dump -e '"ya"=~/(x)?/; dd $#-, \@-, $#+, \@+'
    (0, [0], 1, [0, undef])
    
  2. or download this
    "1" =~ /1/    or die;
    print $#-?"yes\n":"no\n";  # -> no
    ...
    print $#-?"yes\n":"no\n";  # -> no !!
    "1" =~ /(2)?/ or die;
    print $#+?"yes\n":"no\n";  # -> yes