[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  problem with Perlscript_version plugin
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

problem with Perlscript_version plugin

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


Posted by Norbert   USA  (61 posts)  [Biography] 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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,674 posts)  [Biography] 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
[Go to top] top

Posted by Norbert   USA  (61 posts)  [Biography] 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.
[Go to top] 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.


4,294 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]