You are here: Technology, Web & Business Forum
: Web Development
: Programming
:
perl programming???
|
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 |
|
|||
|
|||
while (<IN2>)
{ if ($_ =~ /xml version/) { print $Count++, " ", $_; print OUT $_; } else { exit } I have this above program where the $_ searh for the "xml version". But I wanted it to change and look for <?xml version="1.0" the problem is it gives out an error when searching for <?xml version="1.0". Please help???
__________________
Powered by Yahoo! Answers |
|
|||
|
|||
the question mark is a reserved wildcard repetition signal for regular expressions. Right now it is telling to look for either 0 or 1 of the less than (<) symbol, then look for xml... it doesnt look for the question mark. you need to escape it. Perhaps you will need to escape the quotation marks as well? I'm not sure off the top of my head if it will give you an error as well. Start with the question mark for sure:
($_ =~ /<\?xml version="1.0"/)
__________________
Powered by Yahoo! Answers |



Linear Mode
