Your First PerlNET Program

As a first step in PerlNET programming, we write a simple program to introduce you to the basics of the new language. Our program outputs a single line of text. Here is the code for the first sample.

#
# Hello.pl
#
use namespace "System";
use PerlNET qw(AUTOCALL);

Console->WriteLine("Hello from Perl!");

The above code is saved in the Hello folder for this chapter. Optionally, you can just type the program in your favorite editor. If you are using Visual Perl (see Appendix A), you can open the solution Hello.sln. If you are not using Visual Perl, just ignore the solution and project files.

It is commonly known that Perl is a script language and as such is processed by Perl interpreter. So, the first reaction (“Perl ...

Get Programming PERL in the .NET Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.