<commit_before>Tutorial
--------

### Assigning Values to Hash Pairs

Perl hash variables store a set of key/values pairs. The hash variable name begins with the at symbol `%`. To refer to a single pair of a hash, the variable name must start with a `$` followed by the "key" of the pair in curly brackets `{}`. the index of the first array element is 0.

	%names_and_ages = ('John', 25, 'Mary', 45, 'Tom', 12);
        $age_mary = $names_and_ages{'Mary'};
        print "$age_mary\n";                  # 45
        $my_key = "Tom";
        $age_tom = $names_and_ages{$my_key};
        print "$age_tom\n";                   # 12
        print "$names_and_ages{'John'}\n";    # 25

Values to hash pairs can be created by using a list as shown above, where the first element of the pair is used as the key and the second element is used as the value and so forth. For claritym the
"=>" string can be used as an alias to specify the pairs. For example:

	%names_and_ages = ('John' => 25, 'Mary' => 45, 'Tom' => 12);

Another method for assigning a value to a named key, one by one, is via a direct assignment:

	$names_and_ages{'Brad'} = 49;
	$names_and_ages{'Angelina'} = 48;

### Extracting Keys and Values from a Hash variable

The list of all the keys from a hash is provided by the 'keys' function, in the syntax: keys %hashname
The list of all the values from a hash is provided by the 'values' function, in the syntax: values %hashname
Both the 'keys' and 'values' function return an array variable.

For example:

	%names_and_ages = ('John' => 25, 'Mary' => 45, 'Tom' => 12);
	@names = keys %names_and_ages;
	@ages = values %names_and_ages;
	print "Names are @names\n";<commit_msg>Another quick few I missed last time<commit_after>Tutorial
--------

### Assigning Values to Hash Pairs

Perl hash variables store a set of key/values pairs. The hash variable name begins with the at symbol `%`. To refer to a single pair of a hash, the variable name must start with a `$` followed by the "key" of the pair in curly brackets `{}`. the index of the first array element is 0.

	%names_and_ages = ('John', 25, 'Mary', 45, 'Tom', 12);
        $age_mary = $names_and_ages{'Mary'};
        print "$age_mary\n";                  # 45
        $my_key = "Tom";
        $age_tom = $names_and_ages{$my_key};
        print "$age_tom\n";                   # 12
        print "$names_and_ages{'John'}\n";    # 25

Values to hash pairs can be created by using a list as shown above, where the first element of the pair is used as the key and the second element is used as the value and so forth. For clarity, the
`=>` string can be used as an alias to specify the pairs. For example:

	%names_and_ages = ('John' => 25, 'Mary' => 45, 'Tom' => 12);

Another method for assigning a value to a named key, one by one, is via a direct assignment:

	$names_and_ages{'Brad'} = 49;
	$names_and_ages{'Angelina'} = 48;

### Extracting Keys and Values from a Hash variable

The list of all the keys from a hash is provided by the `keys` function, in the syntax: `keys %hashname`
The list of all the values from a hash is provided by the `values` function, in the syntax: `values %hashname`
Both the `keys` and `values` function return an array variable.

For example:

	%names_and_ages = ('John' => 25, 'Mary' => 45, 'Tom' => 12);
	@names = keys %names_and_ages;
	@ages = values %names_and_ages;
	print "Names are @names\n";
{'fraction_non_alphanumeric': 0.11032656663724624, 'fraction_numerical': 0.01706384230656075, 'mean_word_length': 3.3092522179974653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5510363', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1016, 'n_words': 487}