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
In reply to Re: Global Variable
by lamp
in thread Global Variable
by abithajames
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |