5

Perl: Printing null hash values as a " "?

view full story
linux-howto

http://www.unix.com – I'm filling in a table of values for grades. I decided to go with reading into a hash from the files but I'm coming up with an error when printing a value that does not exist. I need to know if I can on-the-fly print a space (" ") or blank in place of the grade. Here's what the output should look like: Here is my error (expected) from the missing value from file (and therefore missing hash value): Is there any way to print a blank for the missing hash value while printing to output? Code: foreach ( sort { lc($a) cmp lc($b) } (keys(%nameToID)) ) {         (HowTos)