Can anyone spot the problem with this?
$input->{swear_filter} is form input. It is a textarea containing one word per line eg:
bad
words
go
here
.....the code was working but I must have tweaked something and now I get:
Can't use string ("bad
words
go
here") as an ARRAY ref while "strict refs" in use at Admin.pm line 67.
If I turn off strict refs it just updates the config with:
'swear_filter' => 'bad words go here'
....when it should be:
'swear_filter' => ['bad', 'words', 'go', 'here']
I'm embarassed to say I can't figure it out, and as usual it will either be a stupid mistake or I'll figure it out in about 3 seconds.
Code:
@{$CFG->{swear_filter}} = split /\n+/, $input->{swear_filter};$input->{swear_filter} is form input. It is a textarea containing one word per line eg:
bad
words
go
here
.....the code was working but I must have tweaked something and now I get:
Can't use string ("bad
words
go
here") as an ARRAY ref while "strict refs" in use at Admin.pm line 67.
If I turn off strict refs it just updates the config with:
'swear_filter' => 'bad words go here'
....when it should be:
'swear_filter' => ['bad', 'words', 'go', 'here']
I'm embarassed to say I can't figure it out, and as usual it will either be a stupid mistake or I'll figure it out in about 3 seconds.