The easiest way for me to exaplain this one is to give you guys and gals the script:
# Main File
#!/usr/bin/perl
use CGI qw
standard escapeHTML);
use strict;
unshift(@INC, "subrutines/"
;
require subrutines;
<-- Unrelevant Script parts -->
$student_name = "Scott";
&SUBRUTINES::EXAM_NAME ($student_name);
print "Main Name: $student_name";
exit;
<-- Unrelevant Script parts -->
# subrutines.pm
sub EXAM_NAME {
package SUBRUTINES;
print "Sub Name: $student_name";
}
1; Return true value
< END OF SCRIPTS >
Okay heres the delema, $student_name WILL NOT PRINT from the EXAM_NAME subrutine. This is the output:
Sub Name: Main Name: Scott
HELP HELP
I gave tried a few variations of sending the variable such as: &SUBRUTINES::EXAM_NAME ("$student_name", $student_name);
and none seem to work.
Please help....
Scott
# Main File
#!/usr/bin/perl
use CGI qw
use strict;
unshift(@INC, "subrutines/"
require subrutines;
<-- Unrelevant Script parts -->
$student_name = "Scott";
&SUBRUTINES::EXAM_NAME ($student_name);
print "Main Name: $student_name";
exit;
<-- Unrelevant Script parts -->
# subrutines.pm
sub EXAM_NAME {
package SUBRUTINES;
print "Sub Name: $student_name";
}
1; Return true value
< END OF SCRIPTS >
Okay heres the delema, $student_name WILL NOT PRINT from the EXAM_NAME subrutine. This is the output:
Sub Name: Main Name: Scott
HELP HELP
I gave tried a few variations of sending the variable such as: &SUBRUTINES::EXAM_NAME ("$student_name", $student_name);
and none seem to work.
Please help....
Scott