Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 2
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2008, 08:02 AM
ArnArn ArnArn is offline
Member
 
Join Date: May 2008
Posts: 30
Default

perl programming???


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???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-10-2008, 08:03 AM
Eric V Eric V is offline
Junior Member
 
Join Date: May 2008
Posts: 9
Default

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"/)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl ....how to write it correctly with Perl ?!? viki k Perl 0 05-06-2008 04:40 PM
Perl Programming? espanolstudent Perl 1 05-06-2008 01:46 PM
Delphi programming help? duffman Delphi & Kylix 0 05-06-2008 01:44 PM
Delphi programming help? duffman Delphi & Kylix 0 05-06-2008 10:15 AM
Perl programming??? ArnArn Perl 0 05-06-2008 09:32 AM

Your Ad Here

All times are GMT. The time now is 10:08 PM.