in reply to Re^2: Improve My Code...
in thread Improve My Code...

Does it have something to do with scalar vs list data?

Indeed it does. In scalar context (my $var =) a match regex returns true or false. In list context (my ($var) =) a match regex returns the list of captures. You are interested in just the contents of the first capture so:

my ($var) = $page =~ /...(...).../;

is the appropriate syntax.

Update: provide complete code line to illustrate appropriate list context usage.


True laziness is hard work