Help for this page

Select Code to Download


  1. or download this
    my $C='((w)hite|(b)lack)';
    
    ...
    white "princepawn"
    foo
    black "princepawn"
    
  2. or download this
    sub popstr   { substr $_[0], -1, 1, '' } # or chop
    sub shiftstr { substr $_[0],  0, 1, '' }
    ...
    pushstr $string, $foo;      # estint
    unshiftstr $string, $bar;   # gestint
    print "$string\n";
    
  3. or download this
    sub popstr   { $_[0] =~ s/(.)\z//s; $1 }
    sub shiftstr { $_[0] =~ s/^(.)//s;  $1 }
    ...
    pushstr $string, $foo;      # estint
    unshiftstr $string, $bar;   # gestint
    print "$string\n";
    
  4. or download this
    2;0 juerd@ouranos:~$ perl -e'undef christmas'
    Segmentation fault
    2;139 juerd@ouranos:~$