Ok, So I'm trying to run the following code but it says "Permission Denied" . Any idea why is that?
I personally believe that is sounds like a permission problem. I think it depends on you not having the permission to read some particular file. It's your business, and having nothing to do with the code.
For my understanding, what it does is printing the file with line numbers, then activating "process_para" if matching empty line. It seems to me like the subroutine is processing only one line, isn't it?
I personally believe that your understading is severely flawed. The program does nothing like "printing the file with line numbers" but it has a commented out line which would print the file with the nesting level of parens prepended to lines. It also does nothing like "activating" (whatever that may mean) process_para() is matching an empty line: it calls it on what you call a "paragraph" if the indenting level becomes null, which is the means it adopts to slurp in a "paragraph." What do you think that the
$buf .= $_;
line does?