Perlについての質問箱 53箱目
■ このスレッドは過去ログ倉庫に格納されています
0357デフォルトの名無しさん
2012/07/23(月) 22:41:42.95ほげ
^D
% cat > hoge.pl
#!/usr/bin/env perl
use strict;
use warnings ;
#use utf8
my %h ;
while(<>){ chomp ; $h{$_} = 42 ; }
print $h{'ほげ'} . qq{\n} ;
^D
% perl hoge.pl hoge.txt
42
% perl -i -pe 's/#use/use/ ' hoge.pl
% perl hoge.pl hoge.txt
Use of uninitialized value $h{"\343\201\273\343\201\222"} in concatenation (.) or string at hoge.pl line 7, <> line 1.
%
■ このスレッドは過去ログ倉庫に格納されています