geostorm.org


UTC 10:55:19
Monday
8/20/2018



August 2018
SuMoTuWeThFrSa 
   1234 
567891011 
12131415161718 
19202122232425 
262728293031  
        
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];