Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I can't help but reply to some of this.

%TEMP% and %SYSTEMROOT% will work only from the shell. To access these in perl, use $ENV{TEMP} and $ENV{SYSTEMROOT}.

Yes, the "Appliation Data" directory under "Documentions and Settings" is the right thing to use for DATA if you're on Win2k or XP, but it doesn't exist on other versions of Windows. To play it safe, use the Win32::GetFolderPath() function, which will always return the proper path regardless of which OS you're on, what changes the network admin has made, or what the user's preferences are. (Try CSIDL_APPDATA or CSIDL_PERSONAL)

The registry is NOT just for system-specific things. Almost Every application on your computer uses the registry to store its configuration info. It was designed to alleviate the problems of having thousands of configuration files scattered all over the machine, each with a different syntax.

To summarize, DATA (like large files) should go in whatever path Win32::GetFolderPath() gives you, and CONFIG (like simple settings) should go in the registry.

Most appliations do NOT use INI files under Winnt. This was common in the Windows 3.1 days, but not any more. The files there are only for legacy compatibility. (And "Winnt" doesn't even exist in the newer OSes like XP)

</rant>


In reply to Re: Re: "Porting" scripts to Win32 by meetraz
in thread "Porting" scripts to Win32 by b10m

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-24 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found