#!/usr/local/bin/perl5_8 use strict; use CGI; use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); my $CGI = CGI->new; $|=1; print $CGI->header; #call my variables that are always the same &call_variables; #do other stuff using these called-in variables #without having to declare "my $one" and "my $two" again $fred = $one . $two; #or some such silliness #### sub call_variables { #pick up a string I've passed from previous program via 'spec_vars' my $spec_vars = param('spec_vars'); my @variables_array = split /~/, $spec_vars; my $one = $variables_array[0]; my $two = $variables_array[1]; my $three = $variables_array[2]; my $four = $variables_array[3]; my $five = $variables_array[4]; return ($one, $two, $three, $four, $five); }