したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |

so as not to touch my pretty children #-(

1veith:2013/05/21(火) 17:56:51
use warnings;

my ($data_file, $expression_file) = @ARGV;

my @words;
if(-f $expression_file){
open(my $fh, "<", $expression_file) or die " file can't open. $expression_file";
while(my $line = <$fh>){
$line =~ s/[\r\n]//;
push @words, $line;
}
close($fh);
} else {
push @words, $expression_file;
}

my $reg = join("|", @words);

open(my $fh, "<", $data_file) or die " file can't open. $data_file";
while(my $line = <$fh>){
if($line =~ /($reg)/){
print $line;
}
}
close($fh);use warnings;

require "mylocal.pl";

my $word = shift @ARGV;

my $index = mylocal::get_index($word);

open(my $fh, "<", "index\\$index.txt") or die " file can't open. $index";
while(my $line = <$fh>){
if($line =~ /\b$word\b/){
print $line;
}
}
close($fh);package mylocal;

sub get_index {
my $word = shift @_;
my $index = substr($word, 0, 2);
$index = lc($index);
$index =~ s/[^a-z]/_/;
$index =~ s/\//_/;
return $index;
}

1;use warnings;

use POSIX 'ceil';
use Encode qw/encode decode/;
use File::Basename 'basename';

my ($number, $file) = @ARGV;

my $filesize = -s $file;
my $size = ceil($filesize / $number);

open(my $fh, "<", $file) or die " file can't open. $file";

my $length = $size + 1;
my $outfh;
my $index = 1;
while(my $line = <$fh>){
my $inter_line = decode("cp932", $line);
unless($length < $size){
my $base = basename($file);
my $filename = substr($base, 0, index($base, "."));
my $newfile = $filename."_$index.txt";
open($outfh, ">", $newfile) or die " file can't open. $newfile";
$index++;
$length = 0;
}
print $outfh encode("cp932", $inter_line);
$length = $length + length($line);
}*

2トリップテスト ◆t1d/hgbBkI:2013/07/06(土) 02:17:28
トリップテスト

3トリップテスト ◆Fe/d94y9bo:2013/07/06(土) 18:26:11
トリップテスト

4トリップテスト ◆qjrZspsawk:2013/10/11(金) 22:33:28
トリップテスト

5 ◆a.Yom/cuno:2014/01/04(土) 21:55:27
てすと


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板