in reply to Re^2: Memorizing The s/// Option List For Fun and Profit
in thread Memorizing The s/// Option List For Fun and Profit

Bear in mind that some regexp modifiers are mutually exclusive; for example /a which imposes ASCII semantics on the string being matches, and /l which imposes locale semantics on it. Thus s/foo/bar/miracles is a compile time error.

Here's a quick script to find allowable words...

#!/usr/bin/env perl use v5.18; open my $dict, "<", "/usr/share/dict/words"; while (<$dict>) { next unless /^[msixpodualgcer]+$/; chomp; my $ok = do { my $testing = $_; local $_; # protection eval "s/foo/bar/$testing; 1"; }; say if $ok; }

I rather like these ones:

Now to find a way to patch B::Deparse...

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^4: Memorizing The s/// Option List For Fun and Profit
by demerphq (Chancellor) on May 24, 2013 at 13:54 UTC

    Now to find a way to patch B::Deparse..

    Patches should be submitted to perl5-porters@perl.org

    You can clone the repo with git clone perl5.git.perl.org:/perl

    ---
    $world=~s/war/peace/g