I wrote and use a module that provides a standardized logging mechanism to
STDOUT and to a defined log file. I have several Perl programs that run all
of the time and use this module. The log file is opened at the program start
and closed at the program end. There is nothing particularly fancy or
PROTECTED]
To: Dirk Bremer (NISC) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, October 01, 2004 15:44
Subject: RE: File Buffering
select YOURFILEHANDLE;
$| = 1;
# enjoy unbuffered file goodness
-Original Message-
From: Dirk Bremer (NISC) [mailto:[EMAIL PROTECTED]
Sent: Friday
- Original Message -
From: Bennett Haselton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 20, 2004 14:52
Subject: how to do a timeout of accept() in ActivePerl
However, I'm trying to do something similar in ActivePerl (v5.8.3 build
809) but the ActivePerl-Winfaq5.html
This has been an interesting exercise of the Camel book. What I finally
found and what seems to satisfy my requirements is to do the following in
the master program:
our %the_shared_hash;
do 'the_module.pm';
import the_module;
I have tested this by altering the contents of the module while the
- Original Message -
From: Richard Morse [EMAIL PROTECTED]
To: Ken Cornetet [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Dirk Bremer (NISC)
[EMAIL PROTECTED]
Sent: Monday, June 28, 2004 08:45
Subject: Re: :Oracle
On my computers, if I use SQL Worksheet, I connect using username
'XXuser
- Original Message -
From: Richard Morse [EMAIL PROTECTED]
To: Ken Cornetet [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Dirk Bremer (NISC)
[EMAIL PROTECTED]
Sent: Monday, June 28, 2004 08:45
Subject: Re: :Oracle
On my computers, if I use SQL Worksheet, I connect using username
'XXuser
Some light from Camel book 3rd edition,
12.6.1. Garbage Collection with DESTROY Methods:
When an interpreter shuts down, all its objects are destroyed,
which is important for multithreaded or embedded Perl applications.
Objects are always destroyed in a separate pass before ordinary
Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters
USA Central Time Zone
636-922-9158 ext. 8652 fax 636-447-4471
[EMAIL PROTECTED]
www.nisc.cc
- Original Message -
From: Lee Goddard [EMAIL PROTECTED]
To: Capacio, Paula J [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
Note the following code:
#! C:/perl/bin/perl -w
# AmsLog.pm 05/24/2004.
package AmsLog;
# Declare pragmas.
use diagnostics;
use strict;
use warnings;
use constant DEBUG = 0;
# Declare modules.
use FindBin qw($Bin);
use lib $Bin;
use Date::Format;
use Fcntl qw(:DEFAULT :flock);
use FileHandle;
- Original Message -
From: Mike Trotman [EMAIL PROTECTED]
To: Frank D. Gunseor [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; TELARO BARTOLOMEO
[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 08:58
Subject: Re: Passing command line options with ActivePerl
Do you have another program in your
What happens if you replace the:
LogClose(shift);
with
$_[0]-LogClose();
Cheers
Tobias
Note the following code:
sub DESTROY() {LogClose(shift); $Smtp-quit if (defined $Smtp)}
I am getting an error when the DESTROY sub invokes the
LogClose sub. The error is as follows:
It occurs because the only kind of variable allowed for specifying the
filehandle is a scalar--no array or hash elements. There are (or course)
several solutions. One is actually documented in the entry for print in
perlfunc:
print({$Self-{FH}} $TimeStamp$LogMsg\n);
Another possibility is
Hi,
I have a need to create a small app for our support organization which
primarily uses Windoze to do their day to day tasks. Since they are
not that command line savy I'd like to put together something that
allows
them to push a button or two to get their file(s) uploaded to various
- Original Message -
From: Joe Youngquist [EMAIL PROTECTED]
To: Dirk Bremer (NISC) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, April 09, 2004 13:29
Subject: Re: MySQL/Perl
from the DBI docs:
the connect string is:
$dbh = DBI-connect($data_source, $username, $auth, \%attr
Someone recently posted a code example using Win32::GUI to browse for a
folder, ala:
$Dir = GUI::BrowseForFolder(-title = Win32::GUI::BrowseForFolder test);
Is there a similar method to browse a folder for the files contained within
and to allow the selection of multiple files, returning the
-
From: Grant Babb [EMAIL PROTECTED]
To: Dirk Bremer (NISC) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 09:31
Subject: RE: Win32::GUI Question
File::Find performs that task quickly and efficiently. You can copy the
example from the POD and you are ready to go.
-Original
I have used Win32::Process in several scripts. what I can't figure out about
using it is how to create a minimized window. Looking at the constants used
with Win32:Process, I don't have a clue as to what some of them mean:
CREATE_DEFAULT_ERROR_MODE
CREATE_NEW_CONSOLE
CREATE_NEW_PROCESS_GROUP
- Original Message -
From: Arms, Mike [EMAIL PROTECTED]
To: 'Dax T. Games' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 13:03
Subject: RE: 'which' functionality in Perl
Dax T. Games [EMAIL PROTECTED] wrote:
How would I determine if a file existed in a
- Original Message -
From: alex p [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 11:42
Subject: Re: newbie hlelp!
Thank you all for replying, I am using the code below and I am still
unable
to get the correct date
code
opendir (DIR,
- Original Message -
From: $Bill Luebkert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 05:05
Subject: Re: pound sign trouble
[EMAIL PROTECTED] wrote:
If you redirect that output
to a file and then look at the file with an editor (Vim in my case),
This
- Original Message -
From: James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 22:14
Subject: Parsing test file question
Hi all,
I have a test file which conatin words separated by
comma and I would like to process and print the result
to an ouput file. The
- Original Message -
From: Beckett Richard-qswi266 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 18, 2003 10:07
Subject: RE: Trouble with my variables.
Still having harassments...
I now invoke the sub thusly...
update_value(ftp, $ftp{$key}{value}, $key);
The
- Original Message -
From: Jeff Slutzky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 13:13
Subject: socket application
I am attempting to make a socket server running on a Win98 platform and
have a socket client connecting from a SCO Unix platform. What
- Original Message -
From: Gerber, Christopher J [EMAIL PROTECTED]
To: 'Dirk Bremer (NISC)' [EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 15:25
Subject: RE: socket application
Dirk,
I had hacked together something like this in C at one point. I think I
have
a copy of the source
- Original Message -
From: Jeff Slutzky [EMAIL PROTECTED]
To: 'Dirk Bremer (NISC)' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 15:42
Subject: RE: socket application
I'm glad my question was inspiring. I am trying to get this to work on my
Win2000 Workstation
- Original Message -
From: Tillman, James [EMAIL PROTECTED]
To: 'Conrad, Ben' [EMAIL PROTECTED]; Perl-Win32-Users
[EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 11:58
Subject: RE: Globbing speed
Sure:
* Don't use fileglobs, and open a dirhandle instead. You'll get results
as
Capture the output of the Win9x ipconfig command, i.e.:
my @results = `ipconfig`;
You will have to parse the results slightly. This command also lists other
information that may be of interest.
Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters
USA Central Time Zone
636-922-9158
I would like to write a script to:
1. Start Excel
2. Open a new worksheet
3. Populate cells
4. Apply simple attributes to selected rows (i.e. bold font,
etc.)
While I have experience both with Perl and Excel, I have never
accessed Excel from Perl. Any pointers and tips on how to
get
Ullrich,
I suspect that your problem is that you are reading a large
file into an array, i.e.
(@inrecs = INFIL)
I think your will find that the program will work better if you eliminate
the array and instead read the input and write the output line by line rather
than all at once.
Dirk
Neil,
This is a little sub that I rolled up to provide the path,
filename, and extension:
sub Fparse($){ local $_ =
shift; my ($Delim, $Fp, $Fn, $Fe, $Pos1,
$Pos2);
# Check whether the filename contains
forward or backward slashes. $Delim = (index($_,'/')
-1) ? '/' : '\\';
# Find
- Original Message -
From: Laura Meli [EMAIL PROTECTED]
To: Perl-Win32-Users [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 07:41
Subject: Newbie Question
Hi everyone,
I am just starting out to use perl to write my test scripts. I was
wondering if there was a way to call one perl
Joe,
There have been some threads on this subject in the past concerning the
corruption of the perl\site\lib\ppm.xml file that stores all of the
information for ppm. You might be able to reconstruct this file by editing
it or other means, otherwise, reinstall your Perl installation and ppm will
I ran your code here in CDT:
58 52 10 23 9 102 3 295 1
Local: Wed Oct 23 10:52:58 2002
GMT: Wed Oct 23 15:52:58 2002
CDT = GMT - 6. MDT = GMT - 7. CST = GMT - 5. MST = GMT - 6. It looks to me
that the culprit is gmtime, it is not taking into account the daylight
savings time offset.
Dirk
fax 636-447-4471
[EMAIL PROTECTED]
www.nisc.cc
- Original Message -
From: Dirk Bremer (NISC) [EMAIL PROTECTED]
To: perl-win32-users [EMAIL PROTECTED]
Sent: Wednesday, October 23, 2002 10:57
Subject: Re: when localtime isn't?
I ran your code here in CDT:
58 52 10 23 9 102 3 295 1
Jasper,
You could try a low overhead version:
script_1.pl
use strict;
our $var1 = 'foo';
our $var2 = 'bar';
1;
script_2.pl
use strict;
require script_1.pl;
print In script_2.pl: $script_1::var1, $script_1::var2\n;
Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters
636-922-9158
Change your argument to: E:/BU_0/C/Prefs
The backslash is escaping the characters it preceeds. Alternative:
E:\\BU_0\\C\\Prefs
Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters
636-922-9158 ext. 8652 fax 636-447-4471
[EMAIL PROTECTED]
www.nisc.cc
- Original Message -
Are you trying to open a file or a directory? If a directory, you will need
a trailing slash. If a file, you will almost certainly need to specify a
file extension. What is your E drive, attached or networked? If networked,
have you tried the UNC name?
Dirk Bremer - Systems Programmer II -
I also will do the following:
Start-Settings-Control Panel-System-Advanced tab-Environment Variables
button-System variables list, select and edit the PATHEXT variable, add
'.PL;' to the variable string, and then click Okay on everything.
Dirk Bremer - Systems Programmer II - ESS/AMS - NISC
I'm output a massive list to STDOUT but wish to break it like the MORE
function in DOS. For instance I have a huge array and for each row the
array I'm outputting to STDOUT. But when the output reaches the end of
the
page, I would like to pause it. What's the best way to do this?
thanks
39 matches
Mail list logo