http://qs1969.pair.com?node_id=224254


in reply to Re: Slurp
in thread Slurp

I thought about this for a while.

There are definitely good reasons for beginners to be exposed the idiom in question and all of its facets. It is a noble idea to do something to increase awareness with whichever approach seems appropriate. However, I believe writing a module is ineffective in this case.

A beginner will benefit greatly for reading and understanding all the various details which comprise this idiom. However, that implies reading the code you used, not dropping a blackbox tnto one's code.

For the latter purpose, File::Slurp fits the bill perfectly.

For the former purpose, a detailed tutorial that explains the nooks and crannies seems to be the way to go. I don't think making it available as a module will achieve any increase in awareness - beginners more so than anyone else tend to not even take a cursory look into the guts of modules.

Note also that as discussed in the node Juerd referenced, the snippet as is is broken. And understanding why that is, actually, will benefit a beginner even more. There are dozens of lessons to be had in this snippet. But one has to read it and have it explained to learn them.

Makeshifts last the longest.