Skip to Content
Programming PERL in the .NET Environment
book

Programming PERL in the .NET Environment

by Yevgeny Menaker, Michael Saltzman, Robert J. Oberg
September 2002
Intermediate to advanced content levelIntermediate to advanced
496 pages
10h
English
Addison-Wesley Professional
Content preview from Programming PERL in the .NET Environment

Main Function

Let's look at a simple program written in C# that performs the same action as our first sample: It displays the single line “Hello from C#.” (If you don't know C#, you can refer to Appendix B, “C# Survival Guide for PerlNET Programmers.”) We saved the program in the HelloCs folder.

// Hello.cs
using System;

class Hello
{
   public static void Main(string[] args)
   {
      Console.WriteLine("Hello from C#");
   }
}

As you can see, we defined a class with a single static method Main, and this is the minimum requirement of each .NET program.

Unlike C# or other .NET-compliant languages, in PerlNET you are not required explicitly to define the Main function and wrap your program by the class, which means that our PerlNET programs may be written ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sams Teach Yourself Perl in 21 Days, Second Edition

Sams Teach Yourself Perl in 21 Days, Second Edition

Laura Lemay, Rafe Colburn
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 0130652067Purchase book