Leser: 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use strict; use warnings; my %x=( =rem a=>1, =cut ); my @x=( =rem 1, =cut );
1
2
3
4
5
6
7
8
Number found where operator expected at ./test_rem.pl line 16, near "rem
1"
(Do you need to predeclare rem?)
syntax error at ./test_rem.pl line 8, near "(
="
syntax error at ./test_rem.pl line 15, near "(
="
Execution of ./test_rem.pl aborted due to compilation errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub head1($){shift} sub cut(){'test'} my $x=1; my $y=1; my @z=( $x =head1 'test' ,$y =cut ); print Dumper($x,$y,\@z);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub head1($){shift} sub cut(){'test'} my $x =head1 'test'; my $y =cut ; print Dumper($x);
Quote(Hervorhebung von mir.)Perl has a mechanism for intermixing documentation with source code. While it's expecting the beginning of a new statement, if the compiler encounters a line that begins with an equal sign and a word, like this
=head1 Here There Be Pods!
Then that text and all remaining text up through and including a line beginning with "=cut" will be ignored. The format of the intervening text is described in perlpod.