Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ problem with Perlscript_version plugin

problem with Perlscript_version plugin

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Norbert   USA  (61 posts)  Bio
Date Tue 02 Aug 2005 08:28 PM (UTC)
Message
I'm trying to write a script with Perl and I'm having trouble with getting switch to work. I have ActiveState ActivePerl 5.8 installed, but when I loaded the Perlscript_version plugin trying to troubleshoot and verify which version of Perl I have loaded it says:
PerlScript version = 5.008007

and I can't get PerlScript_Version:help or scriptversion aliases to work

Norbert

-Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens
It's a dumb question... skip it.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Wed 03 Aug 2005 08:35 PM (UTC)

Amended on Wed 03 Aug 2005 09:00 PM (UTC) by Flannel

Message
There actually is no scriptversion alias, I don't know what happened to this plugin, I think it used to work.

Anyway, all of the mushclient calls need a $world-> infront of them. I don't know why the note works upon installation.
Also, the three lines in the script (the ones between the brackets) should have semicolons on the end of them.

You can find the version by using $] you don't need to worry about using this plugin, which doesn't seem to be too effective in anything at the moment.

It would probably be a better thing trying to figure out what's wrong with switch.
Wait, switch? Switch as in, selecting a bunch of case statements? Also known as select/case? Or, some other switch thing all together?

Perl doesn't have one. Use if elsif else groups (and no, there is no second e in elsif). If you need to use the drop through abilities of a switch statement, post your situation, and we'll see if we can't figure something out.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Nick Gammon   Australia  (23,100 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 04 Aug 2005 07:58 AM (UTC)
Message
You are right, those aliases don't seem to work correctly, but the important line:

Note ("PerlScript version = $]")

does indeed report your Perlscript version, which is what the plugin was supposed to do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Norbert   USA  (61 posts)  Bio
Date Reply #3 on Thu 04 Aug 2005 04:44 PM (UTC)
Message
Thanks, I doctored up the plugin and got it to work.

The switch I was trying to use is in the documentation that came with the activeperl, and I checked the lib folder and the switch module is there but I guess the way mushclient uses perl for scripting it isn't able to see the module or something. In the documentation it shows the usage as this:

        use Switch;

        switch ($val) {

                case 1          { print "number 1" }
                case "a"        { print "string a" }
                case [1..10,42] { print "number in list" }
                case (@array)   { print "number in list" }
                case /\w+/      { print "pattern" }
                case qr/\w+/    { print "pattern" }
                case (%hash)    { print "entry in hash" }
                case (\%hash)   { print "entry in hash" }
                case (\&sub)    { print "arg to subroutine" }
                else            { print "previous case not true" }
        }



When I take out the switch the script runs fine. I'm using ActivePerl 5.8.7.813

Norbert

-Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens
It's a dumb question... skip it.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,155 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.