DCPM: splitting on lookaheads

Matthew Browning mb at matthewb.org
Fri Oct 31 06:06:30 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 31 October 2003 11:32, Steve Marvell wrote:
> This is very useful if you don't have a record separator, but
> instead, you have concatenated records with a known start block which
> you need to keep.
>

Okay.  I've seen the split thing now ;)

That's cool.  I've used this technique on files of numeric data where 
all I knew was that sections were separated by *something* composed of 
word chars.

It might bear a bit of explanation regarding what the input record 
separator is and the effect of localising it and WTF a lookahead 
assertion is because, AFAIK and please correct me if I'm wrong, that's 
a feature unique to perl.

Haters of line-noise may like to look into the English module (which I 
think is standard).  It allows you to relace things like $/ with 
$INPUT_RECORD_SEPARATOR which at least gives a novice a fighting chance 
of interpreting it.

MB

- -- 
http://matthewb.org/public_key.txt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/olBGy5o0lRFL2ooRAooZAKCDymj+uy8x+qYYfCjkRDmnaZDKbACeO1hM
E3eap3APkKUuZMpfDLE8V3Q=
=qEYG
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list