Concatenate a new line

Asked

Viewed 111 times

5

How to add a new line by separating inputs into a Perl script?


Example:

I’m using the following script:

#!/usr/bin/perl

print 'oi' . '\n' . 'oi,de novo'

And I call on the bash as follows:

perl test.pl > a.txt

When opening the file a.txt get:

oi\noi, de novo

I would expect the file to be:

oi
oi, de novo

1 answer

5


Browser other questions tagged

You are not signed in. Login or sign up in order to post.