2011-02-21から1日間の記事一覧
乱数、while文、if文の練習 秘密の数を当てるゲーム#!/usr/bin/perl -w my $secret = int(1 + rand 100);while (1) { print "Please enter a guess from 1 to 100: "; chomp(my $guess = ); if ($guess =~/quit|exit|^\s*$/i) { print "Sorry you gave up.Th…
おかしいところをわからない #!/usr/bin/perl print "Which directory? (Default is your home directory) "; chomp (my $dir = ); if ($dir =~ /^\s*$/) { chdir or die "Can't chdir to your home directory: $!"; }else { chdir $dir or die "Can't chdir…
乱数、while文、if文の練習 秘密の数を当てるゲーム#!/usr/bin/perl -w my $secret = int(1 + rand 100);while (1) { print "Please enter a guess from 1 to 100: "; chomp(my $guess = ); if ($guess =~/quit|exit|^\s*$/i) { print "Sorry you gave up.Th…
おかしいところをわからない #!/usr/bin/perl print "Which directory? (Default is your home directory) "; chomp (my $dir = ); if ($dir =~ /^\s*$/) { chdir or die "Can't chdir to your home directory: $!"; }else { chdir $dir or die "Can't chdir…
おかしいところをわからない #!/usr/bin/perl print "Which directory? (Default is your home directory) "; chomp (my $dir = ); if ($dir =~ /^\s*$/) { chdir or die "Can't chdir to your home directory: $!"; }else { chdir $dir or die "Can't chdir…
乱数、while文、if文の練習 秘密の数を当てるゲーム#!/usr/bin/perl -w my $secret = int(1 + rand 100);while (1) { print "Please enter a guess from 1 to 100: "; chomp(my $guess = ); if ($guess =~/quit|exit|^\s*$/i) { print "Sorry you gave up.Th…