Help for this page

Select Code to Download


  1. or download this
    sub foo {
         my($qr, $replace) = @_;
    ...
    $_ = "This is a new dawn.";
    foo(qr/(\w+)/, sub { ucfirst $1 });
    print;
    
  2. or download this
    sub bar {
       my $callback = shift;
       $callback->();
    }
    bar(sub { s/(\w+)/\u$1/g; });