closely related to How to implement (low-level) arrays in TeX . What is the recommended package that provides a simple abstraction of the hash feature that is in latex, at least for small-scale needs. Think
\makeatletter
\AtBeginDocument{\hashrestore}
\newcommand{\hashinsert}[2]{\expandafter\def\csname #1\endcsname{#2}}
\newcommand{\hashget}[1]{\csname #1\endcsname}
\AtEndDocument{\hashsave}
\newcommand{\hashsave}{ ... write to file ... }
\newcommand{\hashretrieve}{ ... load from file ... }
\makeatother
It's just one global hash. This is essentially the same functionality that labels and refs provide through the .aux files. I know I have hacked around this problem a few times before, but the last times was years ago, and I can't recall how. I didn't abstract it, either. Grrr... Moreover, there may be newer packages that satisfy this need better. If no one answers this, I will look through my old tex hacks (comp.text.tex) to see what my most recent solution to this issue was. It's common enough a need to warrant a dedicated tex.stackexchange post.
I will want to use this, e.g., to define
\usepackage{hash}
\newcommand{\mycaption}[2]{\caption{#2}\label{#1}\hashinsert{#1}{#2}}
\newcommand{\myinshere}[1]{\begin{center} Insert Table \ref{#1}: \hashget{#1} \end{center}}
and in my document
...
\myinshere{tbl:1}
...
\begin{table} \mycaption{tbl:1}{Table 1} \end{table}
\labelafter the\caption. – Werner Mar 20 '15 at 01:41expl3(texdoc expl3; texdoc interface3). 3) I don't know why you would want to do this in the first place. What's the actual problem?