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

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.

Replies are listed 'Best First'.
Re^7: perlApp --gui and chdir
by Anonymous Monk on Jul 01, 2012 at 22:43 UTC

    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;