Last active
October 15, 2021 00:48
-
-
Save mamemomonga/2ba64cec1add76ad7e595d2e007035f3 to your computer and use it in GitHub Desktop.
お尻めうスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Getopt::Std; | |
use feature 'say'; | |
binmode STDIN,":utf8"; | |
binmode STDOUT,":utf8"; | |
my %opt; | |
getopts("ois:h",=>\%opt); | |
sub usage { | |
say "USAGE: $0 OPTIONS"; | |
say "OPTIONS:"; | |
say " -s 文字列"; | |
say " -o 出てくるめう〜"; | |
say " -i 入ってくるめう〜"; | |
say "EXAMPLE:"; | |
say qq{ \$ ./osirimeu.pl -is "スクリプト"}; | |
say qq{ ス゛ク゛リ゛プ゛ト゛が゛め゛う゛の゛お゛尻゛に゛は゛い゛っ゛て゛く゛る゛め゛う゛〜゛!゛!゛!゛}; | |
exit(1); | |
} | |
usage() if ($opt{h}); | |
usage() unless ($opt{s}); | |
my $buf=$opt{s}; | |
utf8::decode($buf); | |
chomp($buf); | |
if($opt{i}) { | |
$buf.="がめうのお尻にはいってくるめう〜!!!"; | |
} elsif($opt{o}) { | |
$buf.="がめうのお尻から出てくるめう〜!!!"; | |
} else { | |
usage(); | |
} | |
$buf=~s!(.)!$1゛!g; | |
say $buf; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment