- or download this
- A header made up of:
- the word function
- a function name
- an arguments list
- A body made up of a block of code
- or download this
- A header of:
- the word while
- a condition
- A body of a block of code
- or download this
- A header of:
- the word for
...
- a condition and then a semi-colon
- an increment
- A body of a block of code
- or download this
- A header of the word do
- A body of a block of code
- A footer of:
- the word while
- a condition
- or download this
- a header
- a body
- a block of code
- a condition
- or download this
$block = qr/
\{
...
| (??{ $block })
)*
\}
- or download this
rule block {
\{
...
]*
\}
}
- or download this
rule block {
\(
...
]*
\)
}
- or download this
rule block ($left,$right) {
$left
...
]*
$right
}
- or download this
- start quote
- string of (non-quote or backslashed quote) characters
- end quote
- or download this
rule quoted_string ($type) {
"
...
]*
"
}
- or download this
rule quoted_string ($type) {
$type
...
]*
$type
}
- or download this
rule string
{
<quoted_string ">
| <quoted_string '>
}
- or download this
A single-line comment
or
A multi-line comment
- or download this
rule single_line_comment {
// \N*:
}
- or download this
- A leading /*
- A string of characters that includes non asterix and astrix not foll
+owed by a /
- A closing */
- or download this
rule multi_line_comment {
/\*
...
]*
\*/
}
- or download this
rule block ($left,$right) {
$left
...
]*
$right
}
- or download this
@matches = $var =~ /(match)/g;
- or download this
$var =~ m:e/@matches:=(match)/;
- or download this
#!/usr/bin/perl -w
use strict;
...
sub catalog_simple { ... }
sub catalog_complex { ... }
- or download this
use re 'eval';
...
my $block;
my $code = qr/ (??{$block = block ( "\{" , "\}" ); "$block"}) /x;
my $cond = qr/ (??{$block = block ( "(" , ")" ); "$block"}) /x;