in reply to checking the end of line
if ($path == 0)
Remember, you said $path was: 'hiec/by/mlor/kkss23/dndd@@mani/css.cpp/0'.
Try something like this:
if($path =~ /(\d+)$/ == 0) {} else {}
Note that what you used never captured the resulting match (that is, it was used in void context and had not side effects). Using the parentheses like I do, it sets the $1 variable (see perlre) -- note, too, that it also returns the value which I check, so you can say something like $my_value = ...regex_here...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: checking the end of line
by I0 (Priest) on Jul 19, 2002 at 23:06 UTC | |
by dimmesdale (Friar) on Jul 19, 2002 at 23:13 UTC | |
by I0 (Priest) on Jul 19, 2002 at 23:35 UTC | |
by dimmesdale (Friar) on Jul 20, 2002 at 14:04 UTC | |
by I0 (Priest) on Jul 20, 2002 at 17:17 UTC | |
|
In Section
Seekers of Perl Wisdom