How do we share or export a global variable between two different perl scripts.
Here is the situation:
first.pl
#!/usr/bin/
They will share global variables, yes. Are you seeing some problem with that?
Example:
first.pl:
#!/usr/bin/perl
use strict;
use warnings;
our (@a, @b);
@a = 1..3;
@b = "a".."c";
second.pl:
#!/usr/bin/perl
use strict;
use warnings;
require "first.pl";
our (@a,@b);
print @a;
print @b;
Giving:
$ perl second.pl
123abc