Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Setting Conditional Variable Based on Partial Matchby ccn (Vicar) |
on Dec 19, 2008 at 19:41 UTC ( [id://731643]=note: print w/replies, xml ) | Need Help?? |
First of all: use use strict; and use warnings;. That will save a lot of time for you. It will be good to put backslash before * in regexp if you want to match an asterisk. (see perldoc perlre about metacharacters) Yes $type must be declared outside of condition block. But rather before if clause than after it. And seems you want to use = instead of eq when assigning a value to $type
In Section
Seekers of Perl Wisdom
|
|