- or download this
sub getvalue {
my $line = shift; # get the argument
my $start = index($line, ':');
return substr($line, $start+2, length($line));
}
- or download this
print getvalue($PasswordLine);
print getvalue($MinattLine);
print getvalue($MaxattLine);
print getvalue($ExpLine);
print getvalue($GoldLine);
- or download this
while ( my $line = <FILE> ) {
...
}
close FILE;
- or download this
chomp $line;
my ($key, $value) = split(/\s*:\s*/, $line);
- or download this
$data{$key} = $value;
- or download this
print $data{password};
print $data{minatt};
print $data{maxatt};
print $data{exp};
print $data{gold};
- or download this
#!/usr/local/bin/perl -w
...
print $data{maxatt};
print $data{exp};
print $data{gold};