I have a document which contains example program code in Verbatim environments. The caret symbol produced by typing ^ looks too flat to me, so I defined a macro to produce a sharper version.
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{fancyvrb}
%A more wedge-like caret for use in code.
\newcommand\pow{\hspace{-1pt}\raisebox{-1pt}{\scalebox{1.2}{\textsf{\textasciicircum}}}\hspace{-1pt}}
%Set up code environment
\DefineVerbatimEnvironment{code}{Verbatim}{xleftmargin=12pt,xrightmargin=12pt,commandchars=\\\{\}}
\begin{document}
\begin{code}
y = x^2
y = x\pow2
\end{code}
\end{document}

Unfortunately, it's easy to forget the necessity to use \pow and not ^ in code examples. Therefore I would like to set things up so that typing ^ in a code environment produces the result of \pow. How can this be achieved?

\powdoesn't seem “right”, it can have a different width than monospaced fonts. I would use a\makeboxto the width of a single character in a monospaced font. – Manuel Jul 29 '14 at 11:19