We have so far seen how matching can be set up but not how it works in practice.
The =~
lets you match against a specified target (rather than an environment variable
$_
. In CGI we frequently need to match against input name/values.
We usually use an if statement to control the match.
$infile = ; # whatever if ( $infile =~ /*.gif/) { # file is gif format file # well at least it ends in a .gif ........ }