in reply to Re^4: $/ question
in thread $/ question
local $/ = ""; # put into paragraph mode (separated by one or more blank lines
#!/usr/bin/perl -w
use strict;
sub slurpie {
local $/ = ""; # put into paragraph mode (separated by one or more blank lines
while (<DATA>) {
next unless /^\w\w.+(\w\w).+(\d+).+(\w\w)/sg; #should only match first paragraph
print "$_\n";
}
}
slurpie();
__DATA__
hi
hi
234
hi
hoi
sdfsdfsdf23423
hi
hi
hi
1234
1
:!././././././././././perl_slurp.pl
hi
hi
234
hi
hoi
sdfsdfsdf23423
hi
hi
hi
1234
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: $/ question
by kyle (Abbot) on Jan 13, 2008 at 04:13 UTC | |
by convenientstore (Pilgrim) on Jan 13, 2008 at 04:22 UTC |