jkeenan1 has asked for the wisdom of the Perl Monks concerning the following question:
> perl -MWin32=CSIDL_LOCAL_APPDATA -le "print Win32::GetFolderPath(CSI +DL_LOCAL_APPDATA)" C:\Documents and Settings\DGolden\Local Settings\Application Data
This works on my system as well, but I'm having trouble translating that to code inside a program. Consider this:
my $realhome; if ($^O eq 'MSWin32') { use Win32 ('CSIDL_LOCAL_APPDATA'); $realhome = Win32::GetFolderPath('CSIDL_LOCAL_APPDATA'); } (defined $realhome) ? print "realhome: $realhome\n" : print "\$realho +me not defined\n";
This is generating a warning, then producing an answer suggesting that the CSIDL_LOCAL_APPDATA constant was not, in reality, imported:
Argument "CSIDL_LOCAL_APPDATA" isn't numeric in subroutine entry at im +port.pl line 9. realhome: C:\Documents and Settings\kbuser\Desktop
I'm puzzled about the "isn't numeric" warning: As I understand it, it's not supposed to be numeric because it'a a path (and I double-check Microsoft's information http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp on this).
What am I not getting? Thanks.
Jim Keenan
Update:Corrected typo in title.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 CSIDL_LOCAL_APPDATA
by holli (Abbot) on Aug 23, 2005 at 13:50 UTC | |
by jkeenan1 (Deacon) on Aug 23, 2005 at 14:33 UTC | |
by ww (Archbishop) on Aug 23, 2005 at 14:50 UTC | |
by jkeenan1 (Deacon) on Aug 23, 2005 at 15:19 UTC | |
|
Re: Win32 CSIDL_LOCAL_APPDATA
by xdg (Monsignor) on Aug 23, 2005 at 15:02 UTC | |
by jkeenan1 (Deacon) on Aug 23, 2005 at 15:23 UTC | |
by xdg (Monsignor) on Aug 23, 2005 at 16:51 UTC | |
by holli (Abbot) on Aug 23, 2005 at 17:59 UTC |