> Please help me on the following code. The code is supposed to receive to
> words "cool" and "cash" plus a number from 0 to 10, with optional spaces
> between the words.

Well, is the program argument quoted then? Like
./your_program "arg1 still arg1"
Or is it actually that cash is in $ARGV[2] and your number in $ARGV[3]?

Always use warnings;
and use strict;

Missing opening ' in this line:
>  $vote = cool cash 1';

Why are you escaping the c of cash here ???
> if (($msg =~ /cool\s\cash\s*1/i) && ($msg !~ /cool\s\cash\s*1\d/i))

Try:
if ($msg =~ /cool\s+cash\s+(\d+)/i) {
  $number = $1;
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to