Jeff Pan wrote:
> #/usr/bin/perl

use warnings;
use strict;

> my $i=0;
> my %hash;
> 
> while (<>)
> {
>     chomp;
>     s/^\s+|\s+$//g;
>     $hash{$i}=[split];
>     $i++;

You could write those four lines as:

    $hash{$i++}=[split];


> }
> 
> print $hash{0}->[0],"\n";
> print $hash{1}->[2],"\n";
> 
> Is this useful?


John
-- 
use Perl;
program
fulfillment

-- 
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