| Home
| Calendar
| Mail Lists
| List Archives
| Desktop SIG
| Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings Linux Cafe | Meeting Notes | Linux Links | About BLU |
Joshua Pollak writes:
> What's the best way to do this?
This comes to mind:
#!/usr/bin/perl
use strict;
my ($line);
while (defined($line = <>)) {
chomp;
if ($line =~ s/\\$//) {
$line .= <>;
redo unless eof;
}
if ($line =~ /^\s*OPTION\s*=\s*(.*)$/s) {
my (@options) = split(/\s+/, $1);
# do something with @options
for my $option (@options) {
print "option is $option\n";
}
exit; # Joshua said that he wanted to stop reading here
}
}
Hope this helps,
--kevin
--
Kevin D. Clark (cetaceannetworks.com!kclark) | Will hack Perl for
Cetacean Networks, Inc. | fine food, good beer,
Portsmouth, N.H. (USA) | or fun.
alumni.unh.edu!kdc (GnuPG ID: B280F24E)) |