全裸でワンライナー(仮)
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

全裸でワンライナー(仮)

  • 2,523 views
Uploaded on

Yokohama.pm 出張版 in YAPC::Asia 2009 前夜祭で喋ったLightningTalksの資料です。 ...

Yokohama.pm 出張版 in YAPC::Asia 2009 前夜祭で喋ったLightningTalksの資料です。
http://yokohama.pm.org/2009/08/yokohamapm-in-yapcasia-2009-1.html

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,523
On Slideshare
2,418
From Embeds
105
Number of Embeds
5

Actions

Shares
Downloads
4
Comments
0
Likes
2

Embeds 105

http://d.hatena.ne.jp 101
http://reader.freerss.net 1
http://www.slideshare.net 1
http://www.linkedin.com 1
http://www.slideee.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. my $profile = { name => ' ', id => 'sugyan', age => 26, };
  • 2. perl -le 'print "Hello"'
  • 3. perl -e'print$b,($a/=$b)- 1?"*":$/while$b=(grep{not $a%$_}1..($a||=pop))[1]' 60 2*2*3*5
  • 4. perl -le'$x=2**pop;print$ "x--$x,map$x&$_?$"x2:"/ ",0..$y++while$x' 2 / // / / ////
  • 5. for i in $(echo 0{0..9}{0 ..5}{0..9} {10..23}{0..5} {0..9}); do wget -w5 --ra ndom-wait http://*******/ $i.jpg; done
  • 6. perl -MText::MeCab -MNet::Twitter -MEncode=encode_utf8 -e ' my $t = '''Net::Twitter'''->new('''username''', ''sugy an''', '''password''', '''******''');my $statuses = $t ->friends_timeline;my $status = $$statuses[rand @$statuses] ;my $text = encode_utf8($$status{'''text'''});my $user = $$status{'''user'''}{'''screen_name'''};$text =~ s/ [^ s]+ /z($&);/egmsx;$t->update("@$user 343201214350250 200343201243343201237: $text");sub z {my $text = shif t @_;my $zenra = "345205250350243270343201247";my $mecab = '''Text::MeCab'''->new;my $n = $mecab->parse($te xt);my $output = '''''';$n = $n->next while $n->next;my $ flg = 0;while (($n = $n->prev)->prev) {if ($flg) {my $inser t = 1;if ($n->feature =~ / A (345220215350251236|34 5211257350251236|345213225350251236) /msx) {$ins ert = 0;}elsif ($n->feature =~ / A 345212251(3452132 25)?350251236 /msx and (split(/,/, $n->prev->feature, 0) )[5] =~ / 351200243347224250 /msx) {$insert = 0;}if ( $insert) {$output = $zenra . $output;$flg = 0;}}$output = $ n->surface . $output;if ($n->feature =~ / A 3452132253 50251236 /msx) {$flg = 1;}}if ($flg) {$output = $zenra . $output;}return $output;}'
  • 7. hoge.pl #!/usr/bin/perl use List::Util 'max'; my @a = (4, 2, 3); print max(@a), "n";
  • 8. % perl -MAcme::OneLiner hoge.pl
  • 9. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max' ''); my(@a) = (4, 2, 3);print ma x(@a), "n";'
  • 10. % perl -MAcme::OneLiner hoge.pl
  • 11. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";'
  • 12. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";' % perl -MAcme::OneLiner=short hoge.pl
  • 13. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";' % perl -MAcme::OneLiner=short hoge.pl perl -MList::Util=max -e 'my(@a) = (4, 2, 3);print max(@a), "n";'
  • 14. % perl -MAcme::OneLiner hoge.pl
  • 15. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";'
  • 16. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";' % perl -MAcme::OneLiner=symbol hoge.pl
  • 17. % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";' % perl -MAcme::OneLiner=symbol hoge.pl perl -e '""!~("(?{".("!(==>+/#[#%~/<&*=- ,{<+-%,+#`;,|-.:#>/<>{;]>#{&?{}%}!{{]>?< #/_,#;"^"|}}`/|`}:&_&;{=_;<-+%>-~|{.]{?` *#>>?%-,&%_(-%/~<&,:;.{#|+?-./<<>"^"(&%} ]><*[?/,}+;]!|`(><;{=)%}!:<:-,)-*#>}-+-. .{()/)*{-(>#=/.#,~=>")."})")'
  • 18. To install this module, ... perl Makefile.PL make make test make install To install with Module::Build, ... perl Build.PL ./Build ./Build test ./Build install
  • 19. To install this module, ... perl -MExtUtils::MakeMaker -Mwarnings make make test make install To install with Module::Build, ... perl -MModule::Build -Mwarnings -Mstr ./Build ./Build test ./Build install
  • 20. -Mstrict=refs -e 'WriteMakefile(q/NAME/, ict=refs -e 'my $builder = q/Module::Build
  • 21. q/Acme::OneLiner/, q/AUTHOR/, q/Yoshihiro /->new(q/module_name/, q/Acme::OneLiner/,
  • 22. Sugi <sugi1982@gmail.com>/, q/VERSION_FROM q/license/, q/perl/, q/dist_author/, q/Yos
  • 23. /, q/lib/Acme/OneLiner.pm/, q/ABSTRACT_F hihiro Sugi <sugi1982@gmail.com>/, q/dist_
  • 24. ROM/, q/lib/Acme/OneLiner.pm/, q/PL_FILE version_from/, q/lib/Acme/OneLiner.pm/,
  • 25. S/, {}, q/PREREQ_PM/, {q/Test::More/, 0, q q/requires/, {q/Test::More/, 0, q/version/
  • 26. /version/, 0, q/IO::CaptureOutput/, 0}, q/ , 0, q/IO::CaptureOutput/, 0}, q/add_to_cl
  • 27. dist/, {q/COMPRESS/, q/gzip -9f/, q/SUFFIX eanup/, [q/Acme-OneLiner-*/]); $builder->c
  • 28. /, q/gz/}, q/clean/, {q/FILES/, q/Acme-One reate_build_script;'
  • 29. Liner-*/});'
  • 30. To install this module, ... perl -MExtUtils::MakeMaker -Mwarni... make make test make install To install with Module::Build, ... perl -MModule::Build -Mwarnings -M... ./Build ./Build test ./Build install