October 12, 2004

Listing of core modules per Perl release?

I could have sworn I saw a reference to a document or set of documents listing the modules packaged with each Perl release, but I cannot find it. Anybody remember this? (I could instead be remembering that people were talking about creating such a document...)

Why do I need such a thing? In the recent Workflow release I added functionality to create inline conditions. So instead of determining whether you can access an action within a state by executing a known method on an object:

# in workflow.xml
<workflow>...
    <state name="foo">...
        <action name="bar">...
            <condition name="checkTime" />
        </action>
    </state>
</workflow>
  
# in condition.xml
<conditions>
    <condition name="checkTime" class="MyApp::Condition::CheckTime" />
</conditions>

You can now inline the condition using Perl:

# in workflow.xml
<workflow>...
    <state name="foo">...
        <action name="bar">...
            <condition test="$context->{time} < time" />
        </action>
    </state>
</workflow>
 
# nothing needed in condition.xml! 

Useful. But I didn't want to expose a gaping security hole by using string eval to execute what's in 'test'. (Don't know why that's bad? I could set 'test' to "system( 'rm -rf /' )"...) So I looked into Safe. It seemed to work pretty well, although passing a workflow or context object into the safe compartment was a headache so I just normalized everything to a hashref.

From the online docs you can tell that Safe is packaged with Perl. But how far back did that go? I didn't want to leave out users of 5.6.x unless absolutely necessary. So after googling around a while I couldn't find a resource with all the modules listed per release, so I just went to the source, grabbed 5.004 and unpacked it. Sure enough, there's ext/Opcode/Safe.pm -- if it's in 5.004, that's good enough for me.

Next: Undercover in the Florida GOP
Previous: Cheap SSL: registerfly