maxamillionk has asked for the wisdom of the Perl Monks concerning the following question:
Is there any way to use the "do" command like I would use "source" in bash shell programming without stopping the use of "warnings" and "strict"?
More often, I find myself thinking of file names, and writing functions and defining variables in those, according to my own naming procedures. That's why I like using code from other files.
For example:
file1: paths.pl
our $path1 = "/path/one";file2: program.pl
-Max#!/usr/bin/perl # use warnings; # use strict; do 'paths.pl'; print $path1."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "do" command versus "source" in bash
by hippo (Archbishop) on Jan 25, 2024 at 13:50 UTC | |
|
Re: "do" command versus "source" in bash
by shmem (Chancellor) on Jan 25, 2024 at 12:29 UTC |