foreach my $line ( foo('bar') ) { $a.=chomp $line ; $b*= getVa($line);#a parsing function }