perl help



Author: anonymous
Date: Thu Sep 21 09:30:32 2006
Subject: perl help



Hi.. 
     I am going through following problem. 
Let me explain you.... 


Hate these ads?


 
 I have to extarct information from the file... 


 
lets file is x.v 


 
   module x; 







 
   pattern:start 
   p1; 
   p2; 
   endpattern 


  
   endmodule 


 
   module y; 


    
   pattern:xxx 
    p3; 
    p4; 
   endpattern 


    
   endmodule 


Amazon Prine


 


    
I am extracting information from the file and creating a hash map. 
I need to store.. 


 
{module name} = pattern content... 


 
here I will be like this 


 
hashmap{x} = p1 p2 
hashmap{y} = p3 p4 


 
How cam I do that.......... 
I am struggling... 


 


 

Comments /Forum/anonymous41.html


Thu Sep 21 09:35:24 2006: Subject:   anonymous
Need a stopping condition...



ex:
module m1;

endmodule

module m2;

endmodule

so like
while<fp_ptr> {

if (/module\s*(\w)\)?.*/) {
my moduleName = $1;
}
parse till encounter endmodule... Then start from the beginning.
This condition I want.

}

The file can contain... n module definition.

Fri Sep 22 13:19:32 2006: Subject:   TonyLawrence
This smells like a course assignment.




There's nothing hard here.. it's pretty basic parsing.

I doubt anyone here is going to do your homework for you. If you provided code you tried to write that didn't work, we MIGHT help you out if you explain it well and aren't just dumping a bunch of junk.

Otherwise, sorry, but no.

Sun Sep 24 04:12:34 2006: Subject:   anonymous
I think I have confused everybody...



Here in short what I want to do...

I want to extract pattern from the file which can come multiple times...

pattern_1 any_thingh

pattern_2:anything /*I want to extract
anything pattern_2 to pattern_3 and store that
anything in a string
pattern_3 */


pattern_4

patten2 - pattern3 can come multiple time inside patten1- pattern2..






Sun Sep 24 11:39:44 2006: Subject:   TonyLawrence
The only confusion is you thinking that people are going to write programs for you for free.



Mon Sep 25 04:43:13 2006: Subject:   anonymous
ok taken!! Thanks anyway....I think I will solve it




Mon Sep 25 16:41:58 2006: Subject:   anonymous
Try the free sample chapter of the book Pro Perl Parsing. It will teach you what you need to know.



http://www.apress.com/book/bookDisplay.html?bID=432

Add your comments

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner

cartoon
Forget the expense of flying to New England. Forget hotel and meals costs.
Installation and light training Boston and New England


Views for this page
Today This Week This Month This Year  Overall
1115361 3,808

/Forum/anonymous41.html copyright September 2006 anonymous All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - Forum




Unix/Linux Consultants

Your ad here - $24.00 yearly!

http://www.vss3.com SCO/Caldera OpenServer, Unixware & Linux. Tarantella & Non-stop Clustering


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting


http://bcstechnology.net Full service Linux & UNIX systems integrator; Windows to UNIX/Linux Client-Server Specialist; Secure E-Mail & Website Hosting; Thoroughbred Software Developer; Custom Industrial Automation; Hardware & Electronics Experts; In Business Since 1985.




card_image








Change Congress


Related Posts