in reply to Re: Re: Re: Regular Expression Question
in thread What happens with empty $1 in regular expressions? (was: Regular Expression Question)

I see, I misunderstood your question. My apologies.

One of the main reasons these practices are unsafe is that they often occur by accident.

Here are some quick examples of mistakes that will cause errors with strict:

my $variable = 7; print $varaible; # typo # error from strict 'vars' my $hash = { name => 'value' }; my $key = 'name'; print $key->{'name'} # derefenced wrong variable # error from strict 'refs' sub subroutine { } print subrotine; # typo # errors from strict 'subs'
Using strict also encourages good coding practices such as controlling the scope of your variables (strict 'vars') and using hard references instead of soft references (strict 'refs').