Chapter 5-6 Flashcards

1
Q

first line of the file

A

!/bin/perl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

first line of the file

A

!/bin/perl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

open BEDROCK, ‘>’, ‘myfile.txt’;
print BEDROCK “Hello”;
close BEDROCK;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hash =

A

a data structure that, like an array,can hold any number of values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

difference from arrays and hashes

A

There’s no fixed order.
There’s no first element.
It’s all key-value pairs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Hash Sample

A
$family_name{'fred'} = 'flintstone';
$hash{$some_key}= 'value';
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

building hashes (%)

A

%hash = (‘eleA’,’item1’,’eleB’,’item2’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A

open BEDROCK, ‘>’, ‘myfile.txt’;
print BEDROCK “Hello”;
close BEDROCK;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Hash =

A

a data structure that, like an array,can hold any number of values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

difference from arrays and hashes

A

There’s no fixed order.
There’s no first element.
It’s all key-value pairs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Hash Sample

A
$family_name{'fred'} = 'flintstone';
$hash{$some_key}= 'value';
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

building hashes (%)

A

%hash = (‘eleA’,’item1’,’eleB’,’item2’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly