You are here: Technology, Web & Business Forum
: Web Development
: Programming
:
perl-reading from a file & matching?
|
Welcome to the Technology, Web & Business Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Programming Discuss programming languages such as .NET, PHP, PERL, ASP, ColdFusion, C++
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
|||
Hello all
i have this peace of code open(RULES,'rules.txt') or die $!; my @rules = <RULES>; close RULES or die $!; foreach my $rule(@rules) { if ($request =~ m/$rule/i) { open(ERROR,"error.html"); my @error=<ERROR>; close(ERROR); foreach $line(@error){ print C $line; } it match a text from a file or 'rules' written by regular expressions with a request but the problem that it's matching only the first line i mean my rules file content \.txt that will match any .txt extension but when i add nother line like \.txt \.php it matchs only .txt please i really need help
__________________
Powered by Yahoo! Answers |



Linear Mode
