OLE - on Pagebreak?

2001-01-31 Thread Goodier, Colin R

Hi,

Using OLE to control Word, I want to set up a row of column-headings on each
page, at specific tab-points? What is the best way to do this? Is there a
way of
say something like 'on PageBreak do this' ? I think putting them in the
header is too restrictive in terms of the width it allows.

Colin


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: -d not identifying a directory?

2001-01-31 Thread Thiebaud Richard

Details?  do you have a code snippet?  What is the printout from "perl -V"?
In a quick and dirty test, -d works for me on Activestate build 522.

-Original Message-
From: Lee [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 10:42 AM
To: [EMAIL PROTECTED]
Subject: -d not identifying a directory?


Does anyone know any reason why -d will not detect a directory?
The code is fine on other platforms.

"This is perl, v5.6.0 built for MSWin32-x86" - apache.org perl.

Cheers,
Lee Goddard
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: file-uploads send as attachments

2001-01-31 Thread Nikola Knezevic

Dana 30.01.01, Paul Popour napisa:

   But, what to do if there are more file-upload fields???
   Simple solution is to repeat above algorhythm for every file. No so
   elegant... Is there a better way to accomplish the same thing

 I believe the proper format for multi-file attachments in Mail::Sender is
 $output = "$file1, $file2, $file3";
  ref ($sender = new Mail::Sender({from = $from,
  smtp = $smtp})) or die "$Mail::Sender::Error\n";
  (ref ($sender-MailFile({to =$recipients, subject = $subject,  msg =
 $msg,  file = $output }))
and print "Mail sent OK.\n") or die "$Mail::Sender::Error\n";
  }


OK, I know that. But the problem is (once more):
CGI passes file-handle to file that is uploaded (and I expect it isn't on
the systems' file-system. Mail::Sender expects filename. How to connect
these two?? Option is to create tempfile, flush from the filehandle to
tempfile and finally add that file to message. Then, repeat this for every
file. (message than has mult attachments). But, I want to skip 'flush from
filehandle to tempfile' and pass FH directly to Mail::Sender::SendFile.

BTW, is there some module for creating temp files. (something like mk_temp
in linux)???
-- 
... Vriste mala deca na haubi moga keca.

 - --- -- ---=- --==---===-[Nikola Knezevic]---===+
+- -=- -==--=- -=-- --- -- - http://users.hemo.net/indy --- -- -


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Background

2001-01-31 Thread Thiebaud Richard

 From: Christopher Hahn [EMAIL PROTECTED]
 Subject: Background
 I have successfully use the Proc::Background module
 to run an NT batch file in the bacground.

 However, the bat file's standard out is still spewed
 at the command line.  Additionally, this bat file
 has pauses that require input. I want to redirect

I'm not familiar with Proc::Background, running the command shell with the
batch file as a parameter works on my system.  You can start it using either
"win32:process::create or by running the start command from system.

For example:

Batch file c:\a.bat

cat c:\autoexec.bat
echo this is line 2 of a.bat
pause
echo this is line 2 of a.bat

Perl script:

use Win32::Process;
print "line1\n";
my $shell= $ENV{'COMSPEC'};
system "start /B $shell /c c:\\a.bat nul c.txt";
print "line2\n";
Win32::Process::Create($ProcessObj,
   $shell,
   "$shell /c c:\\a.bat nul d.txt",
   0,
   NORMAL_PRIORITY_CLASS,
   "c:\\")|| die "process create failed";
print "line3\n"



works for me, and puts the output from the script (including the output from
cat) to c.txt and d.txt.  ("Cat" is a port of the GNU cat, which just lists
a file.)



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: -d not identifying a directory?

2001-01-31 Thread $Bill Luebkert

Lee wrote:
 
 Does anyone know any reason why -d will not detect a directory?
 The code is fine on other platforms.
 
 "This is perl, v5.6.0 built for MSWin32-x86" - apache.org perl.

More than likely you are doing something wrong.  Post a snippet and 
make sure you include the fact that you know what working directory 
you are in when you do the -d or that you fully qualify the -d object 
in question.

-- 
  ,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
 (_/   /  )// //   DBE Collectibles   http://www.todbe.com/
  / ) /--  o // //  Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/__/_/_http://www.freeyellow.com/members/dbecoll/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: file-uploads send as attachments

2001-01-31 Thread $Bill Luebkert

Nikola Knezevic wrote:
 
 Dana 30.01.01, Paul Popour napisa:
 
But, what to do if there are more file-upload fields???
Simple solution is to repeat above algorhythm for every file. No so
elegant... Is there a better way to accomplish the same thing
 
  I believe the proper format for multi-file attachments in Mail::Sender is
  $output = "$file1, $file2, $file3";
   ref ($sender = new Mail::Sender({from = $from,
   smtp = $smtp})) or die "$Mail::Sender::Error\n";
   (ref ($sender-MailFile({to =$recipients, subject = $subject,  msg =
  $msg,  file = $output }))
 and print "Mail sent OK.\n") or die "$Mail::Sender::Error\n";
   }
 
 OK, I know that. But the problem is (once more):
 CGI passes file-handle to file that is uploaded (and I expect it isn't on
 the systems' file-system. Mail::Sender expects filename. How to connect
 these two?? Option is to create tempfile, flush from the filehandle to
 tempfile and finally add that file to message. Then, repeat this for every
 file. (message than has mult attachments). But, I want to skip 'flush from
 filehandle to tempfile' and pass FH directly to Mail::Sender::SendFile.

$tmpfilename = $cgi-tmpFileName($filename);

should get you the temp filename that CGI used.

 BTW, is there some module for creating temp files. (something like mk_temp
 in linux)???

perlfaq5:

  How do I make a temporary file name?

Use the `new_tmpfile' class method from the IO::File module to get a
filehandle opened for reading and writing. Use this if you don't need to
know the file's name.

use IO::File;
$fh = IO::File-new_tmpfile()
or die "Unable to make new temporary file: $!";

Or you can use the `tmpnam' function from the POSIX module to get a
filename that you then open yourself. Use this if you do need to know
the file's name.

use Fcntl;
use POSIX qw(tmpnam);

# try new temporary filenames until we get one that didn't already
# exist;  the check should be unnecessary, but you can't be too careful
do { $name = tmpnam() }
until sysopen(FH, $name, O_RDWR|O_CREAT|O_EXCL);

# install atexit-style handler so that when we exit or die,
# we automatically delete this temporary file
END { unlink($name) or die "Couldn't unlink $name : $!" }

# now go on to use the file ...

If you're committed to doing this by hand, use the process ID and/or the
current time-value. If you need to have many temporary files in one
process, use a counter:

BEGIN {
use Fcntl;
my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMP} || $ENV{TEMP};
my $base_name = sprintf("%s/%d-%d-", $temp_dir, $$, time());
sub temp_file {
local *FH;
my $count = 0;
until (defined(fileno(FH)) || $count++  100) {
$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
}
if (defined(fileno(FH))
return (*FH, $base_name);
} else {
return ();
}
}
}


-- 
  ,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
 (_/   /  )// //   DBE Collectibles   http://www.todbe.com/
  / ) /--  o // //  Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/__/_/_http://www.freeyellow.com/members/dbecoll/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Version Number of Package

2001-01-31 Thread $Bill Luebkert

"Purcell, Scott" wrote:
 
 How does one get the version of a installed package?
 
 EG. If I want to know which version of the DBI I have, what do I do?

When in doubt, use your trusty editor and search for version (upper/lower case).

-- 
  ,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
 (_/   /  )// //   DBE Collectibles   http://www.todbe.com/
  / ) /--  o // //  Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/__/_/_http://www.freeyellow.com/members/dbecoll/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regex Help

2001-01-31 Thread Wagner-David

I tried this and it seemed to work:

my $InputLine = '(! SUBSTR(DB.USER1,2,5)="9") .AND.
(LEFT(DB.USER1,1)"1") .AND. (ALLTRIM(DB.OUNCEWT)"2")';
my $InputLine1 = '(! SUjSTR(DB.USER1,2,5)="9") .AND.
(LEFT(DB.USER1,1)"1") .AND. (ALLTRIM(DB.OUNCEWT)"2")';
my $Str = '(! SUBSTR(DB.USER1,2,5)="9") .AND. (LEFT(DB.USER1,1)"1")
.AND. (ALLTRIM(DB.OUNCEWT)"2")';

if ( $InputLine =~ /\Q$Str\E/io ) {
   print "Found the string in InputLine!!\n";
 }else {
   printf "No hit: InputLine:\n%-s\nSearch:\n%-s\n", $InputLine, $Str;
 }

if ( $InputLine1 =~ /\Q$Str\E/io ) {
   print "Found the string in InputLine1!!\n";
 }else {
   printf "No hit: InputLine1:\n%-s\nSearch:\n%-s\n", $InputLine1, $Str;
 }

running on win2000 and AS623.

Wags ;)

-Original Message-
From: Dirk Bremer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 15:03
To: perl-win32-users
Subject: Regex Help


I have a complicated string:

(! SUBSTR(DB.USER1,2,5)="9") .AND. (LEFT(DB.USER1,1)"1") .AND.
(ALLTRIM(DB.OUNCEWT)"2")

that I want to search for and them replace. I have tried this with no luck:

if ($InputLine =~ /\(\! SUBSTR\(DB\.USER1,2,5\)\=\"9\") \.AND\.
\(LEFT\(DB\.USER1,1\)\\"1\"\) \.AND\. \(ALLTRIM\(DB\.OUNCEWT\)\\"2\"\)/io)

I have also tried this with no luck:

if ($InputLine =~ /\(ALLTRIM\(DB\.OUNCEWT\)/io)

In the last example, I get a regex error about unbalanced paranthesis. I
would really like to assign the whole string to a scalar:

$Str = "\(\! SUBSTR\(DB\.USER1,2,5\)\=\"9\") \.AND\.
\(LEFT\(DB\.USER1,1\)\\"1\"\) \.AND\. \(ALLTRIM\(DB\.OUNCEWT\)\\"2\"\)"
if ($InputLine =~ /$Str/io)

I welcome your suggestions.

Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471

mailto:[EMAIL PROTECTED]


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users