---------- Forwarded message ----------
From: Philippe Aerts <[EMAIL PROTECTED]>
Date: 20-sep-2005 20:04
Subject: Re: Hash of Arrays
To: Christopher Spears <[EMAIL PROTECTED]>

Hi Christopher,

The syntax of the split command is 
split /PATTERN/,EXPR,LIMIT

 Limit specifies the maximum numbers of fields the EXPR will be split into.

You might want to check out 
http://search.cpan.org/dist/perl/pod/perlfunc.pod

hope this helps

Regards,

Phil


2005/9/20, Christopher Spears <[EMAIL PROTECTED]>:
> 
> I've been learning about data structures by reading
> the Programming Perl book. Here is a code snippet:
> 
> while ($line = <>) {
> ($who, $rest) = split /:\s*/, $line, 2;
> @fields = split ' ', $rest; 
> $HoA{$who} = [ @fields ];
> }
> 
> The part that confuses me is:
> 
> ($who, $rest) = split /:\s*/, $line, 2;
> 
> I understand that it takes the input and splits it
> into two parts along the regular expression, but I 
> can't figure out what the 2 means.
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
>

Reply via email to