fusionplant.com


UTC 11:58:40
Thursday
5/24/2018



May 2018
SuMoTuWeThFrSa 
  12345 
6789101112 
13141516171819 
20212223242526 
2728293031   
        
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];