
per'l'over
Novice
Aug 28, 2008, 3:08 AM
Post #1 of 1
(1080 views)
|
|
Reading a part of blcok in a file
|
Can't Post
|
|
I am new to perl.I have to read a .txt file which appears like the below format always @ ( posedge of clk or negedge of clk both edge of clk) I have to read the above code.ie we have to read the file which starts with always and ends with ")"character and have to print <code> open ($file,"file.txt"); while (<$file>) { if($_=~/^\s*always (.*) ) { print $_; if($_!~/\)\s*$){ next; //here i am getting confused on how to go to next line } <\code> This is i tried sofar.Ifyou would help me i am so glad to you thanks Ravindra
(This post was edited by per'l'over on Aug 28, 2008, 3:30 AM)
|