Chapter 5-6 Flashcards
first line of the file
!/bin/perl
first line of the file
!/bin/perl
open BEDROCK, ‘>’, ‘myfile.txt’;
print BEDROCK “Hello”;
close BEDROCK;
Hash =
a data structure that, like an array,can hold any number of values.
difference from arrays and hashes
There’s no fixed order.
There’s no first element.
It’s all key-value pairs.
Hash Sample
$family_name{'fred'} = 'flintstone'; $hash{$some_key}= 'value';
building hashes (%)
%hash = (‘eleA’,’item1’,’eleB’,’item2’);
open BEDROCK, ‘>’, ‘myfile.txt’;
print BEDROCK “Hello”;
close BEDROCK;
Hash =
a data structure that, like an array,can hold any number of values.
difference from arrays and hashes
There’s no fixed order.
There’s no first element.
It’s all key-value pairs.
Hash Sample
$family_name{'fred'} = 'flintstone'; $hash{$some_key}= 'value';
building hashes (%)
%hash = (‘eleA’,’item1’,’eleB’,’item2’);