Use a Regular expression:
my ($captured_string) = $link =~ /\&make=(\w+)\&/;
My regex assumes that you would want to capture anything that appeared in the make field. \w
captures upper and lower case letters. If you want to capture something else you can use a character class. Like this [\w\s]+
would match more than one letters and spaces. You can add anything between the [ ]
of characters to match in any order.
The ( )
is what actually does the capturing. If you remove that then it will just match (and you should use it in an if statement. If you wanted capture more than one string (say you wanted the model as well. Based on your example you could use a second set of parenthesis like this:
my ($make, $model) = $link =~ /\&make=(\w+)\&model=([A-Za-z0-9]+)/;
Hope that helps!