in reply to Is there any INCLUDE equivalent in Perl ?
As others have said, check out the do, require, and use documentation. I sometimes just make the config file a simple anonymous hash and then grab it via require()'s return value:
# example program: #!/usr/bin/perl -w use strict; my $config = require("config.txt"); print "$config->{var1} $config->{var2}\n"; __END__ # and here's config.txt: { var1 => 'Hello', var2 => 'World', }
|
|---|