Thanks guys,

so to assign each key and add additional keys I could just write a loop
and continue to add more keys into the hash right?

so I could do

chomp(@file)

foreach @file{
        (if $_ =~ /\</)
         $key = $_
        }
        else{
         $hash{$key} = "$hash{$key}","$_"; #I want to concatenate
        }
}

Thanks

Eric
On Thu, 1 Aug 2002, nkuipers wrote:

> >how do I find the line with only the "<" character?
>
> %perldoc perlre
>
> In the meantime, you could set the record separator to <, that is,
>
> $/ = '<';
>
> then make a regex that captures the filename part separate from the rest.
>
> if (/^(filenamepattern)(.*)</) {
>      $key = $1;
>      $value = $2;
>      $value =~ s/\n//; #or chomp $value, depends what you want
>      $hash{$key} = $value;
> }
>
> I'm getting afraid of trying to answer queries on this list since it shows me
> just how much I don't understand. =)  But anyways, that's my untested stab at
> the problem.
>
> cheers,
>
> nathanael
>


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

Reply via email to