• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

perl programming questions

holycow

Senior member
hi,

i was doing a regexp on stripping off all the html codes on a webpage.. i couldn't strip this (<!-- asdf-->)html syntax properly.. can someone help me with this one?

also, can someone explain to me what does this code do exact? i understand that it's used to sort the array, but i don't understand why it convert the array into a hash, map it then sort it..

here is the perl code:
@list = sort keys %{{map{$_,1} @list}};

this is what i come up with, but it doesn't work when there are javascrpt embedded in the html comment syntax..

$s =~ s/(<!--(\W|\w)*(\/\/)?-->)//gi;

tia!
 
Back
Top