use feature 'say' to print one blank line

S

sbk

How do use the perl-5.10 'say' feature to print a single blank line?

gnat> cat test
#!/usr/bin/perl
use Perl6::Say;
say 'one';
say();
say 'three';

gnat> ./test
one

three
gnat>
gnat> cat ./test
#!/usr/bin/perl
use feature 'say';
say 'one';
say();
say 'three';
gnat>
gnat> ./test
one
Use of uninitialized value $_ in say at ./test line 4.

three
gnat>
gnat> cat ./test
#!/usr/bin/perl
use feature 'say';
say 'one';
say;
say 'three';
gnat>
gnat> ./test
one
Use of uninitialized value $_ in say at ./test line 4.

three
gnat>

--sk

Stuart Kendrick
FHCRC
 
R

Ron Bergin

How do use the perl-5.10 'say' feature to print a single blank line?

gnat> cat test
#!/usr/bin/perl
use Perl6::Say;
say 'one';
say();
say 'three';

gnat> ./test
one

three
gnat>
gnat> cat ./test
#!/usr/bin/perl
use feature 'say';
say 'one';
say();
say 'three';
gnat>
gnat> ./test
one
Use of uninitialized value $_ in say at ./test line 4.

three
gnat>
gnat> cat ./test
#!/usr/bin/perl
use feature 'say';
say 'one';
say;
say 'three';
gnat>
gnat> ./test
one
Use of uninitialized value $_ in say at ./test line 4.

three
gnat>

--sk

Stuart Kendrick
FHCRC

Pass an empty string.

C:\test>type test.pl
#!/usr/bin/perl
use feature 'say';
say 'one';
say('');
say 'three';

C:\test>test.pl
one

three
 

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,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top