home | blog
Introduction to Perl 6 screencast - part 1 - scalarsPublished on 2010.07.19 at 17:07:33Tags: Perl 6, Perl, screencast, scalars, Rakudo
Direct link to the Perl 6 scalars screencast IRC: #perl6 on irc.freenode.net
Perl 6 Code examples
use v6;
say "Hello world";
use v6;
my $name = prompt "Please type in your name: ";
say "Hello $name, how are you?";
use v6;
my $year = prompt "When were you born? ";
if $year > 1987 {
say "You are younger than Perl by { $year - 1987 } years";
}
use v6;
my $year = prompt "When were you born? ";
if 1995 > $year > 1987 {
say "You are younger than Perl 1 but older than Perl 5";
}
use v6;
my $luck = prompt "What is your lucky number? ";
if $luck == 3 or $luck == 7 or $luck == 13 {
say "Oh, that's like mine";
}
if $luck == 3|7|13 {
say "Oh, that's still like mine";
}
blog comments powered by Disqus
|