http://qs1969.pair.com?node_id=173757


in reply to perl puzzle - cartoon couple registry (beginner, semi-golf)

the 2 entries below are close, but using "\n" disqualifies them. What options in perl could take the place of a newline? (or is this a trick?)

print "$_ is married to $couples{$_}<br>" for(sort keys %couples)

You don't need a newline. You need a <br> tag. The output is going to an HTML file.


Replies are listed 'Best First'.
Re^2: perl puzzle - cartoon couple registry (beginner, semi-golf)
by Bod (Parson) on Jun 01, 2023 at 22:13 UTC
    You don't need a newline. You need a <br> tag. The output is going to an HTML file

    The requirement is...
    print out the couple's information as formatted above to STDOUT

    The final output might be to HTML but the output of this code does need newlines.