Hi,
Can a 32 bit integer be written to a file in such a way that it is stored in
only 4 bytes ?
I thought that binmoding the filehandle might do this - but I'm finding
that a number such as 31554399 is consuming 8 bytes (one byte for each
digit), irrespective of whether the filehandle has been
Sisyphus wrote:
Hi,
Can a 32 bit integer be written to a file in such a way that it is stored in
only 4 bytes ?
I thought that binmoding the filehandle might do this - but I'm finding
that a number such as 31554399 is consuming 8 bytes (one byte for each
digit), irrespective of
You're writing the string 31554399 to the file.
Use something like
print WRITE pack(I, $num);
See perldoc -f pack
Dietmar
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von
Sisyphus
Gesendet: Mittwoch, 20. Februar 2002 09:51
An: [EMAIL
- Original Message -
From: $Bill Luebkert [EMAIL PROTECTED]
You need to binmode the FH and pack the data. Check out pack/unpack
in perlfunc man page. Your filesystem may be big-endian or little-endian
which will also affect it and transporting to a different endian system
may be
Peter Eisengrein [mailto:[EMAIL PROTECTED]] suggested:
print `cd`;
This is very bad advice for several reasons:
- depends on cd being in $PATH (or builtin to the shell)
- Perl code need not be started from current directory
If one needs to find his script's home directory, then
FindBin is
Hi,
Ok - so I'm running the code below and it's working as I want - unless
either of the 2 values being written to the file is 10. (ie unless $num = 8
or 10).
If the value is 10, then I get a couple of warnings about 'use of
uninitialised value'.
'10' is the only value I've found that exhibits
Hah! I know what the problem is!
ASCII character 10 happens to be either \n -- so when you print this number to
the file, you get a newline character for one of the bytes, so your
while(READ) loop finds three lines in the file instead of two.
I think that in order to read this number back out
Nearly everything IS possible in Perl.
In Python for Win32, a tool called MakePy makes it possible to use early-bound
automation. If you'd like to read about this, see chapter 12 of Mark Hammond's book
_Python Programming on Win32_.
Of course, Python is all open-source, so you can
Your current problem may be that you do not have the adssecurity.dll on
your system, or it is not registered. This DLL registers the ADsSID Object
on your system, so OLE knows what it is, and how to handle this object.
This dll is found as part of the ADSI SDK, on M$' site.
Mail me offline if
Er... following up on my own suggestion ...
MakePy works in large part by generating lots of Python code corresponding to the OLE
object to be bound.
Rather than recreating all of MakePy in Perl, it would be much faster to modify MakePy
so that it can optionally generate Perl code which is
Hello,
I'm trying to manage Ms.Exchange accounts via Win32::OLE. What I've
read says you need to install Ms.'s ADSI (Active Directory Services
Interface) as well as adssecurity.dll (which you then register
manually). I've installed ADSI v2.5, but can't find adssecurity.dll
anywhere. One might
-Original Message-
Behalf Of Morse, Richard E.
Hah! I know what the problem is!
ASCII character 10 happens to be either \n -- so when you print
this number to
the file, you get a newline character for one of the bytes, so your
while(READ) loop finds three lines in the file
All below is a subroutine I have for a TK app which launches the default
browser and sends it to a given URL.
I would also like to 'TAG' the browser with a 'name' so that I can send
different URL's to different Browsers (this would be great).
What I would like to do is pass options to the
On Thu, 21 Feb 2002 01:11:01 +1100
Sisyphus [EMAIL PROTECTED] wrote:
Hi,
Ok - so I'm running the code below and it's working as I want - unless
either of the 2 values being written to the file is 10. (ie unless $num = 8
or 10).
If the value is 10, then I get a couple of warnings about
- Original Message -
From: Jeffrey [EMAIL PROTECTED]
To: Perl win32 [EMAIL PROTECTED]
Sent: Wednesday, February 20, 2002 12:36 PM
Subject: Strange if syntax
I'm poking through someone else's code, and found
this:
$skip_path_checks = ; if ($skip_path_checks) {;};
Does this make
I'm using the following code in an attempt to control IE through OLE,
the code is what seems right (to me) from the Win32::OLE Browser.
use Win32::OLE;
my $url = 'http://www.google.com/';
my $IE = Win32::OLE-new('InternetExplorer.Application',
'Quit') or warn
--- Edward G. Orton [EMAIL PROTECTED] wrote:
Essentially (with the ';' in place) it would mean:
Set the value of $skip_path_checks to nothing
If $skip_path_checks HAS a non-zero value do
nothing.
In this situation, there is no point in checking if
it has a
non-zero value, since it has just
Hello,
I've been playing around with spawning and populating Excel
spreadsheets from PERL scripts.
There are a number of modifications I would like to make to the sheets
from PERL (i.e Format-Columns-Auto Width.) However, I have not found
a good reference to potential Excel commands available
- Original Message -
From: Daniel Needles [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 20, 2002 4:54 PM
Subject: Perl, OLE, and Excel commands.
Hello,
I've been playing around with spawning and populating Excel
spreadsheets from PERL scripts.
There are a
-Original Message-
From: Edward G. Orton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 2:03 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Perl, OLE, and Excel commands.
- Original Message -
From: Daniel Needles [EMAIL PROTECTED]
To: [EMAIL
Hi,
I am using perl to execute store procedure using record set
$rs-open(EXEC spProcedure,$conn);
But could not get any record back (I got $rs-RecordCount = -1)
But in I can run EXEC spProcedure in Sql Query Analyzer and have records
returned.
The perl program works fine if I run SQL
I've been fighting this all day. I need to migrate about 30 local
groups and about 500 domain users from an NT 4.0 box to a Win2000 box.
I've been able to create the groups using Win32::Lanman, but haven't
been able to add users to those groups with either Win32::Lanman or
Win32::NetAdmin. I'm
This works for me using Lanman 1.0.9.1 and 1.0.9.2. What code are you
using? What errors are you getting? More info would help.
if(!Win32::Lanman::NetGroupSetUsers($PDC, $GrpAllowed, \@members1))
{
$^E = my $Error = Win32::Lanman::GetLastError();
LogText($AppPath\\$LogFile,
I have a PC in a NOC running several applications in windows. The PC has a
very large display and is being used primarily for display-only. I would
like to automatically switch between the windows every 10 seconds (i.e.,
take turns bringing each one to the front.) I've played around a little
Note that in general you can switch Windows tasks by using Alt+Tab.
Here's a macro in an unrelated macro language (Dragon NaturallySpeaking, but that's
irrelevant) ... it brings up the Nth task on the taskbar.
SendSystemKeys {Ctrl+Esc}
Wait 20
SendSystemKeys {Esc}
os$ =
25 matches
Mail list logo