SPUG: Self referecing URL

marlin marlin3hats at uswest.net
Fri Sep 22 20:15:23 CDT 2000


I need to detect a catalog number in a text line and reference it to 
another page as a link. 

The text is $item_text. I want to swap the number (NUM + some digits)
with itself as a <A HREF> tag.

I tried...

$item_text =~ s/(NUM.*\s)/<A HREF=get_page.pl?cat_num=\1>\1</A>/g;
which sort of works except that the closing > after the \1 is ignored,
that is the tag never closes and the entire line is linked.

I'm missing something.

Thanks is advance for telling me what I'm missing.

Marlin Greene
-- 
	3 Hats Design
	INTERNET  PRINT  ILLUSTRATION
	5201 15 Ave NW 
	Suite 220
	Seattle, WA 98107
	206.784.1641 phone
	206.784.2231 fax
	marlin at 3hats.com
	http://www.3hats.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list