How do I pass a variable into a URL in a Perl script? I am trying to pass the variables in an array to url. For some reason it is not working. I am not sure what I am doing wrong. The code roughly looks like this:
@coins = qw(Quarter Dime Nickel);
foreach (@coins) {
my $req = HTTP::Request->new(POST =>'https://url/$coins.com');
}
This does not work as $coins
does not switch to Quarter,Dime,Nickel respectively.
What am I doing wrong?