> Hi again Gurus!
>
> I am trying to expand my understanding of perl. i do not understand why
> the first test fails and the latter two succeed. shouldn't the first
> succeed as well?
>
> -Josh
>
> code:
>
> #!/usr/bin/perl
> use strict;
>
> # doesn't work
> if(-e "%systemdrive%\\servicedisk\\tools\\seachange\\SeaPatch.exe"){ print
> "yes\n"; }else{ print "no\n"; }
The %systemdrive% syntax is what the Windows command line interpreters use to
designate environment variables. When you use the `%systemdrive%`syntax in your
working example, you are running the command line interpreter. Perl provides
the %ENV hash for accessing the environment without running another process.
Use $ENV{systemdrive} to get the value.
--
Eric Amick
Columbia, MD
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs