Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I want to be able to take arbitrary lines containing variables that are defined in the program, and interpolate them.
I've seen String::Interpolate mentioned in my searches, but unless I'm misunderstanding something, I'd have to know in advance what variables I'd be interpolating What I'm trying to do is create a program template where a comment block right after the shebang line (possibly containing scalar variables like $program or other constants or environment variables) can be rendered to produce a usage statement. The perform_interpolation() subroutine would be part of the template and wouldn't know specifically what variables the programmer might want to interpolate for the usage statement. Can String::Interpolate do this? Or is there a simpler way? In reply to Invoke the Perl string interpolation engine on a string contained in a scalar variable. by ibm1620
|
|