Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2016-02-14 14:11 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (470 votes), past polls