Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Record Separator affecting Regex

by jdporter (Canon)
on Nov 07, 2002 at 19:13 UTC ( #211190=note: print w/ replies, xml ) Need Help??


in reply to Record Separator affecting Regex

The problem is that comments and statements are terminated by two different things, and you can expect to see the two types of elements intermingled.

What I would do, if the file isn't grotesquely huge, is read it all into $_, remove the comments, and then split.

$_ = <DATA>; s/^#.*//gm; # <b>updated</b> my @lines = split /;\n+/;


Comment on Re: Record Separator affecting Regex
Download Code
Re: Re: Record Separator affecting Regex
by Kozz (Friar) on Nov 07, 2002 at 19:30 UTC
    Yes, this would have been much easier, but unfortunately, the file is 23MB uncompressed. :(

    But thanks for the info - that's another way I might have tried had the file been smaller.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-12-20 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls