CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
sub main

 



hujirong
Novice

Dec 5, 2009, 12:19 PM

Post #1 of 2 (218 views)
sub main Can't Post

How sub main {} works in Perl? Is that as normal sub or it's called directly like main() in C?

Thanks
Jirong


shawnhcorey
Enthusiast


Dec 6, 2009, 1:29 PM

Post #2 of 2 (210 views)
Re: [hujirong] sub main [In reply to] Can't Post

It's just another sub. Perl executes any statement that's not in a file.

Code
#!/usr/bin/perl 

use strict;
use warnings;

print "Hello, world\n";


__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives