O'Reilly logo

Programmieren mit Perl by Jon Orwant, Tom Christiansen, Larry Wall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

use constant

use constant BUFFER_SIZE     => 4096;
use constant ONE_YEAR        => 365.2425 * 24 * 60 * 60;
use constant PI              => 4 * atan2 1,1;
use constant DEBUGGTNG       => 0;use constant ORACLE          => 'oracle@cs.indiana.edu';
use constant USERNAME        => scalar getpwuid($<);
use constant USERINFO        => getpwuid($<);

sub deg2rad { PI * $_[0] / 180 }

print "Diese Zeile macht nichts"        unless DEBUGGING;

# Referenzen können als konstant deklariert werden
use constant CHASH          => { foo => 42 };
use constant CARRAY         => [ 1,2,3,4 ];
use constant CPSEUDOHASH    => [ { foo => 1},42 ];
use constant CCODE          => sub { "bite $_[0]\n" };

print CHASH->{foo};
print CARRAY->[$i];
print CPSEUDOHASH->{foo};
print CC0DE->("me");
print CHASH->[10];       # Fehler während des Kompilierens

Dieses Pragma deklariert ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required