Re: Opening files

2006-09-18 Thread Barry Brevik
Shouldn't it be: open(FH,"<$file") or die "The file $file could not be found"; Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: what?!?

2006-10-16 Thread Barry Brevik
nd". If you are expecting the array index to begin at 0, then do some bounds checking on your "complicated function" so that it does not return out of scope arguments to your Perl functions. Barry Brevik ___ Perl-Win32-Users mailing list

Help with Win32::ODBC

2007-11-29 Thread Barry Brevik
I am using the Win32::ODBC module, and I continually get the following error message: Can't locate auto/Win32/ODBC/GetTypeInfo.al in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at odbcinfo.pl line 58 Indeed, there is no "filename.al" file of any kind on my disk anywhere, which leads m

Another Win32::ODBC issue

2007-12-03 Thread Barry Brevik
t I have been unable to find any function in Win32::ODBC that returns this prefix string. Can anyone point me in the right direction? Thank you, Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Win32::Lanman make computer go argh!

2008-07-09 Thread Barry Brevik
rl Command Line Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience." Here is a link to the actual error: http://www.manicreader.com/gallery/latest/perlerror.jpg I would appreciate any clues as to where to start looking to fix this pr

Problem with lanman

2008-08-06 Thread Barry Brevik
tc. Perl itself never issues any error despite "use strict; use warnings;", and the cmd window is never closed. So is this one of those things we live with that everyone knows about except me? Barry Brevik ___ Perl-Win32-Users mail

Can I 'yield' to the system?

2009-12-03 Thread Barry Brevik
at continuously loops waiting for something to do, and it would be good to give control back to the OS when idle. There is Win32::GUI::DoEvents(), but I am unsure if this really does the same thing. Barry Brevik ___ Perl-Win32-Users mailing list P

Help with Win32::Input

2010-02-05 Thread Barry Brevik
an idea on how to fix this? -Barry Brevik === use strict; use warnings; use Win32::Gui; use Win32::Console; my $STDOUT = new Win32::Console(STD_OUTPUT_HANDLE); my $STDIN = new Win32::Console(STD_INPUT_HANDLE); $STDIN->Mode(ENABLE_PROCESSED_INPUT

Help with subroutine

2011-03-02 Thread Barry Brevik
I have a subroutine to which I want to pass a hash by reference. In the real program, the hash in the caller starts out empty, and the subroutine adds values to it. The hash eventually becomes quite large, so I want the subroutine to add values to the caller's hash. The following sample code does

Help with Array of Arrays

2011-03-06 Thread Barry Brevik
I always get majorly confused when I have to deal with Arrays of Arrays, Arrays of Hashes etc. The Camel book has a good section on this, but it is not always enough. That's why each time I do one, I document it in a file on my disk. However, I have not done this one before. I am extracting Bill

Help with temp file name

2011-05-18 Thread Barry Brevik
Hello- >From time to time I need a subroutine to generate a temporary file name so I created an imperfect routine (shown below) to generate a file name based on the current time. The problem with this is that it will create only 1 'unique' name every second, and when the day rolls over, it will s

Temp file name

2011-05-18 Thread Barry Brevik
Oops, I guess it doesn't duplicate the next day. My bad. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Help with regex

2011-06-30 Thread Barry Brevik
$txt =~ s/^(.{1,39})/$1/; print "Resulting string: $txt\n"; Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Help with regex

2011-06-30 Thread Barry Brevik
Wow, thank you all for the many replies I received!! Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Help with file redirect

2011-07-05 Thread Barry Brevik
code and change every print statement. Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

List vs. Array

2011-08-19 Thread Barry Brevik
Since list traffic seems to be overly light, I'll post this slightly off-topic query. All of my Perl books seem to use the word "list" and "array" interchangeably. Is there a difference between a list and an array? (believe it or not, I'm not a newb). Barry B

RE: List vs. Array

2011-08-19 Thread Barry Brevik
t; To: perl-win32-users@listserv.ActiveState.com > Subject: Re: List vs. Array > > On 08/19/2011 04:24 PM, Barry Brevik wrote: > > Since list traffic seems to be overly light, I'll post this > slightly > > off-topic query. > > > > All of my Perl books seem to use the word "

Help with Win32::Process::Create()

2011-08-23 Thread Barry Brevik
I'm working on an app that periodically needs to execute outside procedures. Ideally, I want to launch the outside procedure in "fire and forget" mode; that is, I do not want to wait for the outside process to terminate. I ALREADY HAVE some code that does this (see below). My question is- is there

Keyboard handler

2011-09-01 Thread Barry Brevik
board input. I've been writing a routine that uses Win32::Console in the manner shown below. Anyway, writing this has become way complex, and I've lost my way. I'm wondering if anyone out there has some example code that they would be willing to

Help with array

2011-09-07 Thread Barry Brevik
use a loop, but is there a cleaner, more Perl-ish way of doing it? Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Help with array

2011-09-07 Thread Barry Brevik
The Camel book seems to say that splice will only remove or change elements and move them *down* if necessary. You must think I'm a raging newb, but I gotta admit, I've never used splice. Thanks, I'll check it out! Barry Brevik > -Original Message- > From:

RE: Help with array

2011-09-08 Thread Barry Brevik
Splice with a length of 0... I wish I had thought of that. Thank you! > Everybody's a 'newb' at stuff that haven't tried before. It > might help to think of inserting elements into an array as > replacing a section of length 0, when you read 'perldoc -f splice'. > > It might also be worth takin

Setting file server time

2011-09-26 Thread Barry Brevik
Using Perl 5.8.8. I have both of the Win32 books and I've googled for this but I've come up short. Does anyone know how to set the time on a Windows server from a remote machine? Barry Brevik ___ Perl-Win32-Users mailing list Perl-W

RE: Setting file server time

2011-09-26 Thread Barry Brevik
anner [mailto:tan...@optonline.net] > Sent: Monday, September 26, 2011 5:26 PM > To: Tobias Hoellrich; 'Barry Brevik'; > perl-win32-users@listserv.ActiveState.com > Subject: RE: Setting file server time > > NET TIME was my first thou

RE: Setting file server time

2011-09-29 Thread Barry Brevik
, Sep 28, 2011 at 4:04 AM, wrote: I've used Win32-OLE to start/execute processes on remote computers. In this scenario you could use Win32-OLE to call time -Original Message- From: perl-win32-users-boun...@listserv.activestate.com

Non-blocking keyboard?

2011-10-07 Thread Barry Brevik
27;, "\x08"; next;} # Backspace key. print chr($input[5]); } } } As an aside, I think we need to get more traffic on this list somehow. Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com T

RE: Non-blocking keyboard?

2011-10-10 Thread Barry Brevik
I want to thank those who responded; it was all good advice. It turns out that what I was looking for was GetEvents. I really need to pay more attention to the module docs. > > I think you wanted to call PeekInput() instead of Input() here. > > But GetEvents() may be even better if you only wan

Non blocking keyboard

2011-10-13 Thread Barry Brevik
Last week I had posted a query about getting keyboard input in a non blocking way. I received several replies, so I thought I would post back the code I developed which seems to work. This is not the code I will end up using; it is more like a proof of concept program. use strict; use warnings;

Array madness

2011-10-18 Thread Barry Brevik
ot;) as an ARRAY ref while "strict refs" in use at test42.pl line 39.". I know this smells like a newbie problem, but I'm not a newbie; nevertheless, I guess I do not know enough about array references yet. Barry Brevik == use

RE: Array madness

2011-10-18 Thread Barry Brevik
Ah, I see. Yes, that had eluded me. > Here you are flattening the @$record into @toparray. If you > wanted to keep the nested array structure, you would have to > push the array reference instead: > > push @toparray, $record; > > Or if for whatever reason you must create a copy of the d

Making directories

2011-10-24 Thread Barry Brevik
or me about how they create directories with Perl? Barry Brevik = use strict; use warnings; umask 0; my $thisPath = "c:\\temp\\megabom\\newdir"; unless (-d $thisPath) {mkdir $thisPath, 0777;} if (-r $thisPath) {print " Sub folder is read for eve

RE: Making directories

2011-10-25 Thread Barry Brevik
Thank you for the tips... I will try them. > -Original Message- > From: Kanhaiya Prasad [mailto:kpra...@aptaracorp.com] > Sent: Monday, October 24, 2011 10:08 PM > To: 'Sisyphus'; Barry Brevik; > perl-win32-users@listserv.ActiveState.com > Subject: RE

RE: Making directories

2011-10-25 Thread Barry Brevik
t; Sent: Monday, October 24, 2011 6:00 PM > To: Barry Brevik; perl-win32-users@listserv.ActiveState.com > Subject: Re: Making directories > > > - Original Message - > From: "Barry Brevik" > > > Does anyone have advice for me about how they create >

RE: Making directories

2011-10-25 Thread Barry Brevik
PPN with the repositories I have configured only has the older version of File::Path that only has 'mkpath'. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Justin Allegakoen

RE: Making directories

2011-10-26 Thread Barry Brevik
ating the "bad" directory), this is when trying to overwrite the files fails. Sorry for all the parens. I hope that makes it more clear, and I should have said that in my 1st post. Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-U

Perl 5.14 and Win32

2011-11-01 Thread Barry Brevik
about any other Win32 extensions? I require these extensions, so I don't know what to do. Thanks, Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Perl 5.14 and Win32

2011-11-01 Thread Barry Brevik
Daemon Do these all work under 5.14? Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: How to split up a string with carriage returns into an array

2011-11-04 Thread Barry Brevik
question, this works for me (on Windows): use strict; use warnings; my $msg = 'this is line one this is line 2 this is line III'; print "original string:\n$msg\n\n"; print "the array:\n"; my @ans = split /\n\r/, $msg; print "$_\n

Help with error msg

2011-11-04 Thread Barry Brevik
0 is the one where the same message is in the comment. I realize that the sample code has some elements specific to my environment, but it is the best I could do, and it is pared down quite a bit. Thanks, Barry Brevik -- use strict; use warnings; use Win32::ODB

Problem with regex

2011-11-09 Thread Barry Brevik
laces the final match. I have just re-read the camel book section on regexes and have tried many variations, but apparently I'm too close to it to see what must be a simple answer. BTW, if you guys think I'm posting too often, please say so. Barry Brevik

Re:Problem with regex

2011-11-17 Thread Barry Brevik
Hi Barry, On Thu, Nov 10, 2011 at 2:34 AM, Barry Brevik wrote: > Below is some test code that will be used in a larger program. > > In the code below I have a regular expression who's intent is to look > for  " <1 or more characters> , <1 or more characters&g

Re:Problem with regex

2011-11-17 Thread Barry Brevik
feel like I'm the only one posting questions to the list, and it alarms me that the traffic is so low... I would really regret having this list go dormant, as I have learned so much, especially from reading threads I did not post. And the people are really friendly. Barry Brevik

Re:Problem with regex

2011-11-17 Thread Barry Brevik
ork a little better, but will not deal with spaces between fields, which are not supposed to be there anyway. Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Re:Problem with regex

2011-11-17 Thread Barry Brevik
> Don't know if it helps, but I seem to have installed > Text::CSV_XS on Activestate 5.14.1 build 1401. I'm on Perl 5.8.8 because my Perl DevKit only works on that version. Barry Brevik ___ Perl-Win32-Users mailing list

Problem with recursive routine

2011-11-28 Thread Barry Brevik
I'm having a problem with a recursive routine that enumerates a directory tree and all of its files. It works well, except when it goes down 1 level from the top directory, I get this message: Use of uninitialized value in addition (+) at test61.pl line 61. I've been fighting this thing for a c

RE: Problem with recursive routine

2011-11-28 Thread Barry Brevik
Thanks. That is a cool observation. -Original Message- From: Tobias Hoellrich [mailto:thoel...@adobe.com] Sent: Monday, November 28, 2011 3:47 PM To: Barry Brevik; perl Win32-users Subject: RE: Problem with recursive routine You are not changing the directory while traversing. Whenever

Problem with recursive routine

2011-12-05 Thread Barry Brevik
About a week ago, I posted a question about a recursive directory enumeration function that I was having trouble with, and Tobias Hoellrich wrote back and pointed out my ridiculous oversight. I thought that I would post the resulting code as a point of interest. It is kinda bloated with a bunch of

Daylight Savings Time?

2012-01-26 Thread Barry Brevik
the daylight savings time state. I want something light weight (rather not use a module) and it only has to deal with the PST timezone. Has anyone found a Win32:: method that will retrieve the DST state from Windows? Also, when the date is expressed in that format, is it supposed to represent UTC

RE: Daylight Savings Time?

2012-01-26 Thread Barry Brevik
> In list context it returns the DST state as the last > value so (localtime())[-1] would give that value. OK, that is just lame of me to miss that. Thank you so much. Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32

RE: Daylight Savings Time?

2012-01-26 Thread Barry Brevik
On Thu, 26 Jan 2012, Barry Brevik wrote: > > In list context it returns the DST state as the last value so > > (localtime())[-1] would give that value. > > OK, that is just lame of me to miss that. Thank you so much. > Not sure if this matters to you, but at least olde

Turn off monitor?

2012-04-06 Thread Barry Brevik
I've been Googling for 2 hours and do not see what I'm looking for. Does anyone know how to turn on/off the computer's monitor using Win32 modules? Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.Act

help with Win32

2012-06-04 Thread Barry Brevik
s in the domain if necessary. In fact, I'm willing to jump through a fair number of hoops to collect this information. Does anyone out there know how to do this, or at least have an idea as to how to do this? Thanks in advance, Barry Brevik

RE: Perl-Win32-Users Digest, Vol 70, Issue 1

2012-06-04 Thread Barry Brevik
Thank you for the detailed response, even if it is depressing. Barry Brevik > On the other hand, if you are really asking the question "from", > you have to go to the event logs; there, you can get if a login > was local or via the network.  The problem, of course, i

RE: New W2K8 I/O priority

2012-06-20 Thread Barry Brevik
ight want to pass. Google the Win32::Process module for the priority classes as well as other flags, etc. Barry Brevik - From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activesta

Help with NetAdmin::GetServers

2012-06-25 Thread Barry Brevik
o query for domain controllers: ", Win32::FormatMessage(Win32::NetAdmin::GetError()), ".\n"); } ERROR message is: Unable to query for domain controllers: No more connections can be made to this remote computer at this time because there are already a

Win32::LookupAccountSID()

2012-07-10 Thread Barry Brevik
8519-1677701-1424}'; my $accountname = ''; my $siddomain = ''; my $sidtype = ''; Win32::LookupAccountSID("qbert", $usersid, $accountname, $siddomain, $sidtype); print "error..: ", Win32::FormatMessage(Win32::GetLastError()), "\n&q

RE: Win32::LookupAccountSID()

2012-07-10 Thread Barry Brevik
Thanks for posting!! -Original Message- From: Ken Cornetet [mailto:ken.corne...@kimball.com] Sent: Tuesday, July 10, 2012 11:39 AM To: Barry Brevik; perl Win32-users Subject: RE: Win32::LookupAccountSID() http://code.activestate.com/lists/perl-win32-users/26301/ -Original Message

Help with LookupAccountSID (again)

2012-07-18 Thread Barry Brevik
there know how to do this? TIA, Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Help with LookupAccountSID (again)

2012-07-18 Thread Barry Brevik
Ay Caramba!! I thank you for the post, but my skills are too low to reverse that monstrosity! Barry Brevik -Original Message- From: Cordoni, Ray [mailto:rcord...@richmond.ca] Sent: Wednesday, July 18, 2012 11:38 AM To: Barry Brevik; perl Win32-users Subject: RE: Help with

RE: Help with LookupAccountSID (again)

2012-07-18 Thread Barry Brevik
I tried to implement that call using Win32::API, but I just don't know enough about Windows to make it work. Thank you for posting, Barry Brevik -Original Message- From: Howard Tanner [mailto:tan...@optonline.net] Sent: Wednesday, July 18, 2012 11:31 AM To: Barry Brevik; Perl-

RE: Help with LookupAccountSID (again)

2012-07-18 Thread Barry Brevik
Thank you again. I saw that, but it looks like it might not be available to Perl 5.14 and I am looking to upgrade. Barry Brevik -Original Message- From: Howard Tanner [mailto:tan...@optonline.net] Sent: Wednesday, July 18, 2012 12:11 PM To: Barry Brevik Cc: Perl-Win32-Users

RE: Help with LookupAccountSID (again)

2012-07-18 Thread Barry Brevik
nd of call into an XS module or something. Thank you for posting, Barry Brevik -Original Message- From: Steven Manross [mailto:ste...@manross.net] Sent: Wednesday, July 18, 2012 5:07 PM To: Barry Brevik; perl Win32-users Subject: RE: Help with LookupAccountSID (again) What about the foll

Help with Win32::GUI

2012-09-07 Thread Barry Brevik
x27;m sorry that it is about 90 lines in length. Can anyone help? Thank you, Barry Brevik --- use strict; use warnings; use Win32; use Win32::GUI(); my $main = Win32::GUI::Window -> new ( -name => 'Main', -title => 'Test v0.1', -widt