while () { if (/.../) { ... } } #### my $stuff; while () { if (/(...)(...)/) { # we have $1 and $2 in here, both some string } elsif (/(...)/) { $stuff = $1; } } #### eval "\$$stuff{$1} = $2";