Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Look Ahead/Behind Via a File Handle

by benn (Priest)
on Aug 11, 2003 at 23:32 UTC ( #283056=note: print w/ replies, xml ) Need Help??


in reply to Look Ahead/Behind Via a File Handle

As Zaxo says, using SQL::Statement, or a parsing module of some kind may be easier, but I think your problem could be solved simply using another 'inner' read...something like this (untested!).

while (my $line = <SCHEMA>) { if ($line =~/create table \".+?\"\.(.+?)$/mos) { $table_nm = $1; print BIGLIST "$1 \n"; my $keep = 0; while ($line = <SCHEMA> && $line ne ')') { $table_hash{$table_nm} = 1 if ($line =~ /$var_of_interest/); } } }
Cheers,
Ben.


Comment on Re: Look Ahead/Behind Via a File Handle
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2015-07-03 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls