geostorm.org


UTC 01:51:51
Thursday
12/13/2018



December 2018
SuMoTuWeThFrSa 
      1 
2345678 
9101112131415 
16171819202122 
23242526272829 
3031      
Calendar Tool

welcome

A Taste of Perl 6 on Perl 5



Perl 6 is still in the works. It will be a while before it is officially released. But here's some of the proposed functions.

say
Perl6::Say

print "Hello, World!\n";
This sends some text and a new line feed to standard output. You may forget to add the new line feed and it gets tiresome to keep having to put the "\n" at the end everytime.
Instead, you can just say "Hello, World!"; and be done. Its pretty simple. The module is very small.

slurp
Perl6::Slurp
Slurp opens a file and returns its contents to a variable.
$myFile = slurp "file1.txt";

io()
IO::All

Get standard input:
$line < io('-');
Multiple lines can be assigned to $line.

Write a line to a file:
$line > io("file1.txt");
Use > to write (or clobber) a file or >> to append. Use < to Read.

Get line 10 from a file:
$line = io('file1.txt')->[9];