The 2001 Perl Advent Calendar
[about] | [archives] | [contact] | [home]

On the 23rd day of Advent my True Language brought to me..
Inline::Files

We've all played with the DATA filehandle right? It enables you to put data at the end of your code so that you can easily get hold of it, remember? Wherever your code goes, the data is sure to follow.

Using DATA is great, until you suddenly find when you're updating some code that your co-worker is darn well already using it already. Now the changes you were going to make aren't possible anymore without clobbering his section or rewriting the code so DATA is parsed and you each get the right bit back! How tedious. What we really need is a module that would allow you to have multiple filehandles right there in the code and allow you to use any of them. Wouldn't that be nice?

  • Inline