Monday, May 24, 2010

How do you initiate variables in Perl? Specifically TripodMail.pm?

Perl does not require you to initialize or predeclare variables. In most cases, experienced Perl programmers will use the 'strict' pragma which forces declaring variables, usually using the 'my' keyword. So, to declare and initialize a variable:


my $var = 1;


With TripodMail.pm, I assume that you want to instantiate an object?


In this case:


my $mailer = new TripodMail;


Then you use your TripodMail object to access the member functions, something like this:


$mailer-%26gt;sendmail(args);


No comments:

Post a Comment