Re: Perl Regular expressions (OT)
| From: | Julian Wood | Date: | Thu, 04 Jan 2001 19:22:30 +0000 |
| Subject: | Re: Perl Regular expressions (OT) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32678@lists.php.net to get a copy of this message | ||
on 1/4/01 9:39 AM, Ben Wiechman at neteru@aminal.net wrote:
>
> Anyone have any idea what this is doing?
>
> while (<FILE>) {
> next unless s/^(.*?) = \s*//;
> $words{$1} = [ split ];
> }
>
> What is that [ split ] construct? Has anyone seen that before? I can
> understand the rest, but [ split ]?
>
> Ben
>
It looks like it's making an associative array keyed by the match it picks
up in the preceding line, with values taken from lines of the file, each of
which is being made into an array split on white space (i think that's the
default split).
Can you step through the debugger and look at the hash it's making?
J