in reply to Re^4: perlApp --gui and chdir
in thread perlApp --gui and chdir

all works fine as a .pl

Prove it.

so error checking has nothing to do with this

Sure it does.

Replies are listed 'Best First'.
Re^6: perlApp --gui and chdir
by diamondsandperls (Beadle) on Jul 01, 2012 at 22:35 UTC
    my apologies yes error checking on path would help the problem is after compiling finding the current user is failing

    my $olduserid = qx{whoami};
    chomp $olduserid;
    my ($userid) = $olduserid =~ /.*\\(\w+)/;

    my $path = "C:/Users/$userid/Desktop/";

    open to recommendations to determine current user bc after compiling my code is failing on path.

      my apologies yes error checking on path would help the problem is after compiling finding the current user is failing

      So why not check for errors after qx{}?

      But you should use %ENV or File::HomeDir->my_desktop

        use Win32; my $username = Win32::LoginName;