I want to read, edit, and add to a .txt file in a format like this:
------------
user_name1 : balance1, age1
user_name2: balance2, age2
etc.
------------
I can split this process into two hashes,
user_name : balance
user_name : age
but that would double the amount of work.
Do you know what I have to change to have Tie::File::AsHash convert each line in the txt file into key : value1 value2?
Also, for extra credit, what command would I use to add a new set to this hash with 0 account and 0 age?
$accounts{$username} = (0,0) ?
I don't want to read through perldoc perllol etc because this is the only question I will have about Perl and then I'm done with it.
------------
user_name1 : balance1, age1
user_name2: balance2, age2
etc.
------------
I can split this process into two hashes,
user_name : balance
user_name : age
but that would double the amount of work.
Do you know what I have to change to have Tie::File::AsHash convert each line in the txt file into key : value1 value2?
Also, for extra credit, what command would I use to add a new set to this hash with 0 account and 0 age?
$accounts{$username} = (0,0) ?
I don't want to read through perldoc perllol etc because this is the only question I will have about Perl and then I'm done with it.