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...
|
|---|
| 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 |