View NG with Net::NNTP

J

John W. Krahn

Mike said:
When I do that, the output I get is:
ARRAY(0x15f1a0c)

That is because $nntp->article returns a reference to an array. You
have to dereference the array to access its contents.

My exact code snippet is:
my $text = $nntp->article;
$text =~ tr/\n/<br>/;
^^^^
You can't use tr/// on strings. That will replace all "\n" characters
with the '<' character. The characters 'b', 'r' and '>' will be
ignored.

# also tried using:
# my @body =~ split(/\n/, $text);
print "$text";

s/\n/<br>/ for @$text;

print @$text;


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top