tags:

views:

60

answers:

2

Sometimes I see people use http://codepad.org as a way to quickly run/test their Perl snippets (it supports doing that with a wide variety of languages, from C to Scheme to Perl).

It's pretty obvious that there must be some limitations as to what code/features can be tested with codepad - does anyone know what those limitations are for Perl runner?

I'll get the ball rolling on my own observation: not every CPAN module is available :(

+9  A: 

Mostly based on their "about" page:

  • codepad only supports Perl 5.8.0

  • Presumably, like any Perl install, not every module (CPAN or otherwise) is present.

    • As a specific example, List::MoreUtils is missing.

    • As a sub-limitation, they seem to run on Linux. So any Windows specific modules would certainly be out.

    • It's in a chroot jail with system calls restrictions. Among other things this seems to prevent file creation (my snippets creating files in a current directory or /tmp both errored out, as well as File::Temp calls)

  • codepad code is executed on a virtual machine. Behind firewalls. And buried in a bunker. So certain functionality is probably disabled - especially networking/internet one. The exact "about" quote is:

    • The supervisor processes run on virtual machines, which are firewalled such that they are incapable of making outgoing connections.

    • The machines that run the virtual machines are also heavily firewalled, and restored from their source images periodically.

DVK
+2  A: 

It's easier to just run Perl code locally. It's easy to install multiple versions of Perl and to track separate module repositories. It's also not hard to run just about any operating system you want in a virtual machine. Why you'd need anyone's else's service to do what you can do better yourself is beyond me.

brian d foy
@brian - here's one scenaio where it's useful. Say I'm on a PC that's not mine, logged in to check SO, saw a Perl question I like, and want to compile/vet my code before answering. By the time I finish downloading/installing Strawberry Perl, the question will have been already answered :)
DVK
@brian - another one - say you need to run through a quick one-time data/text crunch (again on a PC where you're a guest, with no admin access). Too big/complicated to do in Excel, but small enough that running a 3-minute script on codepad does the job.
DVK
In short, Yes You Can, but No It Is Not Always Worth The Time to Do So :)
DVK
@brian - also, sometimes one is legally prohibited from installing extra software, e.g. on a company-owned laptop. Even if one could install Strwberry on it as on-admin into temp space and ha the time. Stupid policy yet happens often,
DVK