1999 twenty-four merry days of Perl Feed

Testing code

perl - 1999-12-04

Code

This perl section has syntax highlighted and does not overflow

# Syntax-highlighted code
my $x = 1_00_000 ** $::xyzzy;
my $str = "foobar";

This other code is verbatim and does not overflow

my $x = 1_00_000 ** $::xyzzy;
my $str = "foobar";

Syntax-highlighted code

A perl section can do syntax highlighting

# Syntax-highlighted code
my $x = 1_00_000 ** $::xyzzy;
my $long_str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

Verbatim block code

Verbatim text

  my $x = 1_00_000 ** $::xyzzy;
  my $long_str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

Syntax-Hightlighted from shebang in indented lines

This code is not wrapped inside begin/end but is using tabs instead. It is highlighted thanks to #!perl.

sub do_it {
    state $scalar = 137;
    state @array = qw( 1, 3, 7 );
    state %hash = map { $_, 1 } (1, 3, 7);

    if( exists $hash{$args[0]} ) { ... } # leave off the ->
}

Verbatim with begin code

sub do_it {
    state $scalar = 137;
    state @array = qw( 1, 3, 7 );
    state %hash = map { $_, 1 } (1, 3, 7);

    if( exists $hash{$args[0]} ) { ... } # leave off the ->
}
Gravatar Image This article contributed by: Thibault DUPONCHELLE <thibault.duponchelle@gmail.com>