Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: <p>string variable</p>

by hdb (Prior)
on Jul 24, 2013 at 10:45 UTC ( #1046065=note: print w/ replies, xml ) Need Help??


in reply to <p>string variable</p>

I am not sure about the wisdom of your undertaking but this is how you could be doing it (if I understand the question correctly...):

use strict; use warnings; my @array = ('A1', 'A2', 'A3', \$1, '$2'); my $message = 'If you choose a yellow car everyone will follow you!'; my $my_trigger = 'If you (.*) a (.*) car (.*) will follow you!'; if ($message =~ m/$my_trigger/g) { my $option = ${$array[3]}; my $color = $2; my $whom = $3; print "option: " . $option; print "\ncolor: " . $color; print "\nwhom: " . $whom; }


Comment on Re: <p>string variable</p>
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-09-16 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (156 votes), past polls