You shouldn't have to use export to make variables within a function become global. Once a function is run, it's variables should be available throughout the rest of your script.
If you are invoking a subshell (while statement?) in one of your functions, that's another story. It would help to see the other functions to debug this problem.
Are you certain that the values from Function 1 are being passed to Function 2 when using the pipe? If you want to pass a variable to your second function, I'd do it like this:
Code:
func1 () {
var1=1
}
func2 () {
var2=$1
}
func1
func2 $var1
echo $var2