in reply to simple regex question

If you're really parsing query strings and you don't have some bizarre format requirement for it, you shouldn't do it that way. It's harder than it looks from the start and there are many gotchas. A few modules do query string parsing for you, including CGI, but my favorite lately is URI::QueryParam.

use URI; use URI::QueryParam; # extends functionality of URI my $uri = URI->new('https://what.who/form.pl?password=foo&user=bar'); print $uri->query_param('password'), $/;