Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Memorizing The s/// Option List For Fun and Profit

by tobyink (Canon)
on May 24, 2013 at 10:35 UTC ( [id://1035106]=note: print w/replies, xml ) Need Help??


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:

  • amigos
  • carcass
  • circus
  • corridor
  • crisscross
  • gigolo
  • girls
  • idiom
  • igloo
  • macrocosm
  • macroscopic
  • mammograms
  • microcosm
  • microscopic
  • orgasmic
  • pompous
  • program
  • sarcasm
  • scissors

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1035106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found