which will contain to sets of paths
for e.g - this file is called config.pl
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- #Path1
- $sourcedir1 = '/home/test/srcdir1';
- $destdir1 = '/home/test/srcdir1';
- #Path2
- $sourcedir2 = '/home/test/srcdir2';
- $destdir2 = '/home/test/srcdir2';
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- require "include.pl";
- use File::Copy;
- $sourcedir1 = $src;
- $destdir1 =$dest
- &myscript("$sourcedir1", "$destdir1");
- $sourcedir2 = $src;
- $destdir2 =$dest
- &myscript("$sourcedir2", "$destdir2");
- sub myscript {
- ###### Actual script code here #######
- code uses throught out the script $src and $dest variables
- but needs to be defined outside sub area
- }
So how would i be able to run both paths from the config file.
Could somebody help me with this please.