I have spent a very LONG time trying to determine why this script is not
splitting properly only on lines that have equals marks and only on the
first equals. This would be very easy if I didn't slurp in the entire
file at once, but hey life usually isn't easy. The array @a should
always have an equal number of elements. I have tried countless
permutations with no luck. Thanks.

In case the email formatting gets messed up, there are 8 lines beneath
__DATA__.

#!/usr/bin/perl -w
use strict;

undef $/;
my @a = grep length, split /\[.*\]|^(?:[^=]+)=|\s+/i, <DATA>;
print "$_\n" for @a;

__DATA__
[DEFAULT]
BASEURL=http://v4.windowsupdate.microsoft.com/en/default.asp
[DOC#17#19#21]
BASEURL=http://v4.windowsupdate.microsoft.com/en/splash.asp?page=3&x86=true&auenabled=false&;
ORIGURL=splash.asp?page=0&corporate=false&
[InternetShortcut]
URL=http://v4.windowsupdate.microsoft.com/en/default.asp
Modified=B059DD590A4BC20157


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to