Hi all,

I am trying to do two basic things in my PERL
script:

1) Read in the values of two environment variables 
2) Print the values of scalars and environment
variables

I do not understand the errors that were generated
when I compiled the following script. Any help in
understanding what I may be doing wrong would
be greatly appreciated.

Thanks

Robert

Here is the script:

#!/usr/bin/perl -w
use strict;


$mypath =  $ENV(PATH);
$myeditor= $ENV{EDITOR};
$mytest  = 123;
$mytest2 = "Perl"

print " Test Home : $mypath\n"
print " Editor : $myeditor\n"
print " mytest : $mytest\n"
print " mytest2  : $mytest2\n


Here are the errors:

% perl test.pl
Global symbol "mypath" requires explicit package name
at test.pl line 6.
Global symbol "myeditor" requires explicit package
name at test.pl line 7.
Global symbol "mytest" requires explicit package name
at test.pl line 8.
Global symbol "mytest2" requires explicit package name
at test.pl line 9.
syntax error at test.pl line 11, near "print"
Variable "$mypath" is not imported at test.pl line 11.
Global symbol "mypath" requires explicit package name
at test.pl line 11.
Variable "$myeditor" is not imported at test.pl line
12.
Global symbol "myeditor" requires explicit package
name at test.pl line 12.
Variable "$mytest" is not imported at test.pl line 13.
Global symbol "mytest" requires explicit package name
at test.pl line 13.
Variable "$mytest2" is not imported at test.pl line
14.
Global symbol "mytest2" requires explicit package name
at test.pl line 14.
Execution of test.pl aborted due to compilation
errors.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to