Perl language did you know, the concept of Perl in here to make a brief introduction, Perl, Perl class method is merely a Perl subroutine, also known as a member function.


Perl method subnameLister { 
my $this=shift;  
my ($keys, $value);  
the while (($key, $value)=each $this (%)) { 
print "\ t $keyis $value. \ n";  
}  
}  

#! The/usr/bin/perl 
useCocoa;  
$cup=newCocoa;  
$cup - >SetImports (' Java. IO. InputStream ', 'java.net. *');  
$cup - >DeclareMain (" Msg ", "the Java applet, the applet", "Runnable");  
$cup - >CloseMain ();  

the script creates a Javaapplet, called Msg. It extended (extend) the Java applet. The applet small application and can run (runnable), where the last three lines can also be written as follows:  
the Cocoa: : setImports ($cup, 'Java. IO. InputStream', 'java.net. *');  
the Cocoa: : declareMain ($cup, "Msg", ". The Java applet. The applet, "" Runnable");  
the Cocoa: : closeMain ($cup);  
the running result is as follows:  
/*  
* * CreatedbyCocoa. Pm 
* * Useatownrisk 
*/ 
importjava. IO. InputStream;  
importjava.net. *;  

publicclassMsgextendsjava. Applet. AppletimplementsRunnable { 
}  

note: if you use - >Operator call Perl method (also called indirect invocation), must use parentheses parameters, such as: $cup - >SetImports (' Java. IO. InputStream ', 'java.net. *'); And double colon calls such as: Cocoa: : setImports ($cup, 'Java. IO. InputStream', 'java.net. *'); Also can remove the parentheses as: Cocoa: : setImports $cup, 'Java. IO. InputStream', 'java.net. *';


This concludes the body part