The next-to-leading-order (NLO) cross section for the production of he
avy quarks at large transverse momenta (p perpendicular to) in gamma g
amma collisions is calculated with perturbative fragmentation function
s (PFFs). This approach allows for a resummation of terms proportional
to alpha(s) In(p(perpendicular to)(2)/m(2)) which arise in NLO from c
ollinear emission of gluons by heavy quarks at large p perpendicular t
o or from almost collinear branching of photons or gluons into heavy-q
uark pairs. We present single-inclusive distributions in p perpendicul
ar to and rapidity including direct and resolved photons for gamma gam
ma production of heavy quarks at e(+)e(-) colliders and at high-energy
gamma gamma colliders. The results are compared with the fixed-order
calculation for m finite including QCD radiative corrections. The two
approaches differ in the definitions and relative contributions of the
direct and resolved terms, but essentially agree in their sum. The re
summation of the alpha(s) In(p(perpendicular to)(2)/m(2)) terms in the
PFF approach leads to a softer p perpendicular to distribution and to
a reduced sensitivity to the choice of the renormalization and factor
ization scales.