On Fri, Sep 26, 2008 at 2:26 PM, Manasi Bopardikar <
[EMAIL PROTECTED]> wrote:

> Hi,
>
>   Just wanted to show you a small piece of code I have written.Are there
> any apparent issues here?
>
>
>
> package TWiki::Plugins::DumbPlugin;
>
> use strict;
>
> use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $debug $pluginName
> $NO_PREFS_IN_TOPIC );
>
> $VERSION = '0.1';
>
> $RELEASE = '0.1';
>
> $SHORTDESCRIPTION = 'Dumb plugin that does nothing at all';
>
> $NO_PREFS_IN_TOPIC = 0;
>
> $pluginName = 'DumbPlugin';
>
>
>
> sub initPlugin {
>
>    my( $topic, $web, $user, $installWeb ) = @_;
>
> TWiki::Func::registerTagHandler( 'HELLOWORLD', \&_HELLOWORLD );
>
> TWiki::Func::registerTagHandler( 'HELLOSOMEONE', \&_HELLOSOMEONE );
>
>
>
>
>
>    return 1;
>
> }
>
>
>
> sub _HELLOWORLD{
>
> my($session, $params, $theTopic, $theWeb) = @_;
>
>
>
> return("Hello World");
>
> }
>
>
>
> sub _HELLOSOMEONE {
>
>    my($session, $params, $theTopic, $theWeb) = @_;
>
>
>
>    my $defaulttext = $params->{_DEFAULT} || '';
>
>    my $someoneelse = $params->{someoneelse} || '';
>
>    my $yetanother = $params->{yetanother} || '';
>
>    my $text = '';
>
>    $text .= " $defaulttext" if $defaulttext;
>
>    $text .= " and" if ($text && $someoneelse);
>
>    $text .= " $someoneelse" if $someoneelse;
>
>    $text .= " and" if ($text && $yetanother );
>
>    $text .= " $yetanother" if $yetanother;
>
>    $text = "Hello" . $text;
>
>
>
>    return $text;
>
>
>
> }
>
>
>
>
>
>
>
> Thanks  and Regards,
>
> Manasi Bopardikar|s/w Engineer|Persistent SystemsLtd
>
> (+91)(020)(30234497)|9371059891
>
> [EMAIL PROTECTED]
>
>
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Ltd. It is intended only for the use of
> the individual or entity to which it is addressed. If you are not the
> intended recipient, you are not authorized to read, retain, copy, print,
> distribute or use this message. If you have received this communication in
> error, please notify the sender and delete all copies of this message.
> Persistent Systems Ltd. does not accept any liability for virus infected
> mails.
>

Yes,

The last line in a perl module should be "1;"

Regards,
Amit Saxena

Reply via email to