Results 1 to 3 of 3

Thread: Perl Scripting

Hybrid View

  1. #1
    Mentor
    Join Date
    Jul 2001
    Posts
    1,666

    Perl Scripting

    I'm running an OpenDC Hub and am currently making a bot for it. The bot is programmed in perl and I'm trying to take a second argument from one of the commands, ie when I run the command
    +kick user
    then user will be passed as a variable. This is what I have

    if($data =~ /\+kick/)

    $data is the actual message that is sent to the chat, and basically I have no idea what it does. I pretty much just copied and pasted this from another bot.
    So is there a way I can add something after kick that will be passed as an argument?
    Cheers
    CP

  2. #2

    Re:Perl Scripting

    if ($data =~ /+kick (.*)/)

    that will check if it matches kick<space>something and set $1 to something

  3. #3
    Mentor
    Join Date
    Jul 2001
    Posts
    1,666

    Re:Perl Scripting

    Thanks for that, but that doesn't seem to work. I tried that command, and it just take +kick and then anything. It wont set whatever is after the space to $1.
    Cheers
    CP

Similar Threads

  1. Newbie looking for scripting help.
    By evilspoon in forum Programming
    Replies: 3
    Last Post: 10-04-2007, 04:14 PM
  2. GUI Scripting
    By friskydrifter in forum Programming
    Replies: 3
    Last Post: 03-07-2006, 12:08 AM
  3. perl question from a perl newb
    By tolstoy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-06-2002, 01:16 AM
  4. Scripting question
    By kenshi in forum Programming
    Replies: 19
    Last Post: 05-30-2002, 08:40 AM
  5. Bash Scripting
    By cuban in forum Programming
    Replies: 3
    Last Post: 09-10-2001, 01:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •