my $author; my $quote; my @subjects; while (<>) { next if /^\s*$/; # skip empty lines chomp; $author = substr($_,3), next if substr($_,0,3) eq '/-a'; @subjects = split(/,/, substr($_,3)), next if substr($_,0,3) eq '/-s'; $quote = substr($_,3) if substr($_,0,3) eq '/-q'; insertDB($author,@subjects,$quote); }