Perl is considerably more complex than HTML, so I wouldn't recommend using an editor to learn it by trial and error, even if such a thing exists.
My suggestion would be to read some books. Some that I found helpful were the O'Reilly books Learning Perl, CGI Programming with Perl and Programming Perl, but other people might have different recommendations.
When running Perl scripts, you should always enable warnings, strict mode and taint mode. That way, the Perl interpreter will provide the maximum feedback about compilation errors.
If you don't care which language you're using, you might prefer starting with PHP or Python. Either of those is probably easier to learn than Perl.