6 Einträge, 1 Seite |
1 2 3 4 5 6 7
my $statsfile = ("$config{username}.dat"); if (-e $statsfile) { system("touch $statsfile && echo 1 > $statsfile"); } open(STATS, '+>', "$statsfile") or die "Error: Couldnt open $statsfile"; my @globatts = <STATS>; my $globalatts = $globatts[0];
1 2 3 4 5 6 7
sub attack { print color("green"), "Attack started...\n", color("reset"), "This Session: ", color("white"), "$sessionatts\n", color("reset"), color ("white"), "Global: $globalatts\n", color("reset"); $sessionatts++; $globalatts++; print STATS $globalatts; [...]
if (-e $statsfile) {
unless (-e $statsfile) {
1
2
3
You can put a '+' in front of the '>' or '<' to indicate that you want both
read and write access to the file; thus '+<' is almost always preferred for
read/write updates--the '+>' mode would clobber the file first.
6 Einträge, 1 Seite |