Here are two sites with sample code in dozens of programming languages.
PLEAC (Programming Language Examples Alike Cookbook) takes the Perl Cookbook as its template and implements the examples in 25 languages. Some languages are more complete than others. For example, Python is about 85% complete while Erlang is down at 2%.
Rosetta Code is a Wiki with sample code in 86 languages. As with PLEAC, some languages are better represented than others. The site lets you search by task or by language.


{ 0 comments… add one now }