Re: Perl match problem
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 22:54:53 GMT
yezi wrote:
> If I want to find the text wheather match the RD[$j] $j is the any
> number
> between -25 to 25, can I write the following sentence :
> for ($j=-25;$j<=25;$j++)
This is better written as
for (-25..25) {
> if($parts[0] =~ /RD[$j]/)
Yuk! Why the loop?
(untested, just to give you an idea):
if (/RD(\d*)/) and $1 >= -25 and $1 <= 25) ....
jue
.
- Follow-Ups:
- Re: Perl match problem
- From: John Bokma
- Re: Perl match problem
- References:
- Perl match problem
- From: yezi
- Perl match problem
- Prev by Date: Perl match problem
- Next by Date: Re: DBI prepare and fetch
- Previous by thread: Perl match problem
- Next by thread: Re: Perl match problem
- Index(es):
Relevant Pages
|
|