Perl Reg Exp "=~ s/\A" Explain - TechRepublic
General discussion
January 6, 2002 at 07:33 AM
craig_carman

Perl Reg Exp “=~ s/\A” Explain

by craig_carman . Updated 22 years, 10 months ago

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?

This discussion is locked

All Comments