•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 429,990 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,418 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 736 | Replies: 3 | Solved
![]() |
•
•
Join Date: Jun 2008
Posts: 74
Reputation:
Rep Power: 1
Solved Threads: 7
Hi,
I try to compare items in two different arrays. This loop works well in another program of mine. But not in the current program i'm working on. Weird....
The output of the program shows
I try to compare items in two different arrays. This loop works well in another program of mine. But not in the current program i'm working on. Weird....
The output of the program shows
Nested quantifiers in regex; marked by <-- HERE........
PERL Syntax (Toggle Plain Text)
for $3 (@obsolete_class_declare) { for $4 (@classB) { if ($4 =~ /$3/i) #This line causing problem { print "$4\n"; last; } } }
You should not use numbered scalar variables in your perl programs, $1 and $2 and etc are used internally by perl for pattern memory and are read only. If you have meta characters in your array elements just use the \Q option to escape them:
$foo =~ /\Q$bar/;
stuff like ** will be interpreted literally, but $ and @ will still be treated like a variable and interpolated.
$foo =~ /\Q$bar/;
stuff like ** will be interpreted literally, but $ and @ will still be treated like a variable and interpolated.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Parallel Array Help (C++)
- Array Sorting on a User Supplied Element (Java)
- Need help tweaking my program (Java)
- Comparing arrays (C++)
Other Threads in the Perl Forum
- Previous Thread: Regex A-Z, a-z, 0-9, spaces, _s
- Next Thread: Crypt::Blowfish / Crypt::CBC


Linear Mode