>>62 #--- sub logsave{ local *LOG; open LOG, '>>log.dat' or return; flock LOG, 2; print LOG <<EOD; ${\time()}<>$ENV{REMOTE_ADDR}<>$ENV{HTTP_USER_AGENT} EOD close LOG; } #---
$ perlcc -c file # Creates a C file, 'file.c' $ perlcc -c out.c file # Creates a C file, 'out.c' from 'file' $ perlcc -c -e 'print q//' # Creates a C file 'a.out.c'
if( open fp,"$filename" ){ ($mday, $mon, $year ) = split ',',<fp>; close fp; }
if( ($tyear>$year) or ($tmon>$mon) or ($tmday>$mday) ){ print "今日最初のアクセスです(´ー`)\n"; if( open fp,">$filename" ){ print fp "$tmday,$tmon,$tyear"; close fp; } }
>>273 このコードが動きません…。 間違ってはいないですよね…? #!/usr/bin/perl use DB_File; use Fcntl; use strict; use warnings; my @file; my $db = tie @file , DB_File => 'hoge.dat' , O_RDONLY, 0666, $DB_RECNO or die "can't open hoge.dat: $!$^E\n";
#!/usr/bin/perl use DB_File; use Fcntl; use strict; use warnings; my @file; my $db = tie @file , DB_File => 'hoge.dat' , O_RDWR | O_CREAT, 0666, $DB_RECNO or die "can't open hoge.dat: $!$^E\n";
print while <>; ________________________________________
EXECUTING... (while.pl:0) enter (while.pl:0) ENTER scope 2 at pp_hot.c:1535 Entering block 0, type BLOCK => (while.pl:0) nextstate => (while.pl:3) enter (while.pl:3) ENTER scope 3 at pp_hot.c:1535 Entering block 1, type BLOCK => ______________________________________
EXECUTING... (foreach:0) enter (foreach:0) ENTER scope 2 at pp_hot.c:1535 Entering block 0, type BLOCK => (foreach:0) nextstate => ______________________________________