line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package v6; |
2
|
|
|
|
|
|
|
$v6::VERSION = '0.047'; |
3
|
31
|
|
|
31
|
|
9276
|
use strict; |
|
31
|
|
|
|
|
34
|
|
|
31
|
|
|
|
|
3566
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
31
|
|
|
31
|
|
211
|
my ($module,@args) = @_; |
7
|
31
|
|
|
|
|
44
|
my $submodule = $args[0]; |
8
|
31
|
50
|
|
|
|
147
|
if ($submodule =~ /^-/) { |
9
|
31
|
|
|
|
|
69
|
$submodule =~ s/^-//; |
10
|
31
|
|
|
|
|
49
|
$submodule = 'v6::'.$submodule; |
11
|
31
|
|
|
|
|
1219
|
eval("require $submodule"); |
12
|
31
|
50
|
|
|
|
140
|
die if $@; |
13
|
31
|
|
|
|
|
137
|
$submodule->import(@args); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
v6 - A Perl 6 implementation |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# file: hello_world.pl |
26
|
|
|
|
|
|
|
use v6-perlito; |
27
|
|
|
|
|
|
|
"hello, World".say; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$ perl hello_world.pl |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The C module is a front-end to the "Perlito" Perl6 compiler. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Alternate backend modules can be installed. For example, the "Mildew" compiler can be used as: |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
use v6-mildew; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 REQUIREMENTS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
- The source file header must be valid perl5 I perl6 code. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This is a valid header: |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#!/usr/bin/perl |
46
|
|
|
|
|
|
|
use v6-perlito; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
* it executes perl5 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
* perl5 will call the C module. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
This is an invalid header: |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#!/usr/bin/pugs |
55
|
|
|
|
|
|
|
use v6; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
* it tells perl5 to execute C. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
* it would tell perl5 that Perl v6.0.0 required. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHORS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The Pugs Team Eperl6-compiler@perl.orgE. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
The Perl 6 homepage at L. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The Perlito compiler at L. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Copyright 2006, 2010, 2012 by Flavio Soibelmann Glock and others. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
76
|
|
|
|
|
|
|
under the same terms as Perl itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
See L |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |