Help for this page

Select Code to Download


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