These lines are used to begin a sub for parsing form data by prepping this env var for confirmation. I understan line one.
$S = lc $ENV{HTTP_REFERER};
$S =~ s/\A.*\/\///;
$S =~ s/\Awww\.//;
$S =~ s/\A(.*?)(\/.*)/$1/;
Will someone explain to me or even comment the lines to help me understand the significance of these substitutions in line 2 thru 4?