Results 1 to 3 of 3

Thread: Perl Scripting

  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. How to compile Perl
    By tech291083 in forum Redhat / Fedora
    Replies: 3
    Last Post: 06-09-2007, 01:46 PM
  2. Perl module problem
    By Outlaw in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 05-04-2005, 02:17 PM
  3. PHP & Perl??
    By SwampDonkey in forum Linux - Software, Applications & Programming
    Replies: 8
    Last Post: 07-25-2004, 04:12 PM
  4. PERL Problems
    By marce_sadico in forum Redhat / Fedora
    Replies: 0
    Last Post: 08-26-2002, 05:23 PM
  5. Perl escaping - help needed
    By andrzej in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 05-10-2002, 01:21 PM

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
  •