#!/usr/local/bin/perl
$what=`nameconfig.pl` . " was here!";
print("NAME: " . $what . "\n\n");
$another=`nameconfig.pl`;
print("NAME: " . $another . "was here and it did work!\n\n");
Can't return outside a subroutine at C:\SCRIPT\nameconfig.pl line 11.
NAME: was here!
Can't return outside a subroutine at C:\SCRIPT\nameconfig.pl line 11.
NAME: was here and it did work!
The file required needs to return true to indicate any initialization executed successfully. Traditionally you end required files with "1;" to be safe.
Say you creating the config file with an empty hash:
That would cause an error when required because the last value evaluates to false. Putting a "1;" at the end of the file solves the problem and you can handle the empty %config any way you like.