Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Turning a datafile into a data structure

by takshaka (Friar)
on Jun 30, 2000 at 21:59 UTC ( [id://20642]=note: print w/replies, xml ) Need Help??


in reply to Turning a datafile into a data structure

if(/begin_item/) { while (!/end_item/) { ...deal with data members here... } }
If you do decide to roll your own rather than use Parse::RecDescent, this is the sort of thing for which the range operator is useful.
while (my $range = /begin_item/i.../end_item/i) { # skip the first and last lines if you want... next unless $range > 1 && substr($range, -2) ne 'E0'; # deal with data member }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://20642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-20 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found