hallo
hallo
$result =~ s{[/]}{\\/}g; #### <---------------Nein, das reicht bei weitem nicht!!!
sub perldata_to_htmlscript_ob{
	my $hash_of_objects = shift;
	my $result = '';
	foreach( keys %{ $hash_of_objects } ){
		$result .= sprintf( qq{var %s = %s;\n}, $_, encode_json( $hash_of_objects->{$_} ) );
	}
	$result =~ s{</script}{<\\/script}g;
	$result =~ s{<script}{<\\script}g;
	$result =~ s{<!--}{<\\!--}g;
	# https://www.w3.org/TR/html51/semantics-scripting.html#script-content-restrictions
	# <!--  ===>  <\!-- , <script ===> <\script , </script  ===>  <\/script
	return sprintf("<script>\n//<!--\n%s\n// -->\n</script>\n", $result );
}
Das besteht diesen Test
my $arrayref=[ 
	"<!--<script>alert(\"gotcha\")</script>-->", 
	"</script>-->!--<script>alert(\"gotcha\")</script>-->", 
	"--><script>alert(\"gotcha\")</script>-->", 
	];
-- 
Neu im Forum! Signaturen kann man ausblenden!
  Neu im Forum! Signaturen kann man ausblenden!
 nicht angemeldet
 nicht angemeldet Rolf B
 Rolf B TS
 TS Auge
 Auge