Gossamer Forum
Home : General : Perl Programming :

making href

Quote Reply
making href
can't find previous post about this but i had a mod that was making a href and storing in the database. i now prefer to store the data without the html tags, then add the tags when i'm reading and printing the record.

this is the code i used before:
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;

that worked, and the href stuff was written to file. now that is not written to the file. here's the code that reads the file and i'm trying to add the tags before printing but they're not being added:
Code:
open (TEXT, "<$save_text_dir/$rec{$db_key}.txt") or &cgierr("error in displaying record. unable to open text file $save_text_dir/$rec{$db_key}.txt\nReason: $!");
@text = <TEXT>;
close TEXT;
$text = join "",@text;
$text =~ s/\b(http:\/\/\S+[^-.,\"\';: ])\b/<a href="$1">$1<\/a>/g;
print $text;
thanks!
Subject Author Views Date
Thread making href delicia 10462 Feb 16, 2017, 2:11 PM
Thread Re: [delicia] making href
Andy 10290 Feb 16, 2017, 11:02 PM
Thread Re: [Andy] making href
delicia 10280 Feb 17, 2017, 6:35 AM
Thread Re: [delicia] making href
Andy 10275 Feb 17, 2017, 6:40 AM
Thread Re: [Andy] making href
delicia 10280 Feb 17, 2017, 6:45 AM
Thread Re: [delicia] making href
Andy 10273 Feb 17, 2017, 6:46 AM
Thread Re: [Andy] making href
delicia 10274 Feb 17, 2017, 8:53 AM
Thread Re: [delicia] making href
Andy 10290 Feb 17, 2017, 8:55 AM
Thread Re: [Andy] making href
delicia 10259 Feb 17, 2017, 9:01 AM
Post Re: [delicia] making href
Andy 10256 Feb 17, 2017, 9:03 AM