kwn has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; open("test", "<test.txt"); my @array = <test>; my @ex = grep(!/^####/, @array); my @test2 = grep(/#bg\sas,([a-z0-9])#end/, @ex); print @test2; close("test"); __DATA__ ####---------------------k ####---------------------l ####---------------k #bg at,super spaz razz tazz kazz #end #bg as,clock brock spock mock sock #end #bf as,lost fluff muff tuff cuff #end #bf aa,sauce dock spork fork torque #end ####-------------d-d ####------g-d
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching between characters
by ikegami (Patriarch) on Oct 17, 2008 at 06:25 UTC | |
|
Re: matching between characters
by Anonymous Monk on Oct 17, 2008 at 05:57 UTC | |
by Anonymous Monk on Oct 17, 2008 at 06:08 UTC | |
by kwn (Novice) on Oct 17, 2008 at 07:02 UTC |