in reply to Parsing spaces and curly braces
and you should be able to work out process_not_curly, process_curly, and adjust_line.while (my $line = <>) { chomp($line); while ( length( $line ) ) { if ( my $not_curly = /^([^{]+)/ ) { push @tokens, process_not_curly($not_curly); $line = adjust_line($line, $not_curly); } elsif ( my $curly = /^\{([^}]+)\}/ ) { push @tokens, process_curly($curly); $line = adjust_line($line, $curly); } else { die "can't get here, "; } } }
Update: After further review, Roy Johnson has the right idea; I need more coffee; I still like my (re)title.
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing spaces and curly braces
by ikegami (Patriarch) on Sep 12, 2005 at 20:02 UTC | |
|
Re: Parsing spaces and curly braces
by jonadab (Parson) on Sep 12, 2005 at 19:44 UTC |