I'm coding a little script for windows. I'd like to know how to save some
data on a given preference file and some other data on a temp file. Can it
actually be done?
thanks ever so much
Maybe I don't see the forest for the trees, but what is the problem?
perldoc -f open
perldoc -f print
should have all you need. Maybe also have a look at
perldoc -q temp: "How do I make a temporary file name?"
jue
> I'm coding a little script for windows. I'd like to know how to save
> some data on a given preference file and some other data on a temp
> file. Can it actually be done?
Yes.
sherm--
I am so sorry...I meant to say: where are those directories on windows?
I tried accessing temp dir on win by usinf File::Spec
where the dir for preferences?
thanks
> I am so sorry...I meant to say: where are those directories on windows?
If you were programming in Python or Visual Basic, would
it be different directories?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
Same place as when programming in any other programming language. Why
would they change location just because you are using Perl?
>I tried accessing temp dir on win by usinf File::Spec
>
>where the dir for preferences?
Try "set" from the command line. Usually there are some environment
variables for those values.
jue
> What do you mean by 'preferences'?
>
> You may want File::HomeDir.
I guess on windows vista it should be: C:\Users\<user>\AppData\... (AppData
supposed to be hidden)
Have you tried:
my $tmpdir = $ENV{TEMP};
File::HomeDir->my_data returns what on a default XP install would be called
C:\Documents and Settings\<user>\Local Settings\Application Data
and you can retrieve the non-Local Settings path with
Win32::GetFolderPath(Win32::CSIDL_APPDATA())
Ben
> File::HomeDir->my_data returns what on a default XP install would be
> called
>
> C:\Documents and Settings\<user>\Local Settings\Application Data
>
> and you can retrieve the non-Local Settings path with
great! that's what I was looking for
>I am so sorry...I meant to say: where are those directories on windows?
See File::Temp and File::HomeDir on CPAN.
Less portable, it might not even work on somebody else's PC, is to use
some data available in the environment variables, see %ENV (perlvar).
--
Bart.