Global variable becomes local

I have encountered a very weird behavior of a global variable in Korn Shell in AIX:
A function f1 in my script pipes the output of the function f2 to a program.
A variable defined as global using typeset gets its value in f2.
That value is not seen in f1. If I remove the pipe ksh recognizes the variable as global.
Can anybody explain this?

#!/usr/bin/ksh

typeset var

function f2
{
var=1111
}

function f1
{
typeset lpt=tmp
var=alpha
f2 | wc $lpt
print "after f2 call, \$var is $var"
}

f1

:confused:

some thing wrong with the line

f2 | wc $lpt in tr script

Sorry, should be
f2| wc >$lpt

or just

f2 | wc

:frowning: