LoginSignup
1
1

More than 5 years have passed since last update.

perlでズンドコゲッター

Last updated at Posted at 2016-05-30

概要

paizaのperlでズンドコゲッターやってみた。

実際

サンプルコード

#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use LWP::UserAgent;
use HTTP::Cookies;
use Encode;

binmode(STDOUT, ':utf8');

sub zundoko
{
    my $ua = LWP::UserAgent->new();
    my $res = $ua->get('http://ohijs0.paas.jp-e1.cloudn-service.com/zundoko');
    my $cont = decode('utf-8', $res->content() || '');
    return $cont;
}
my $i = 0;
while (1) 
{
    my $r = zundoko();
    print $r." ";
    if ($r eq 'ドコ') 
    {
        if ($i == 4) 
        {
            last;
        }
        $i = 0;
    }
    else
    {
        $i++;
    }
}
print "キ・ヨ・シ!\n";
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1