$chosenbeer = param('beers');
$beerprice = `grep "$chosenbeer" beers | gawk '{gsub(/[a-zA-Z\t ]/,"");print $1}'`;
This is the code I'm trying to use, $chosenbeer is the string of a list from a CGI page previously. I'm trying to get the price of the beer selected.
beers ex line:
Dogfish Head 60 Minute IPA 35.96
But for some reason this isn't working. Any idea why? When I print $beerprice nothing comes out.