0540nobodyさん
04/10/08 20:39:40ID:HUGW4EIRというようなデータが数行あるような場合
それらを読んできて切り分けるって処理を
してます。
これの評価お願いします。
sub split_data{
my @ref,@tmp,%hush;
@tmp = @_;
for (@tmp){
chomp;
($hush{title},$hush{time},$hush{contents}) = split /::/;
push (@ref,{%hush});
}
return(@ref);
}
@tmp = ("a::b::c\n","d::e::f\n","g::h::i\n");
@ref = split_data(@tmp)
for(0..$#ref){
print "title:".$ref[$_]->{title};
print " time:".$ref[$_]->{time};
print " contents:".$ref[$_]->{contents}."\n";
}