NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Oh, and it becomes thread-safer (Score:1)
Either I didn't think of it at the time of blogging, or I forgot about it, but another nice thing about using contextuals rather than instance attributes is that the class becomes thread-safe. In other words, you can suddenly use the same instance of Yapsi::Compiler to compile two different sources simultaneously. The contextuals will be local to each thread and not interact; instance attributes would have been shared and cause a bit of trouble.
Yapsi::Compiler currently only has one instance attribute: @.warnings -- this is so that one can query the object for warnings after compilation. Maybe we should factor this one out into a result object of some sort, returned from the .compile method. But, meh; YAGNI.
Reply to This