Commit | Line | Data |
a0d0e21e |
1 | =head1 NAME |
2 | |
3 | Config - access Perl configuration option |
4 | |
5 | =head1 SYNOPSIS |
6 | |
7 | use Config; |
8 | if ($Config{'cc'} =~ /gcc/) { |
9 | print "built by gcc\n"; |
10 | } |
11 | |
12 | =head1 DESCRIPTION |
13 | |
14 | The Config module contains everything that was available to the |
15 | C<Configure> program at Perl build time. Shell variables from |
16 | F<config.sh> are stored in the readonly-variable C<%Config>, indexed by |
17 | their names. |
18 | |
19 | =head1 EXAMPLE |
20 | |
21 | Here's a more sophisticated example of using %Config: |
22 | |
23 | use Config; |
24 | |
25 | defined $Config{sig_name} || die "No sigs?"; |
26 | foreach $name (split(' ', $Config{sig_name})) { |
27 | $signo{$name} = $i; |
28 | $signame[$i] = $name; |
29 | $i++; |
30 | } |
31 | |
32 | print "signal #17 = $signame[17]\n"; |
33 | if ($signo{ALRM}) { |
34 | print "SIGALRM is $signo{ALRM}\n"; |
35 | } |
36 | |
37 | =head1 NOTE |
38 | |
39 | This module contains a good example of how to make a variable |
40 | readonly to those outside of it. |