[Cedarvalley] using subs with an s///g?

Aaron Thompson thompson at cns.uni.edu
Wed Dec 10 17:26:56 CST 2003


I would like to replace a string with the results of a sub
program the idea is as follows...

I have a sub 'display_gallery_list' that returns an HTML table
listing some galleries... and I want to replace the string 
'<!-- include:gallery_table -->' with the results of the sub.
Also this global replacement is preferred.

something like this should be possible:

  $data =~ s/<!-- include:gallery_table -->/&display_gallery_list/g;

I don't want to use the $` and $' variables... 

Any ideas/suggestions?

@
  
-- 
Aaron Thompson   Unix Systems Administrator, College of Natural Science
University of Northern Iowa                      Cedar Falls, IA  50614

"My doctor says that I have a malformed public-duty gland and a natural
deficiency in moral fiber, and that I am therefore excused from saving
Universes."  -Douglas Adams



More information about the Cedarvalley mailing list