But I Never Even Learned How To Read
Sample Run - No file specified
Code:
my $hash = HashFromFile->make(filename => '');
Log output:
[2003/07/22 13:14:39] +[undef]+ ||[undef]||
HashFromFile:17 - 771 - INFO -
Entering make()
[2003/07/22 13:14:39] +[undef]+ ||[undef]||
HashFromFile:26 - 771 - FATAL -
Exiting because no file was specified
Sample Run - Bad file specified
Code:
my $hash = HashFromFile->make(filename => 'fake_file.txt');
Log output:
[2003/07/22 13:16:02] +[undef]+ ||[undef]||
HashFromFile:17 - 824 - INFO -
Entering make()
[2003/07/22 13:16:02] +[undef]+ ||[undef]||
HashFromFile:22 - 824 - DEBUG -
Using file: 'fake_file.txt' as data source
[2003/07/22 13:16:02] +[undef]+ ||[undef]||
HashFromFile:33 - 824 - FATAL -
Could not open file 'fake_file.txt': No such file or directory
Sample Run - Good
Code:
my $file = "$ENV{HOME}/bin/text.txt";
my $hash = HashFromFile->make(filename => $file);
Log output:
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:17 - 834 - INFO -
Entering make()
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:22 - 834 - DEBUG -
Using file: '/home/tech/bschmaus/bin/text.txt' as data source
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:44 - 834 - DEBUG -
Current line has data: Language:Perl
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:57 - 834 - DEBUG -
Adding new entry to hash, key: Language - value: Perl
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:40 - 834 - DEBUG -
Current line was empty, skipping to next line
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:44 - 834 - DEBUG -
Current line has data: Web Server:Apache
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:57 - 834 - DEBUG -
Adding new entry to hash, key: Web Server - value: Apache
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:40 - 834 - DEBUG -
Current line was empty, skipping to next line
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:40 - 834 - DEBUG -
Current line was empty, skipping to next line
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:40 - 834 - DEBUG -
Current line was empty, skipping to next line
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:44 - 834 - DEBUG -
Current line has data: Markup:XHTML
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:57 - 834 - DEBUG -
Adding new entry to hash, key: Markup - value: XHTML
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:40 - 834 - DEBUG -
Current line was empty, skipping to next line
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:64 - 834 - DEBUG -
Hash before return is: $VAR1 = {
'Web Server' => 'Apache',
'Language' => 'Perl',
'Markup' => 'XHTML'
};
[2003/07/22 13:18:04] +[undef]+ ||[undef]||
HashFromFile:65 - 834 - INFO -
Exiting make()
Sample Run - Log level set to INFO
Code:
my $file = "$ENV{HOME}/bin/text.txt";
my $hash = HashFromFile->make(filename => $file);
Log output:
[2003/07/22 13:19:37] +[undef]+ ||[undef]||
HashFromFile:17 - 936 - INFO -
Entering make()
[2003/07/22 13:19:37] +[undef]+ ||[undef]||
HashFromFile:65 - 936 - INFO -
Exiting make()