in reply to Global Variable
file2.pl#!/usr/bin/perl -w use strict; use warnings; our $error; $error = 10; print "before $error \n"; require 'file2.pl'; # you can use 'do' also print "after $error \n";
output#!/usr/bin/perl -w use strict; our $error = 20;
before 10 after 20
|
---|