Is this code correct? If so, how do we execute this program and how would we know that this code is doing caching activity?my %cache; sub first_line { my $filename = shift; return $cache{$filename} if exists $cache{$filename} open FILE,$filename or return ""; my $line=<FILE>; $cache{$filename}=$line; return $line; }
janitored by ybiC: Retitle from less-than-descriptive "Hello Monks!!!!" to improve site search results
In reply to Cache Subroutine Return Value by souravdas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |