Re: [mod_perl 2] Intermittent crashes on PostgreSQL 9.0.1 + ActivePerl 1007 + Apache 2.2.17 on Win2k3sp2
I've updated it on StackOverflow with a few more details, if anybody has a minute to look at it. Thanks for your time, Kev On Thu, Nov 11, 2010 at 5:21 PM, Kevin Field kevinjamesfi...@gmail.comwrote: Hi everyone, I recently asked a question on StackOverflow about some intermittent crashes that have been giving us problems lately. I believe they started since our upgrade to Apache 2.2.17, if that helps. The full description is here: http://stackoverflow.com/questions/4072201/help-debug-crash-on-postgresql-9-0-1-activeperl-1007-apache-2-2-17-on-win2k3s If anyone could help me out, that would be great. Thanks, Kev ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[mod_perl 2] Intermittent crashes on PostgreSQL 9.0.1 + ActivePerl 1007 + Apache 2.2.17 on Win2k3sp2
Hi everyone, I recently asked a question on StackOverflow about some intermittent crashes that have been giving us problems lately. I believe they started since our upgrade to Apache 2.2.17, if that helps. The full description is here: http://stackoverflow.com/questions/4072201/help-debug-crash-on-postgresql-9-0-1-activeperl-1007-apache-2-2-17-on-win2k3s If anyone could help me out, that would be great. Thanks, Kev ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Win32::OLE on MS Word using Selection.Find.Execute
Hi Peter, This is a translation of a script from technet that works: use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; # http://www.microsoft.com/technet/scriptcenter/resources/officetips/may05 /tips0512.mspx my $word = new Win32::OLE 'Word.Application','' or die Cannot start word!\n; $word-{visible}=1; my ( $file, $text ) = @ARGV; my $doc = $word-Documents-Open( $file ); $selection = $word-Selection; $selection-Find-{Text} = $text; $selection-Find-{Forward} = TRUE; $selection-Find-{MatchWholeWord} = TRUE; if ( $selection-Find-Execute ) { print The search text was found\n; } else { print The search text was not found\n; } Cheers, Kev. -Original Message- Date: Sun, 12 Sep 2010 16:43:24 -0400 From: Peter Buck pb...@his.com Subject: Win32::OLE on MS Word using Selection.Find.Execute To: perl-win32-users@listserv.ActiveState.com Message-ID: 4c8d3b6c.8010...@his.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Does anyone have an example of a perl script acting on MS Word documents using Win32::OLE and Selection.Find.Execute? I have read the Win32 man page but its examples for Excel and Access don't help. I found a Powershell script that does what I want but can't translate. The parts I'm confused on are (1) setting the parameters used in the Selection.Find.Execute() invocation (particularly the boolean values, since perl doesn't do booleans) and the actual invocation of Selection.Find.Execute(). I did find an example using $search- Execute() but this doesn't appear to allow setting all the parameters that Selection.Find.Execute() does. Also, it operates on $doc- Content-Find while Selection.Find.Execute() operates on $doc-Selection (if I'm right). And I'm using Homekey(6) to take me to the top of the document, which is linked to Selection and doesn't seem to work in my $doc-Content-Find attempts. Any help or direction to documentation much appreciated. Thanks - Toolsmith # ExpandAcronyms.ps1 # read acronym list, expand acronyms in target MS Word document # syntax: ExpandAcronyms wordDocument function make-change { $FindText = $args[0] $FullText = $args[1] $ReplaceText = $FullText ($FindText) $ReplaceAll = 1 $FindContinue = 1 $MatchCase = $True $MatchWholeWord = $True $MatchWildcards = $False $MatchSoundsLike = $False $MatchAllWordForms = $False $Forward = $True $Wrap = $FindContinue# don't want it wrapping, wish I knew what this meant $Format = $False $objWord.Selection.HomeKey(6) Null $result = $objSelection.Find.Execute($FindText,$MatchCase, $MatchWholeWord,$MatchWildcards,$MatchSoundsLike, $MatchAllWordForms,$Forward,$Wrap,$Format, $ReplaceText,$ReplaceAll) if ( $result -eq $true ) { $Findtext|$FullText } } if ( $args.count -lt 1 ) { cd $env:temp $strWordFile = [string](resolve-path(Read-Host Enter Path of Word file to be processed)) } else { $strWordFile = [string](resolve-path($args[0])) } $objWord = New-Object -ComObject word.application $objWord.Visible = $True $objDoc = $objWord.Documents.Open($strWordFile) $objSelection = $objWord.Selection $d = get-content d:/temp/acronyms.txt# read file of acronym | definition foreach ( $l in $d ) { ($acro, $def) = $l.split('|')# build array of acronym, definition make-change $acro $def } Finished $objWord.Selection.HomeKey(6) Null This e-mail (including any attachments) may be confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail(and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and does not impose any legal obligation upon the Council or commit the Council to any course of action. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [Fwd: storable and Win32::OLE::Variant]
h for some reason, i thought that use Win32::OLE::Variant did stringify Win32::OLE::Variant objects. my understanding now is that it just makes these display correctly if they are dates. i am a newbie to Win32::OLE::Variant. could you point me towards some example code that shows how to: 1. test whether or not a variable is indeed a Win32::OLE::Variant date object 2. stringify a Win32::OLE::Variant date object thanks, kevin Jan Dubois wrote: On Fri, 01 Feb 2008, Kevin Beverly wrote: i have an active state perl program that parses ms excel files for loading into postgresql. i use use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; to get the dates as text from a spreadsheet. i store the data as an array of hashes and write it to disk with storable. everything works fine until i try to retrieve the storable file. as soon as it hits that date field, perl crashes. it works fine, tho if i format the date fields as text. obviously, this could be an issue with storable. i sent this issue to those folks as well. You cannot freeze() Win32::OLE::Variant objects because they are implemented in C and have additional information hanging on to them that Storable knows nothing about. This could be made to work for most Variant types by adding special Storable freeze/thaw hooks to Win32::OLE::Variant (e.g. it would obviously not work for VT_DISPATCH and VT_OBJECT). I'll file this as an enhancement request for Win32::OLE. For the time being it would probably be easiest to stringify Win32::OLE::Variant objects before freezing them. Cheers, -Jan -- *** Kevin Beverly Systems Analyst/Programmer SCHARP / HIVNET Statistical Center 1100 Fairview Ave. North, LE-400 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: [EMAIL PROTECTED] Phone: 206-667-6991 Fax: 206-667-4812 *** CONFIDENTIALITY NOTICE: This e-mail message and any attachments may be confidential and privileged. If you are not intended to receive this message, please notify the sender and destroy the message. Thank you. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Fwd: storable and Win32::OLE::Variant]
hi, i have an active state perl program that parses ms excel files for loading into postgresql. i use use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; to get the dates as text from a spreadsheet. i store the data as an array of hashes and write it to disk with storable. everything works fine until i try to retrieve the storable file. as soon as it hits that date field, perl crashes. it works fine, tho if i format the date fields as text. obviously, this could be an issue with storable. i sent this issue to those folks as well. let me know if you would like more details. thanks, kevin ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Problem returning empty Safearray from OLE Component
Hi all,I hope that somebody can help me witha problem that I am having whilereturning a 1D Safearray to a Perl client from an OLE component, everything is OK when the array has some elements, but if the array is empty I get the following error:Win32::OLE(0.1704) error 0x8002000b: "Invalid index"I am using Active State Perl Version 5.8.8, Build 819. I am testing under windows XP, service pack 2, and I am building my OLE interface with Visual Studio 6, SP6.I have created a cut-down COM object to test the problem, its interface supports IDispatch and is OLE Automation compatible. In the IDL file the test method is declared as: [id(1), helpstring("method GetArray")] HRESULT GetArray([in] int elementCount, [out, retval] VARIANT* pV);This method returns a SAFEARRAY in a Variant, the elementCount argument indicates how many elements should be placed in the array before it is returned.This is how GetArray() is defined, it creates a Safearray of type VT_I4: STDMETHODIMP CTestOutArray::GetArray(int elementCount, VARIANT *pV){ V_VT(pV)= VT_ARRAY | VT_I4; SAFEARRAYBOUND saBound; saBound.lLbound = 0; saBound.cElements = elementCount; SAFEARRAY* pA = SafeArrayCreate(VT_I4, 1, saBound); V_ARRAY(pV) = pA; if (elementCount 0) { long val = 1234; for (long i = 0; i elementCount; i++) SafeArrayPutElement(pA, i, i); } return S_OK;}I have got rid of any error checking code etc. to make it a bit easier to read...When I call this from Perl with elementCount 0, everything works OK, but when I call it with elementCount == 0 I get the 'Invalid Index' error. Here is the client Perl Code:use strict;use Win32::OLE qw(in with); $Win32::OLE::Warn = 3;my $test = Win32::OLE-new('PerlOutArrayTest.TestOutArray', 'Quit') or die "Couldn't create object";my $arr = $test-GetArray(1); # Works OK my $second_arr = $test-GetArray(0); # Throws an errorCan anybody spot if I am doing something wrong? Should Perl work OK when an OLE method returns an empty Safearray, or should I just expect it to throw this error when the array is empty?It's all a bit of a pain as I sometimes need to return an empty array as part of normal operation, and I don't want to have to add loads of nasty extra code handle the situation as an error...Any help would be greatly appreciated, thanks for reading!Kevin Godden. Send instant messages to your online friends http://uk.messenger.yahoo.com ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Opening Files
I am attempting to open a file using the following command:open(FH,"",$file) or die "The file $file could not be found";I get the file path using the following command:chomp($file=STDIN);When I execute the program after entering the file name from the keyboard I get an error message that indicates that the file can not be found. The file I am trying to use exists currently in the directory where the program file exists. I have tried to enter just the file name and the whole path including the file name. I get he same error either way.Help! I have to have this assignment in tomorrow! Any suggestions will be GREATLY appreciated! Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: What's on your repository list?
Bernie Cosell wrote: In response to a recent inquiry, I learned that a likely solution to my problem would be found in a module availabe via RothConsulting [Win32::AdminMisc --THANKS!!]. Made me wonder: are there other sites besides ActiveState and RothConsulting that it makes sense for me to have on my repository list? /Bernie\ Hi Bernie, Randy Kobes maintains a PPM repository at the University of Winnipeg, and he lists a couple of others that are useful here: http://theoryx5.uwinnipeg.ca/ppms/ Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: sleep oddness
Steven Manross wrote: Has anyone seen an issue where sleep 1; causes an infinite loop in perl (100% CPU usage -- no movement in the script)? Build 816 in case it matters.. It just started happenning today in a script I wrote a very long time ago and haven't modified in a while. Similarly, running perl from the command prompt and entering my only command as sleep 1;, doesn't exhibit this behavior (hang). [snip] Hi Steven, I believe this was a bug in 816, and is fixed in 817, which is available now. Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Maill::Pop3Client - correction
Chris wrote: Does anyone know if there's any legal issues with hosting encryption modules in the US? I run a farm of uber fast servers that I could add a PPM repository to for everyone. - Chris Hi Chris, I haven't looked at the US situation in a few years, but I believe it hasn't changed. Strong encryption is considered munitions by the relevant government agency, and requires a permit to export. The set of rules it is covered under is the broad-ranging Export Administration Regulations (EAR), though on a quick look I can't tell which of the many rules covers it. The alphabetical index (http://www.access.gpo.gov/bis/ear/txt/indexccl.txt) does list the following: Cryptanalytic equipment or devices, digital. . . . 5A002.a.2 Cryptoanalytic equipment and components, n.e.s.. . . . 5A992 Cryptographic equipment and components, n.e.s. . . . . 5A992 Cryptography equipment or devices, digital . . . . 5A002.a.1 Cryptography equipment or devices, analog. . . . . 5A002.a.3 Cryptologic equipment, software for the development, production or use of5D992 Cryptologic equipment and components, n.e.s. . . . . . 5A992 Cryptologic equipment, technology for the development, production or use of5E992 This might give you enough to go on to find the answer quickly, though. Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Maill::Pop3Client - correction
Chris wrote: Maybe the solution is to have a server in each country to distribute restricted modules to occupants only. There are a lot of companies (like Motorola for example) that limit access to software downloads based on the user's country of origin. I'm sure there are ways of obtaining this list from Arin. Maybe something like... us.ppm.activestate.com ca.ppm.activestate.com Hi Chris, One server set up in a country that didn't have export regulations on cryptographic software would do it, actually. IIRC, that's how the PGP folks did it for a long time. Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Need SSL Help
Hi Chaddaï My simplistic understanding (and I'm no Perl internals developer- just a user) is that there are several reasons; One: SSL steps on a lot of patents- Even SSLeay is pretty underground these days. Two: Threading appears to always be an issue with SSL integration... at least it does with me when I attempt to use it with SOAP::Lite- I just gave up on it and now use Curl command-lines in my Perl code . Kevin On 2/14/06, Chaddaï Fouché [EMAIL PROTECTED] wrote: Kevin Carothers a écrit : Hi Jaime- You need to provide more info. This link might help:http://johnbokma.com/perl/https.html I'm always a little bit surprised that ActiveState doesn't supporteither Crypt::SSLeay or Net::SSLeay (for IO::Socket::SSL) since it's afeature which is useful to so many programmers (it's a recurringquestion on most of the forum/mailing-list I've read). If a guy from ActiveState see this thread could he give us the reason why ?--Jedaï___Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: LWP for a passord protected site
Try separating the username password with a colon. KCOn 2/14/06, Jerry Kassebaum [EMAIL PROTECTED] wrote: The code below is modified from Suehring's Beginning Perl Web Development.I'm thinking it is supposed to get me the format for entering my usernameand password. However, the result I get is 2. Help?Also, I don't know what that Subscrbers line would be for.use LWP;$browser = LWP::UserAgent-new();$result = $browser-credentials(' https://optionsxpress.com/login.asp','Subscribers','myname' = 'badpassword');print $result;;___ Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: website providers
Unless I'm missing something can't you just go into excel and do a file - save as - filename.html and upload it to your web ISP.. KC On 2/15/06, Giuoco, Aaron [EMAIL PROTECTED] wrote: OnSmart will probably be good for what you want to do:http://www.onsmart.com/linux.htm$90/yearI've been using these guys for about a year now and they've been pretty good. AG -Original Message- From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]]On Behalf Of Ross Matt-QMR000 Sent: Wednesday, February 15, 2006 9:36 AM To: perl-win32-users Subject: OT: website providers Hello fellow programmers I would like to write some code for my local soccer association to covert their Lovely Excel schedules into something readable on the web. The Problem is, I do not know of any USA web space providers that have Perl. truth be told I don't know of any company names. I guess that is the down side of never working on any other network other than the one in the Office.Any input on this would be helpful. Thanks Matt Ross ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs___Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: How the wrappers of C libraries work out?
Hi Robbie- I may just be speaking for myself on this, but what I've done before is put my C functions in an ActiveX control- This control is then registered (via regsvr32) on the particular machine it will be used from. Then use Win32::OLE to bind to the DLL. Unless there is a way to write AciveX controls from Cygnus or some other public-domain C compiler, you'll prolly have to find a copy of MSVC++. I too would be interested if anyone could chime in about ActiveX via Cygnus- but the last place that thread left (about 5 yrs ago) was issues with .tlb (typelib) files. PS to Robbie- If you stick with the Win32::OLE route you're definitely on the right track; In my experience it's really fast. HTH, KC On 2/12/06, Guohong Hu [EMAIL PROTECTED] wrote: HiI have a lot of calculation to do in my program, so I would like to use C.But I don't know how to call the library functions written in C. Anybodycould give a hint where to look at?It seems I can write some kind of wrapper to the C functions. Actually I am using the Algorithm::Cluster written by Dr. M.J.L. de Hoon, which provides abuntch of wrappers to the C libraries. But When I try to read the modulefile to learn how these work out, I can not get any clue from it. Thanks a lot.Robbie___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Need SSL Help
Hi Jaime- You need to provide more info. This link might help: http://johnbokma.com/perl/https.html ...But command-line curl is all self-contained with no Perl interaction whatsoever- so personally I'm lost as to what it is you're describingunless your curl.exe can't find either: 1. curl-ca-bundle.crt 2. libeay32.dll 3. libssl32.dll ...or you're using a curl that doesn't have SSL compiled- Take a look to see . KC On Sat, 11 Feb 2006 12:27:00, Jaime Teng [EMAIL PROTECTED] wrote: Hi,Which Perl module or library is needed to perform HTTPS/SSL communication?I tried the command line cURL but its giving me errors.The parameters to the website are passed as a QUERY STRING within the URL. BTW. I am using win32 machines.regards,Jaime___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Upgrading Perl
Chris Wagner wrote: If ur talking about the ActiveState distribution u should be able to just install right over the top of the old installation. Everything will be preserved. Hello Chris, This method can actually cause problems with the PDK, among other things. For Windows software, read the article here: http://blogs.activestate.com/kevinw/2006/02/upgrading_activ.html For Unix versions of ActivePerl, delete all files and directories save for lib/site-perl from the ActivePerl installation directory, then install the new version in the same directory. This keeps PPM-installed modules intact, but does not leave behind files from previous installations that can mess things up. Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: creating ZIP file that is password protected
Hi Glen, It looks like cpan.org's Archive::Zip doesn't support encryption. Probably because it's more of a function of the WinZip front-end... I'm thinking this because good-old zip.exe doesn't know anything about passwords, either. Maybe you can encrypt the files that you add to your Perl-created Zip-file via something like Toolbox::CryptOTP?? and decrypt them later? Just a thought- HTH KC On 1/25/06, Glen Plantz [EMAIL PROTECTED] wrote: Hi Folks, Do any of you know of a way or know of a module that can password-protect a ZIP file? I've just started using Archive::Zip, and it works well, but I don't see any way to password-protect the ZIP file that is created from Archive::Zip. I've looked thru the Archive::Zip documents, but I don't see any method to programmatically add a password to the ZIP file that is created. Thanks in advance for any help. Glen Plantz ___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: RAS
Hi Daniel, Unless I'm missing something, it sounds like you have a transaction model- where each dial-up operation is a transaction. In such a model, you'd prolly like to have a service-date/time and a service completion date-time. If I was tasked with this, I'd start with adding data columns for these two items. The design issue you didn't provide is how long each server transaction lasts. If each server is online for less than a minute, you can swepp thru your server base in less than 12 hours- otherwise, it might take days. Is logging-on guaranteed? You'll prolly want to also store transaction status, time on-line, etc. Then move on to data mining issues, like avg transaction speed, errs encountered, etc. Good luck, KC On 1/21/06, Daniel Rychlik [EMAIL PROTECTED] wrote: It's been a long while since I've posted to PERL user group, its good to be back. I've run into another project that I must complete however I have not found a way to automate dial up networking. We have about 1500 or so servers that are running dial up networking and the only way to make a connection is obviously to dial in. Its just a standard dial up that requires 3 parameters, "phone number","username", and "password". Currently I have about 1500 or so RAS phone book entries, but I want to get away from that. I have a database with all this information for each server. The ultimate result is extracting out my params from DB, editing 1 RAS phone book entry, invoking the dial connection, running my stuff, and disconnecting, then on to the next one… Has anyone run into this situation before? If so, would you mind pointing me in the right direction so that I may start down a path of a good solution? Thanks in advance, Dan J. Rychlik Is Duane Kielty still around? ___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Win32::OLE and Acroread anybody?
Hi Lynn, I haven't personally done this- but I've had some luck with Win32::OLE. Try $acroApp = Win32::OLE-new(AcroExch.App); $acroDoc = Win32::OLE-new(AcroExch.PDDoc); HTH- KC On 1/16/06, Lynn. Rickards [EMAIL PROTECTED] wrote: Greetings,Wondering if anyone has had any success controlling Adobe Acroreader thru OLE. Thereappears to be limited functionality exposed, as seen in OLE browser, but I didn't getpast the first hurdle $acroApp = Win32::OLE-new('???');Any clue most welcome.TIA - Lynn.___Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: grep question
Spencer_Lists wrote: Greetings perl-win32-users, This is not a strictly win32 question but relates to files in a win32 system so ... The context is pretty obscure so I am including the very minimum code snippet. @files is an array of all the files in the path folder. I need to check whether the file $newname exists in the path folder. An odd situation came up with a file named blah blah blah (1940.mid The author of the file forgot the closing ) which is fine for a windows file name but grep sees the ( as missing the ) in a regex. I have tried quoting and preceding the ( or ) with \ to escape it but none of this works. Any ideas? I could also just check the folder for the presence of the file name but I have never found documentation on how to do this. Since this would be more of a win32 question, maybe that is what I should be asking. How do I check for the existence of a file in a folder? my @files = $path/*; my $file_exists = 1 if (grep/$newname/,@files); Hi Spencer, That has an unusual syntax in Perl -- it's borrowed from Unix shell scripting. You test for the presence of a file with: if (-f /path/to/file) { # do stuff here } There are other similar functions -- -r checks if the file is readable by the user running the script, and others. You can find more details in the perlfunc manual page (perldoc perlfunc on most systems). Cheers, kjw ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Find the date of the newest file????
Hi Chuck- On 6/18/05, Charles Maier [EMAIL PROTECTED] wrote: I have a Perl app that catalogs photo files. IS there a quicker way of finding the newest file date in a directory other than doing a stat on each file in it?? How?? TIA Chuck I know it sounds a little weird, but what I do is manipulate large groups of individual files via ZIP archives- In my case, I have hundreds of PDF files generated daily; I zip each directory into a single zip (via a scheduled task), and glob the directory list (which tends to be fast because there's just one zip file in each directory). After targeting the zip file, (which has thousands of individual PDF files) I use use Archive::Zip to extract the file and dump the bytestream to the browser- you might obviously choose a different method, but I'm just throwing it out there as an idea. Obviously, theres a Zip method for getting the file date/time ( lastModFileDateTime()). HTH KC ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Coping Records from one Database to another with Blank Data i n a field
On 6/16/05, Gerber, Christopher J [EMAIL PROTECTED] wrote: -Original Message- Error Message. Missing SearchCondCh value New Search Value is Printing Record for Search Conditions 950 and 2 and 'MAINTENANCE TRAINING REQUI REMENTS REVIEW' IS FOUND OR 'MTRR' IS FOUND and SQL failed INSERT INTO Table_Of_SearchConditions (SC_lintPID, SC_etSearchType, SC_stSearchCondition, SC_lintSearchCondition ) VALUES ('9000', '2', ''MAINTENANC E TRAINING REQUIREMENTS REVIEW' IS FOUND OR 'MTRR' IS FOUND', ''): -3100[Micros oft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expr ession '''MAINTENANCE TRAINING REQUIREMENTS REVIEW' IS FOUND OR 'MTRR' IS FOUND' '.10 Sounds like the problem is not blanks... It looks like it's strings that contain single-quotes. You may want to try something like s/'/''/ to change them all to double single-quotes. Hi all, this was discussed recently; try using $dbh-quote() on string fields; $stmt = INSERT INTO Table_Of_SearchConditions (SC_lintPID, SC_etSearchType, SC_stSearchCondition, SC_lintSearchCondition ) VALUES ($db-quote($newAddPID), $db-quote($SearchType), $db-quote($SearchCond), $db-quote($SearchCondCh)); $rc = $db-Sql($stmt); kDot ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Output image via http
Hi Chris, I may be way off-base here, but you might need to add a Content-Length: header too- HTH- Kdot On 4/18/05, Chris [EMAIL PROTECTED] wrote: I know I've seen the answer to this question in the past but I can't seem to find it in the archives or Google. How can I output an image directly from Perl? I've read about possibly using binmode, but haven't found a working example. print Content-type: image/jpeg\n\n; open (data_In,small.jpg); print data_In; close (data_In); ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Running Perl script without a command window
On 4/14/05, Dan Baumbach [EMAIL PROTECTED] wrote: I'm running a perl script that checks the viability of a server. I have the script scheduled to run every 5 minutes. That means every five minutes I have a command window flash on the computer as the script is being run. Is there any way to keep this command window from comming up? The script sends an email if there is server failure so I don't need to see any direct output from the script. Thanks in advance for your answers. - Dan. Hi Dan! Try this; use Win32::OLE; [---] my($sysCmd) = cmd.exe /c mypgm.exe; Win32::SetChildShowWindow(0); ## make the DOS window invisible system($sysCmd); HTH- kevdot ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Comparing strings
On Apr 11, 2005 11:22 AM, Craig Cardimon [EMAIL PROTECTED] wrote: I am working with huge ASCII text files and large text fields. As needs and wants have changed, I will be reprocessing data we have already gone through to see if more records can be extracted. I will need to compare strings to ensure that records I am inserting into our SQL Sever 2000 database are not duplicates of records already there. I have come up with two ways: (1) use string length (number of characters a string holds): [---] (2) compare strings (or 200-characer substrings thereof) directly: [---] Does this sound sane to you folks? If anyone has a better way, don't be shy. I'm not one to judge sanity one way or another :-) ... but maybe you might want to consider loading your data into a temporary table and having tsql determine the duplicates. If the files are a big as you say, I would think SQL Server BCP, in combo with a native-SQL Server t-SQL stored procedure would be MUCH faster than any line-by-line perl ETL utility you can write; I mean hey, I have SQLSrver 7 running on a laptop importing over 4 Million rows a minute... Perl is great and all, but physics says it isn't going to give you super-threading DB I/O unless you really, REALLY work at it. Just my thoughts- kevdot ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: security diff between hidden fields and cookies
On Mon, 28 Mar 2005 15:12:06 -0500, Thomas, Mark - BLS CTR [EMAIL PROTECTED] wrote: I would like to get some opinions on what is safter, hidden fields or cookies? You might be surprised to hear both are equally insecure. In either case, you're sending data to a browser, and you're assuming the browser will send it back to you unchanged. Yet either can be manipulated. The best thing to do is avoid sending important data to the browser altogether. You can use a sessionID as the previous poster mentions, but be sure you keep in mind that the SessionID can be manipulated so make sure you build the proper controls in place to handle that. This is a VERY interesting thread- It all depends on your needs, but security is getting more and more of a legal issue so ... Most websites include both... cookies for the session handling and hidden fields for the login handshake. Use an SSL/TLS web page for login/signup. everything else is OK to use in cookies, IF there are no passwords in the clear. That brings up the basic philosophy you should follow; don't leave tracks in your client-level HTML code that a bad person can follow to get into your website no decryption logic or HTML comments like // decode base64 here (I know it sounds dumb, but I admit; mea culpa). If this thread gets deeper, maybe we can all have a security discussion. kevindot ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: adding a title to a file on windows
Wow- I never knew those properties even existed... It is possible there is some sort of a PIF file that's created when you create comments under the summary tab? KC On Thu, 10 Mar 2005 15:26:29 -0500, Earthlink-m_ryan [EMAIL PROTECTED] wrote: Chris wrote: The file comments are part of the file itself. Are u talking about saving off the long name somewhere for future reference? I guess I didn't explain very well. I would like to access the windows file browser functionality in order to add a title or comment to the properties of a file for easy reference through the Windows Explorer window. This is the dialog box one would access by right clicking on the file in Windows Explorer and the summary tab in the properties dialog box. Wether or not this a part of the file itself I can't say. I just don't want to go through the files one buy one in the Windows Explorer window and change the name and add a description through properties dialog box.(There are a couple hundred files.) Peter supplied this code: use strict; use File::Copy; my $dir = '/somedir'; my %hash; opendir(DIR,$dir) || die can't open $dir : $!\n; my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { my ($name,$ext) = split(/\./,$file); my ($newname,$desc) = $name =~ /^(.*\d)_(.*)$/; $hash{$name}=$desc; move($file,$newname\.$ext); } open(LOG, $log) || outputerror; foreach my $key (keys %hash) { print LOG $key -- with a description of $hash{$key}\n; } sub outputerror { print WARNING: Could not open log file for writing. THe following files were moved:\n\n; foreach my $file (@files) { print $file\n; } exit 1; } I wrote something close to this but only to capture and remove '$desc'. Now I need to add this to the files attributes as a Title or Comment. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Archive::Zip and CSV files for parsing
On Wed, 9 Mar 2005 14:03:54 -0600, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi; I'm using Archive::Zip to unzip a bunch of CSV files that I want to extract information from. The problem is that when I extact a file, and I try and read it into an array for line by line handling, the system doesn't see the line breaks. Has anyone run into this? Here's the relevant snippet: @members = $archive_in-members(); foreach (@members) { my @contents = $archive_in-contents($_); foreach (@contents) { #line handling and parsing stuff goes here } } [---] Hi John. I haven't run across your problem, but I personally would start by looking at the $member-isTextFile( )or$member-isBinaryFile() flags for your zip member-item. If binary, maybe things are getting thrown off and you have to split by looking either for a \n or a \n\r (if PC-format.) Just ideas, HTH KC ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Win32:OLE - Threadsafe?
On Mon, 28 Feb 2005 13:12:40 +0100, Neil Burnett [EMAIL PROTECTED] wrote: Has anything happened to solve this clean up issue with Win::OLE and threads? Free to wrong pool ... during global destruction I am avoiding the error at the moment by taking jan and paul's advice (thanks) collectively: - require not use Win32::OLE and do it inside the thread sub I have also had to comment out using Win32:OLE:Constants and revert to the actual numbers I need (E.g 65001 instead of Win32::OLE::CP_UTF8() ). I couldn't get them to work with use or require either inside or outside the thread sub. Hello Neil, I have been burned by this problem before. It's not really a solution, but what I did to work around the issue is to use semaphores. Example; use DBI; use Win32::OLE; use Win32::OLE::Variant; use Win32::Semaphore; use Win32; [---] $strInsSQL = INSERT INTO tbl (OfficeStreet1) ; $strInsSQL .= VALUES ('.$INFO{'newost1'}.' ; my($Sem); Win32::Semaphore::Create($Sem,1,1,SemBranch)||die Error; if($Sem) { $Sem-wait(); $sth = $dbh-prepare($strInsSQL); $sth-execute || Write_HTML_ERROR_sem(bERROR Writing tblBranches Recordb, $Sem, $lastBranch); $Sem-Release(1,$lastBranch); } ...something not shown is Write_HTML_ERROR_sem() you shouldn't just die if you get an error, because you should at least try to release your named semaphore... otherwise it will jam up everyone else who uses the semaphore. Google about semaphores if you need to get a background. KC ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: How to call a perl code in Windows from Unix
On Mon, 28 Feb 2005 10:23:24 +0100, Bruno Georges [EMAIL PROTECTED] wrote: Hi One possible solution is to wrap the functions in Script B [on windows] with SOAP and expose it has a service via apache. [---] Bruno Georges [---] I need to run Script A in Unix , It will generate few parameters that should be passed to Script B . The Script A will call Script B .. Script B will be on a Windows Server . Its input parameter is the data passed by Script A IT SHOULD RUN IN WINDOWS and not in a shell on Unix After Script B completes execution , it should return Success / Failure or any other information back to Script A Is this possible , if so cld u please give me some ideas .. [---] SOAP is a very elegant platform for such endeavors; especially with complicated datasets (I use SOAP with Java). But if it is just a matter of synchronization between work to be done on two different servers, it might just be a matter of using LWP - because, as described in the original post, Script A is just the client of Script B. Check it out:perldoc LWP K.C ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Win32::OLE : Bizarre Push while Examining IE Events
Hi Andrew, I really don't know what's going on, but I have tried running MSAccess as an OLE automation server; you too are obviously running IE as an OLE automation server. I hate it when people tell me something can't be done, but I really doubt that you can call events from a COM object via a perl script... It MAY be possible from a VB program, because (I believe this is how it works) both are bound at runtime via the VB6RT.DLL... but I may be wrong... if you findan answer to this, PLEASE POST I worked on a similar project a few weeks ago- I had to implement a report server in Perl to run MS Access reports and deliver the snapshot (*.snp) to the browser- I discovered that I could not run an OLE method - $access-DoCmd-RunReport() got an error; You cannot run this method at this time this time was a code-phrase for you cannot run this method at ANY time [:-)] I was able to solve my problem by writing a VB program that bridged my OLE automation request from the Perl script, and notified the script via some pretty clunky means that I'm too embarassed to get into here. HTH KC On Sun, 20 Feb 2005 10:09:13 -0700, Andrew McFarlane [EMAIL PROTECTED] wrote: I need help in figuring out how to prevent an exception from occurring when I try to examine Internet Explorer browser events using Win32::OLE. Thanks in advance for your help. I have a library that allows one to drive Internet Explorer. My code runs well until I try to examine the window events by using the Win32::OLE WithEvents method. When I uncomment the line of code that sets the event handler, I get the error message: Bizarre copy of HASH in push at C:/Perl/site/lib/Win32/OLE/Lite.pm line 168 (#2) (P) Perl detected an attempt to copy an internal value that is not copyable. Uncaught exception from user code: Bizarre copy of HASH in push at C:/Perl/site/lib/Win32/OLE/Lite.pm line 168. Line 168 of OLE::Lite is inside of the in method definition--I call that method when I'm iterating through a collection of Win32::OLE IE objects. Here's a snippet of code: I initialize a browser and set the browser event handler: # Launch Internet Explorer. $oleBrowserRef = Win32::OLE-new(InternetExplorer.Application) or croak ${CLASS}::new Could not open an Internet Explorer browser: ,Win32::OLE-LastError(),\n; # Register window events. Win32::OLE-WithEvents($oleBrowserRef, \browserEventHandler, DWebBrowserEvents2); Here is the browser event handler: sub browserEventHandler { my ($browser,$event,@args) = @_; my $URL = $browser-{URL}; if( $DEBUG ) { print DEBUG: ${CLASS}::browserEventHandler: Event: $event ; foreach my $arg (@args) { my $value = $arg; $value = sprintf [%s %s], Win32::OLE-QueryObjectType($value) if UNIVERSAL::isa($value, 'Win32::OLE'); print \targ: $value\n; } print \n; } 1; } Thanks for your help. Andrew McFarlane ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
hummingbird hostexplorer ole
Hello, I hoping if someone could show me how to create an instance of Hostexplorer through perl or give some suggestions. Hostexplorer is an emulator for a tn3270 connection (telnet). The Basic code goes like this: Sub Main Dim HostExplorer as Object Dim MyHost as Object Set HostExplorer = CreateObject(HostExplorer) ' Initialize HostExplorer Object Set MyHost = HostExplorer.HostFromProfile(WFA\_wfa1) ' Set object for the desired session MyHost.RunCmd(Pf1) Exit Sub This sends an F1 to the application through hummingbird basic. My code for a running instance, which doesn't work, looks like this: #! c:\Perl\bin\perl.exe -w use strict; use Win32::OLE; my $hex = Win32::OLE-GetObject('HostExplorer.Application'); $hex -RunCmd(Pf1); #will update the time in window Thanks, Kevin /// HostExplorer is a comprehensive PC-to-host connectivity product that delivers mainframe data to the desktop without the overhead of legacy protocols. HostExplorer connects desktop computers to IBM mainframes and IBM-compatible systems, to IBM midrange systems (the AS/400 family), and to ASCII character systems using Telnet. The terminal emulation components (Telnet, TN3270, TN5250 and TN3151) provide fast access to corporate data and run with Windows NT/95/98/2000/Me/XP operating systems across corporate intranets and the Internet. HostExplorer uses Kerberos, which provides the necessary network tools to secure information systems across an entire enterprise. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Output to select windows??
Here's a TK example. Guess you're not expecting the user to interact with your Windows, they are just to display results in. Each window appears as a separate icon on the start bar. I've never been able to work out how to stop this happening. A simple solution would be rather than have 3 windows, have 1 window with three different text areas to display results in. That might even be a better idea thinking about it. Kev. use Tk; use Tk::ROText; my $win = MainWindow-new(); $win-bind('Alt-Key-F4' = sub { exit } ); $win-title(Window); $win-withdraw; # hide mainwindow my @childwins; # array to store child windows and their widgets my $x = 10; # create child windows which will display the results for (my $i = 0; $i 3 ; $i++ ) { $childwins[$i][0] = $win-Toplevel(); $childwins[$i][0]-title( Window $i ); $childwins[$i][0]-geometry( +$x+10, ); # set position of subwindows $x += 250; # move x pos of next window $childwins[$i][1] = $childwins[$i][0]-Scrolled( 'ROText', -scrollbars = 'oe', -height = 20, -width = 30, -background = 'white', )-grid( -row = 1 , -columnspan = 5 , -pady = 2, -sticky ='nsew'); $childwins[$i][0]-Display; } # # Do something and display results in windows # for (my $j = 0; $j 100 ; $j++ ) { for ( my $i = 0; $i 3; $i++ ) { $childwins[$i][1]-insert( end, Window $i, Line $j\n ); # insert text on window $childwins[$i][1]-see( end ); # make sure will be visible $childwins[$i][0]-update; # make our updates visible } sleep 1; } -Original Message- From: Glenn Linderman [mailto:[EMAIL PROTECTED] Sent: 18 January 2005 19:12 To: Charles Maier Cc: Kevin Gibbs; perl-win32-users@listserv.ActiveState.com Subject: Re: Output to select windows?? On approximately 1/18/2005 10:39 AM, came the following characters from the keyboard of Charles Maier: I looked at Win32:Console. One of the first things it talks about is that ONLY ONE window may be open for a process and how to detach an open console and re-open a console. This is not true?? Sorry, maybe I should have read the documentation again. I had gotten the impression that a program can have multiple console windows from something I read somewhere, but perhaps that is not possible via Win32::Console, only at the Windows API level. Would someone please offer a simple example of perl working with multiple windoz windows?? Well, the sample code attached is from Win32::GUI's (version 1.0) sample programs. It shows multiple child windows within a parent window (If you File/New several times). But really, you likely only need a single window, with multiple text boxes, for each type of output you want. Or, since the data you mention talks about lists of things, maybe list boxes would suffice, or even be preferable. This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Output to select windows??
Chuck, Yes but you'll need to be clearer on what you want. If you're looking for create GUI interface then there is TK, Win32::GUI or WX. If you want to send characters to a multiple console windows then there is Win32::Setupsup. Kevin. -- Date: Sun, 16 Jan 2005 17:54:32 -0500 From: Charles Maier [EMAIL PROTECTED] Subject: Output to select windows?? To: Perl-Win32-Users Mailing List perl-win32-users@listserv.activestate.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Can perl open multiple windows... and selectively send text to these windows?? TIA Chuck This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Screen Saver settings
Hi John, The screen saver settings are stored in the registry. The following should tell you what the settings are: use Win32::TieRegistry (TiedRef = \$reg) ; use Win32; my $control = $reg-{CUser\\Control Panel}; my $desktop = $control-{Desktop}; print ScreenSaver: . scalar ($desktop-{SCRNSAVE.EXE}).\n; print Active: .scalar ($desktop-{ScreenSaveActive}).\n; print Secure: . int( Win32::IsWin95() ? $desktop-{ScreenSaveUsePassword} : $desktop-{ScreenSaverIsSecure} ).\n; print Timeout: . scalar ($desktop-{ScreenSaveTimeOut}).\n; Hope that helps. Kev. -- Date: Wed, 1 Sep 2004 17:41:04 -0500 From: Herbold, John W. [EMAIL PROTECTED] Subject: Screen Saver settings To: '[EMAIL PROTECTED] ' [EMAIL PROTECTED],'Steven Manross ' [EMAIL PROTECTED], '[EMAIL PROTECTED] ' [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Any body know of a way to use Perl to see if a workstation has password protection enabled and what the timeout is for the workstations screensaver? Code snippets would be perfect, ideas and suggestions would be most helpful. Thanks ! John W. Herbold Jr. Security Specialist This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Determining Available Disk Space
Just for the record, there is also Win32::DriveInfo::DriveSpace(). Kev. -- Message: 14 Date: Wed, 25 Aug 2004 12:34:03 -0500 From: Dirk Bremer \(NISC\) [EMAIL PROTECTED] Subject: Re: Determining Available Disk Space To: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Thanks to all who responded. I ended up with this to produce my desired result: # Construct a WMI object instance. my $WMI = Win32::OLE-GetObject(winmgmts:mailcd\\root\\cimv2); # Query for the D-drive information. my $Collection = $WMI-ExecQuery(SELECT * FROM Win32_LogicalDisk where DeviceID = 'D:'); # Calculate the free-space in megabytes. my $Space; foreach my $Obj (in $Collection) {$Space = int($Obj-{FreeSpace})} Note the adjustment that I made to the SELECT statement to query only the single specific drive. I will use the raw free space number to compare against the raw size of the current file that will be copied to determine if there is enough free disk space to perform the copy operation. As an aside, is there a way to directly access the returned hash elements rather than using the following loop? foreach my $Obj (in $Collection) {$Space = int($Obj-{FreeSpace})} 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 This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Detecting and controling switch ports with Perl
Hello, I would like to write a Perl script with the following functionalities. Detect MAC addresses connected to each port of our switches. Shutdown the port if the MAC address is not on a specific list. Could anybody help me on this? Any help would be appreciated. Regards, Kevin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Pipe and redirect STDOUT
Guys, My understanding is that there is a bug in the file extension/application to execute code, that is part of windows, that stops redirection from working if Microsoft does this lookup itself. Stopping it having to do this lookup, by invoking Perl.exe directly, gets around this issue. This problem has been around for as long as I can remember. Kev. -Original Message- From: Martin Leese [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 05:05 pm To: [EMAIL PROTECTED] Subject: Re: Pipe and redirect STDOUT Sui Ming Louie wrote: I have run similar batch files on NT4.0. They worked OK. At one point, I used to think that redirection from batch files was not possible. Then I got some insight from reading the perl2bat.bat file included with Perl. I asked the original question, so I thought I would try to summarize progress to date. First, many thanks to everyone who has responded. One poster suggested the problem might be that typing test.pl invoked a BAT file, and that my problem was redirection from BAT files in general. There is no perl.bat on my system, so this is not the problem. Also, redirection from BAT files appears to work as expected. (Also, also, there is no perl2bat.bat file on my system.) Another poster suggested trying perl test.pl and, indeed, redirection using this form of invocation works fine. This is a valid work around and, although my problem has not been solved, my problem is no longer a problem. Martin Leese wrote: Hi, I know this is a really dumb question (yes, there are dumb questions), but I am stuck. Why can I neither pipe the output from a perl script to more nor redirect it to a file? This is under Windows NT. The following script: #! /usr/local/bin/perl # use strict; use warnings; ###use diagnostics; # print STDOUT Hello me; # exit(0); produces Hello me on the screen with the command test.pl. However, the command test.pl |more produces a blank line, and the command test.pl test.txt produces an empty file. Why? As the more intelligent amongst you will have guessed, I am not a Windows person. Also, while you are here, what is the difference between use warnings; and use diagnostics;? I am running perl, v5.8.2 built for MSWin32-x86-multi-thread, Binary build 808 provided by ActiveState Corp. under Windows NT. Many thanks for any help you can give. Regards, Martin Thanks again to everyone who responded, Martin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. TradeWeb reserves the right to monitor all e-mail communications through its networks. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl-Win32-Users digest, Vol 1 #1729 - 17 msgs
Bill, Just out of interest I tried a variation on your script with 3 buttons to open up the html file. One button used System, one used the windows shell (via OLE) and one used OLE to control IE directly. On my machine (w2k), Shell takes the longest, system is slightly quicker, and OLE is pretty much instantaneous. Doesn't answer your question but gives an alternative but only if you use IE. Code is below (cut and pasted your code so I'm using your original style). use strict ; use Tk ; use Win32::OLE; my $file = 'c:\\temp\\contents list.html'; system ( $file ) ; my $mw = MainWindow - new ( -title = 'Test Window' ) ; my $b = $mw - Button ( -text = Shell , -borderwidth = '1' , -padx = '4' , -relief = 'raised' , -command = \shellpress ) - pack() ; $mw- Button ( -text = System , -borderwidth = '1' , -padx = '4' , -relief = 'raised' , -command = \systempress ) - pack() ; $mw- Button ( -text = OLE , -borderwidth = '1' , -padx = '4' , -relief = 'raised' , -command = \olepress ) - pack() ; MainLoop ; sub shellpress { my $shell = Win32::OLE-new( Shell.Application ); my $open = $shell-Open( $file ); } sub systempress { my $r = system ( $file ) ; } sub olepress { my $ie = Win32::OLE-new('InternetExplorer.Application'); $ie-{Visible} = 1; $ie-Navigate( $file ); } Kev. -Original Message- From: Conrad, Bill (ThomasTech) To: [EMAIL PROTECTED] Subject: RE: PERL TK Question Date: Mon, 29 Dec 2003 10:38:06 -0500 Hi All This analysis of my programming style is this first I have heard. My style was developed as a result of teaching structured programming. I found students learned the concepts of Objects and Relationships by placing these on separate lines with indenting to show what was contained in what. By lining the commas up with the parenthesis on the left it was more obvious what the structure was. It was easier for the Student to identify what I was discussing and to add their own comments to each line. It was just my way of doing things. I don't criticize anyone else for their way of doing things. To each his own. But I do find it more difficult to understand a Script that has everything written on one line. When I write code, Every Line is Documented to give the next person a better chance to understand what I have done. I find that very lacking in much of what I see today. But the style of my coding wasn't the object of my question. I just find it hard to believe that it was such an issue and my original question wasn't given much thought. Sorry to those I may have offended. Bill Conrad This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Array within an array...? I'm confused
Read through perldoc perldsc - it's an excellent way to learn how this works. From: Brian Gibson [mailto:[EMAIL PROTECTED] Sent: Friday, December 19, 2003 4:27 PMTo: [EMAIL PROTECTED]Subject: Array within an array...? I'm confused Hello all,I am having trouble understanding some programming logic/syntax. This program looks like it is using what someone referred to as a reference to an array (and that doesn't make a ton of sense to me, I am only familiar with arrays, scalar variables, and hashes).The blurb of code looks like this==$su_login-SetAccountRules("$fields{'login'}", [EMAIL PROTECTED]) || die "Error: ".$cli-getErrMessage.", quitting"; ==This blurb comes from code using a module named CLI.pm which is a modulethat was developed as an interface to administer the CommuniGate Pro mail server. What I do not understand is the [EMAIL PROTECTED] , is this an array with arrays as its list members?Higher up in the script it does this with the [EMAIL PROTECTED]==my $rules=$cli-GetAccountRules("$fields{'login'}") || die "Error: ".$cli-getErrMessage.", quitting"; my @rules = @{$rules}; for(0..$#rules) { if($rules[$_][1] eq "blacklist") { $rules[$_][0] = $personal_bl_setting; $existing_bl = 1; last; } } ===Can anyone offer the following1. In idiot's terms, what is this rules thing what does it look like?2. How do I add to it? (I assume $rule[0][2] = "something"; )Thanks for any help you might be able to offer.
Win32::SetupSup and ActiveState Perl 8
Does anyone know of a ppm for SetupSup that works with the latest version of Perl? Thanks, Kevin. This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately. Whilst the Council has taken every reasonable precaution to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). Unless expressly stated otherwise, the contents of this e-mail represent only the views of the sender and do not impose any legal obligation upon the Council or commit the Council to any course of action. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Wierd Perl syntax ($#$dlr) explanation, please!
Dietmar, Thanks for the response. I read that in the manual but it didn't make sense to me in the way that this was being used. There is a loop and, within it, the following: next if ($#$dlr == -1); How would the awk-stuff below fit with this code above? Ta. K. Kevin Hill AVP Programmer TradeWeb Europe Ltd 99 Gresham Street London EC2V 7NG Tel: +44 (0)20 7776 3200 Fax: +44 (0)20 7776 3201 www.tradeweb.com -Original Message- From: Dietmar Maurer [mailto:[EMAIL PROTECTED] Sent: 21 November 2003 11:33 am To: Kevin Hill Subject: AW: Wierd Perl syntax ($#$dlr) explanation, please! From perlvar: $# The output format for printed numbers. This variable is a half-hearted attempt to emulate awk's OFMT variable. There are times, however, when awk and Perl have differing notions of what counts as numeric. The initial value is ``%.ng'', where n is the value of the macro DBL_DIG from your system's float.h. This is different from awk's default OFMT setting of ``%.6g'', so you need to set $# explicitly to get awk's value. (Mnemonic: # is the number sign.) Use of $# is deprecated. So $#$dlr is $# followed by $dlr. Dietmar -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Kevin Hill Gesendet: Freitag, 21. November 2003 12:12 An: Active Perl Mailgroup (E-mail); Perl Win32 Users (E-mail) Betreff: Wierd Perl syntax ($#$dlr) explanation, please! Guys, Just found this in some of our legacy Perl code - any idea what it does? $dlr is a scalar, containing the name of a dealer. $#$dlr Thanks for any help that can be given. Kev. Kevin Hill AVP Programmer TradeWeb Europe Ltd 99 Gresham Street London EC2V 7NG Tel: +44 (0)20 7776 3200 Fax: +44 (0)20 7776 3201 www.tradeweb.com This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. TradeWeb reserves the right to monitor all e-mail communications through its networks. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Fork/wait generating GPF at 0x0000000c in Perl.exe
Guys, I am running ActiveState Perl v5.8.0 straight out of the box, with the following test piece of code for forking and waiting for child processes. Perl.exe generates a GPF at 0x000c as the child is quitting. Anyone have any ideas what might be going wrong? I based the code on the code extract within the fork documentation in the Camel book. The output up until just before the GPF is as follows: Parent. Child is -108 Child: started: -108 Parent waiting for kiddies... Child: -108 about to exit. Sorry if this topic has already been done to death, but I had a search and couldn't find anything that appeared relevant. Ta. Kev. sub InvokeCmdAsAsyncProcess { my( $exec_line, $dummy ) = @_; my $pid; FORK: { if( $pid = fork ) { # Parent process here. # Child pid in $pid. print Parent. Child is $pid\n; } elsif( defined( $pid ) ) { # Child process here. # parent process pid is available with getppid print Child: started: $$\n; sleep 10; #system (1, $exec_line); print Child: $$ about to exit.\n; exit 0; } elsif( $! =~ /No more process/ ) { # EAGAIN, supposedly recoverable fork error print Forking having problems. Retrying\n; sleep 2; redo FORK; } else { # Wierd fork error. die Can't fork: $!\n; } } return $pid; } # end of InvokeCmdAsAsyncProcess my %pids; my $pid;# pid of most recent child process. foreach $filename (@files) { my $exec_line = $filename $filename.log; print Executing $exec_line\n; $pid = InvokeCmdAsAsyncProcess( $exec_line ); if( defined( $pid ) ) { $pids{$pid} = $pid; } } print Parent waiting for kiddies...\n; while( ($pid = wait()) != -1 ) { print Parent: Child $pid exitted with status: $?\n; } print Parent after wait.\n; Kevin Hill AVP Programmer TradeWeb Europe Ltd 99 Gresham Street London EC2V 7NG Tel: +44 (0)20 7776 3200 Fax: +44 (0)20 7776 3201 www.tradeweb.com This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. TradeWeb reserves the right to monitor all e-mail communications through its networks. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: input redirection question
You shouldn't have to do anything at all --- if you post a simple program that you believe should work you will get more help. -Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Eisengrein Sent: Friday, April 04, 2003 2:01 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: input redirection question Does it truly need to be redirected, or can you just use @ARGV ? -Original Message- From: Bernard Golden [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 1:17 PM To: [EMAIL PROTECTED] Subject: input redirection question I want to enable my program to read from STDIN via input redirection, e.g.: myprogram getstuff When I try it on my machine the program does not see the input. Is there something I should be configuring my machine with to enable it to see redirected input? Many thanks. Bernard Golden ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Update Windows 2000 Time via Internet-NTP-Server
C:\WINNTnet time /setsntp:ksovepdmc005 The command completed successfully. C:\WINNTnet time /querysntp The current SNTP value is: ksovepdmc005 This sets your time server and you shouldn't have to worry about it anymore. You just need to hunt down a reliable time server that you can reach. Kevin Gould Sr. I/T Specialist Gentiva Health Services, Overland Park, KS 913-814-2369 -Original Message- From: Harald Wopenka [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 6:37 PM To: [EMAIL PROTECTED] Subject: Update Windows 2000 Time via Internet-NTP-Server Hi there, does anyone know about a codesample which allows me to sync my systemtime with a NTP-Server on the net? TIA, Harry ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Trouble with my variables.
I must have missed the first posting/response, but it looks like you are using use strict; but not declaring your $key variable in the right scope. If you want to use $key as a global you need to declare it outside of a subroutine using my $key; If you are trying to pass arguments to your subroutine you need to declare and pop your stack. see below --- - Original Message - Still having harassments... I now invoke the sub thusly... update_value(ftp, $ftp{$key}{value}, $key); The sub is like this... sub update_value { $entry{$_[0]}{$key} - delete (0, end); $entry{$_[0]}{$key} - insert (end, $_[1]); } *** I think you want the following: sub update_value { my $first_arg = shift; my $value = shift; my $key = shift; $entry{$first_arg}{$key} - delete (0, end); $entry{$first_arg}{$key} - insert(end, $value); } I get: Global symbol $key requires explicit package name at v06b.pl line 1561. Global symbol $key requires explicit package name at v06b.pl line 1562. Execution of v06b.pl aborted due to compilation errors. If I use $_[2] instead of $key, then it works. Is there a way of passing $key as $key to the sub? Thanks. HTH - Kevin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Saving File from Internet Explorer (OLE Variant)
Thomas, Thanks for that but it seems to suffer from the same problem. The Save As button doesn't use the ExecWB function but calls execCommand(SaveAs...) on the document in the browser. I've tried adding an additional button that calls ExecWB(4, 3, filename) but the javascript doesn't save, just like Perl. Thanks, Kev. Thomas Drugeon [EMAIL PROTECTED]To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: 17/01/2003 12:33 Subject: Re: Saving File from Internet Explorer (OLE Variant) This should help: http://www.google.fr/search?q=cache:BNx6ecF6clcC:www.faqts.com/knowledge_bas e/view.phtml/aid/11852+%22-%3EExecWB%22+savehl=frie=UTF-8 Regards, Thomas - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 17, 2003 1:06 PM Subject: Saving File from Internet Explorer (OLE Variant) This question came up last November and while one solution might be to use James Tilmans Authen::NTLM module, I'd still be interested in knowing the knowing how to get IE to do the same thing. Basically downloading using LWP is failing through some firewalls while IE works. I can get IE to save the file, but only if the user is prompted for a file name using the standard file save dialog box. The call is $ie-ExecWB( 4, 0 ) A second parameter of 3 should allow the use of a third parameter (a variant of type BSTR) as the file to save as. The dialog box doesn't appear but the file doesn't get saved either. I've tried various things along the lines of my $variant = Variant( VT_BSTR , c:\\temp\\download.html ); $tag-ExecWB(4, 3, $variant ); but had no luck so far. Does anyone have any suggestions? Thanks, Kev. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
User Full Name from Active Directory
Hi All, I have a perl/cgi script that grabs user account attributes from the domain pdc and generates listboxes sorted by username, user full name, etc. Since we have migrated to a new w2k active directory, it appears that the USER_FULL_NAME attribute in Win32::AdminMisc::UserGetMiscAttributes is not grabbing the separated First Name and Last Name fields for a newly generated user. Domain accounts that were migrated to the new domain from NT4 still retain a value however. Since I happen to have no permissions to generate new users in the active directory, I guess my question is: what function do I use to grab the first name, middle initial, and last name fields from the active directory, or is there a 'full name' field in the active directory that just isn't being set by those creating the accounts? Thanks in advance :)
RE: Perl Recursive
-Original Message- Yeah well this is my home directory /home/xcomb what i would like to do it to go all the subdirectories of that home directory that has many folders and in each folder to create Trash folder untill it reaches the end of subdirectory i know it has something to do with a loop statement but can't figure out on my own or find source on internet Thanks --- I'm afraid I cannot stay silent any longer or I may burst. For /f delims=^ %a in ('dir /b /ad /s X:\') do mkdir %a\Trash Sometimes plain old command line just makes more sense.
Re: Net::Telnet on Win2K
John, The problem is outlined in the Net:Telnet documentation. The loads of gibberish is ANSI terminal escape characters. I haven't worked with that exact telnet application, but some allow you to turn ANSI off and on http://search.cpan.org/author/JROGERS/Net-Telnet-3.03/lib/Net/Telnet.pm Connecting to a Remote MS-Windows Machine By default MS-Windows doesn't come with a TELNET server. However third party TELNET servers are available. Unfortunately many of these servers falsely claim to be a TELNET server. This is especially true of the so-called Microsoft Telnet Server that comes installed with some newer versions MS-Windows. When a TELNET server first accepts a connection, it must use the ASCII control characters carriage-return and line-feed to start a new line (see RFC854). A server like the Microsoft Telnet Server that doesn't do this, isn't a TELNET server. These servers send ANSI terminal escape sequences to position to a column on a subsequent line and to even position while writing characters that are adjacent to each other. Worse, when sending output these servers resend previously sent command output in a misguided attempt to display an entire terminal screen. Connecting Net::Telnet to one of these false TELNET servers makes your job of parsing command output very difficult. It's better to replace a false TELNET server with a real TELNET server. The better TELNET servers for MS-Windows allow you to avoid the ANSI escapes by turning off something some of them call console mode. Kevin _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
IIS/CGI question
Hiya all-- I am having problems with a CGI script I'm trying to run off an IIS 5.0 server-- the script does a File::DosGlob::glob(otherserver\\d\$\\folder\\*.txt) type call, where otherserver is a server in the same domain as the IIS server. I am currently in the local administrators group for both servers. Integrated Windows authentication is enabled. The script runs fine when run from the IIS server itstelf, but does not work when run from a workstation. It looks to me like a permissions issue and since my IIS admin skills are even lower than my perl scripting abilities-- I figured I'd turn to you all for help. :) Thanks!!!
RE: what does exit(n) give you
I believe the proper usage for if errorlevel is If errorlevel 3 echo yes You only test equivalence when evaluating it as a variable. Unless it works both ways now. -Original Message- From: Edwards, Mark (CXO) [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 8:17 AM To: Edwards, Mark (CXO); Peter Guzis; Perl Win32 Users (E-mail) Subject: RE: what does exit(n) give you The last line of my previous post should have been # Doesn't echo yes. Sorry to make a confusing Microsoft thing more confusing. -Original Message- From: Edwards, Mark (CXO) Sent: Monday, November 18, 2002 7:10 AM To: Peter Guzis; Perl Win32 Users (E-mail) Subject: RE: what does exit(n) give you Importance: Low Be careful how you use errorlevel in the DOS world. You have to think of the errorlevel as a fence. If the fence is 4 feet high any you can jump 2 feet, your going to hit the fence. In other words, if the errorlevel is 4, it is also 3, 2, 1, and 0. The difference is whether you use if errorlevel or if %errorlevel%. errorlevel by itself is a threshold whereas %errorlevel% is the exact value as shown below. H:\perl -e exit (4) # Generates an errorlevel of 4 H:\echo %errorlevel%# Echos 4 4 H:\if errorlevel==3 echo yes # Tests the threshold up to 4 yes H:\if %errorlevel%==3 echo yes # Tests the exact value of errorlevel. # doesn't echo no -Original Message- From: Norris, Joseph [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 17:30 PM To: 'Peter Guzis'; Perl Win32 Users (E-mail) Subject: RE: what does exit(n) give you Importance: Low Thanks this is just what I needed. -Original Message- From: Peter Guzis [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 4:21 PM To: Perl Win32 Users (E-mail) Subject: RE: what does exit(n) give you test.bat @echo off test.pl echo Returned %ERRORLEVEL% --- test.pl --- exit 123; Peter Guzis Web Administrator, Sr. ENCAD, Inc. - A Kodak Company email: [EMAIL PROTECTED] www.encad.com -Original Message- From: Norris, Joseph [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 4:16 PM To: Perl Win32 Users (E-mail) Subject: what does exit(n) give you hello, in unix world the exit(n) returns the number in to a variable. Is this the same in the dos/windows world? If so what is the variable and how can I examine it in dos batch file or in perl. Thanks. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Browsing for SMB machines using a network broadcast? (Peter McGowan)
You could try using use Win32::NetAdmin. It has a various options for looking at different machines on the network, eg use Win32::NetAdmin::GetServers($Opdc, $dom, SV_TYPE_NT, \%nt); and the keys in %nt will be the NT machines your network, Win32::NetAdmin::GetServers($Opdc, $dom, SV_TYPE_WINDOWS, \%win); gets windows 95 (and I think lower versions). The different SV_ constants aren't described in the documentation for the module. I can send what I've found out about them to you if you're interested. Cheers, Kev. -Original Message- From: Geoffrey Leeming [mailto:geoffleeming;lycos.com] Sent: 13 November 2002 11:39 To: [EMAIL PROTECTED] Subject: Browsing for SMB machines using a network broadcast? I'm trying to get a list of all Windows machines on my network. I currently ping each IP address in turn (using Net::Ping). For every machine that responds to a ping, I use IO::Socket to open a tcp connection to port 139. Once that's done, I have a list of all machines on the local network that respond on port 139, which (I believe) corresponds pretty closely to the list of all Windows machines with our standard build. Unfortunately, this is way too slow for my purposes. Non-windows machines (that don't have SMB turned on) will not respond on port 139, and the socket connect attempt eventually times out. It's that 'eventually' bit that makes the whole script run horribly slowly. I'm scanning all machines in the 10.5.x.x range (my local network) and this takes about five hours to complete. As I'm running the script on Win32, the IO::Socket timeout option isn't enabled, and I can't use alarm() to interrupt the attempt earlier. From what little I understand of networking, I think I should be able to broadcast a UDP packet to port 139 (or 138? not sure) on the network, then set up a listener to field the replies as they come in. However, that's all I know so far and I'm somewhat wary of experimenting with broadcasts on a live network... and no, I don't have a test network :-( Is there anyone out there who's done this or similar before and can point me in the right direction? How do I craft that UDP packet? What port should I be listening on for replies? What should I be listening for? Is there a simpler way (preferably native perl, not shelling out to other tools) to retrieve a list of Windows boxes? NB I've tried using nmap's ping scanning and OS fingerprinting but that seems even slower... ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::AdminMisc -- Any risks??
Put down the keyboard and step away from the computer and I'm sure you'll be safe :-) You have nothing to worry about as a consequence of the module in and of itself. There is no particular reason that AdminMisc would blow anything up any more than any other arbitrary application or module that you run on a daily basis (less in fact because we all know and trust it, unlike some things you need to run). You're ARE at risk blowing something up via code that you generate that USES the module. If something gets killed, it will be because you pulled the trigger. We bequeath to you now the sword of the system administrator. We ask that you use it wisely. And for gosh sake, hold it by the handle, not the sharp end, would ya? KG -Original Message- From: Krishna, Hari [mailto:hkrishna;CRH.org] Sent: Thursday, October 31, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: Win32::AdminMisc -- Any risks?? Hi Friends, This is more of a general question pertaining to Win32::AdminMisc I have had problems with Win32::AdminMisc. You know, I was working on a web project and needed to authenticate the Username and password on the website to that of the Network. You guys helped me a lot towards achieving my goal. Thankyou all. Well, the program works great. Well, just a thought..Is/Are there any risks involved in using the Win32::AdminMisc module?? Will there be any chance that you might just blow up your system?? Any severe system problems that might arise out of that?? Can you guys think of any problems that might blow up or make my program fail under certain given condition/s?? Will it be possible that it might corrupt any Windows specific exe's like winlogon.exe?? Please let me know. I have searched on CPAN / Dave Roth sites. I didnot findout any risks. The only thing that Roth mentions is Use at your own risk. He might mean a lot or might mean I want to be safe for the things he didnot think of. please share your thoughts/concerns. Thankyou, Hari. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Gui rip off.
If you look under your Activestate install, there's an Eg/tk directory. Run Widget.bat I think you'll find it has more than ample to keep you busy. -Original Message- From: Beckett Richard-qswi266 [mailto:Richard.Beckett;motorola.com] Sent: Wednesday, October 23, 2002 3:33 AM To: Perl Users Subject: Gui rip off. Guys, I want to be able to have a GUI front end on my script, but I'm finding it all a bit complicated. I think that the best way to learn this stuff is to start with a script that's not too complicated, and see how things have been done by a man who can ;-) Does anyone have, or can point me to a script that has a GUI front end that I can pull apart and play with? Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Authenticated user retrieval when running under IIS Anonymous user
I have a boggle. IIS 5/Perl cgi script I have: - Created a virtual directory which points back to the IIS server via UNC (this triggers the running process to allow network operations off the server as a side effect) - NTFS Secured the directory to a select list of users - Enabled anonymous access on the directory and set it to be an administrative user as the anonymous account (a calculated risk) This lets me perform administrative tasks against remote machines from the cgi without doing impersonation which would require me to store the password in some form in a local file. My question is this: When I issue a Win32::AdminMisc::GetLogonName, or Win32::LoginName it reports the anonymous user. I would like to figure out if there is a way to ferret out the username of the person running the script (ie, the one who was able to gain access via NTFS permissions). If anyone has any alternate suggestions for running privileged tasks which wouldnt require me storing a password and manually impersonating, Im open to education. Kevin Gould Sr. Technical Specialist, Server Administration and Management Gentiva Health Services - Overland Park, KS 913-814-2369 - [EMAIL PROTECTED]
RE: Win32::AdminMisc problems
I'd check permissions on the directory. Likely you're not running the program as the same id interactively and through the webserver. Use www.sysinternals.com filemon to monitor inetsrv.exe to see if you're getting permission denied. -Original Message- From: Krishna, Hari [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 4:11 PM To: 'Thomas R Wyant_III'; [EMAIL PROTECTED] Subject: RE: Win32::AdminMisc problems Tom - I didnot understand root around in the archieves? Did you wanted me to search thru the archieves on the cpan and roth sites?? Its soo frustrating..I am too close to the solution and yet very far. -Original Message- From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 03:28 PM To: [EMAIL PROTECTED] Subject: Re: Win32::AdminMisc problems Hari - You've got me. It seems to me if Win32::AdminMisc is installed on your server _and_ your browser has access to it, this shouldn't happen. But I've seen it come by on the mailing list. You might want to root around in the archives and see what comes up. Tom Krishna, Hari [EMAIL PROTECTED]@listserv.ActiveState.com on 10/10/2002 10:15:16 AM Sent by:[EMAIL PROTECTED] To:[EMAIL PROTECTED] cc: Subject:Win32::AdminMisc problems Hi Guys, I get the following error when I execute my perl script from the browser. But when I execute the program by double clicking, it works fine. Any guesses?? I see the result in the test.txt file Password is correct Heres' the code #! D:\Perl\bin\Perl.exe use strict; use Win32::AdminMisc; open(OUT_EXT,test.txt); $domain = abcdefg; $user = confidential; $password = confidential; if( Win32::AdminMisc::UserCheckPassword($domain, $user, $password)) { print OUT_EXT Password is correct.\n; } else { print OUT_EXT Password is not correct.\n; } Here's the error --- CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Can't locate Win32/AdminMisc.pm in @INC (@INC contains: D:/Perl/lib D:/Perl/site/lib .) at D:\inetpub\wwwroot\Intranet\cgi-bin\xyz.pl line 2. BEGIN failed--compilation aborted at D:\inetpub\wwwroot\Intranet\cgi-bin\xyz.pl line 2. - Tom Wyant --- Many thanks for your help. Thanks and Regards, Hari CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as E-Contract Intended, this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portuges Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::Job/Process - maintaining constant number of sub-processes
Be sure and wait against your sub processes. When theyre done, that will ensure they clear. Disclaimer: I cut this out of something I wrote and cleaned it up for consumption so I may have missed something here and there in the cleanup. Something like this: foreach $Something ($Somelist) { if (scalar(keys %PidList) $Parms{MaxThreads}) { print Creating a thread for $Something\n; if ($ForkResult=fork) { print Adding $ForkResult to thread tracking list\n; #Keep the PID to track $PidList{$ForkResult}=$Something; } elsif (defined $ForkResult) { #We're the child print Childthread: Thread is executing a process $Something\n; Process; -call some subroutine you want to do. exit; }else { Mainlog (Unknown error forking: $! $^E,FATAL); } } else { print Maximum copy operations in progress ($Parms{MaxThreads}) - waiting 5 seconds for some to complete\n; # We have the maximum number of processes executing - wait for interval then try again. sleep 5; # Wait against the children WaitCopies; #Look again to see if we can start more copies redo Begin; } } print No more pending copy operations queued - waiting for completion of operations in progress\n; # Wait on all the executing processes while (scalar (keys %PidList) != 0 ) { print Waiting for copies to complete: ,scalar (keys %PidList), in progress\n; sleep 5; WaitCopies; } # Were done sub WaitCopies { foreach $Process (keys %PidList) { $Result = waitpid( $Process, POSIX::WNOHANG ); if ($Result==-1) { $Result = waitpid( $Process, POSIX::WNOHANG ); print Process $Process ($PidList{$Process}) complete\n; delete $PidList{$Process}; } else { print Process $Process ($PidList{$Process}) still active\n; } } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 11:56 AM To: [EMAIL PROTECTED] Subject: Win32::Job/Process - maintaining constant number of sub-processes Hi all, I'd really appreciate any help with a problem I am having. I am trying to achieve the following basic logic in Perl on W2k Server... When it starts, my script spawns a pre-defined number (10) of identical sub-processes It then continuously loops back every few seconds to check if any have completed If a processes has completed, it spawns another instance to replace it And so on I have tried using Win32::Process and that works well, but when the script terminates the sub-processes continue to run (detatched). Reading the documentation it seems to me that Win32:Job is more suitable my rough attempt at coding (below) is even worse that the version using Win32::Process - it does what is described above using the watch method to keep an eye on the spawned processes and starting new ones as required. But the problem is, when the last of the 10 originally spawned processes exits, the entire script exits and all the sub-processes die with it rather than continuing to spawning new processes until I decide for some arbitrary reason to exit and kill the entire process tree. Has anybody got any pointers as to how I can add new processes to a Win32::Job structure and have them included in the watch method? Thanks. Barry Caruth. --- code starts here --- use strict; use warnings; use Win32::Job; # Use sleep.exe from resource kit to hide complexity of real process our $exe_path = c:\\program files\\resource kit\\sleep.exe; our $count = 0; my $return = 0; our %pid_hash = (); our $job = Win32::Job-new or die $!; while( $count 10 ) # Max number of threads { start_process; $count++; }; while ($return == 0) { sleep 2; $return = $job-watch(\handler,2,1); }; print done\n; sub start_process { my $pid; $pid = $job-spawn( $exe_path, sleep . (5 * ($count+1))) or die $!; $pid_hash{$pid} = ; print Process $pid Started\n; }; sub handler { my $status; my $pid; my $value; my $exitcode = 0; $status = $job-status(); foreach $pid (keys %$status) { $exitcode = $$status{$pid}{exitcode}; if ($exitcode != 259) { if (exists $pid_hash{$pid}) { print Process $pid Finished : $exitcode\n; delete $pid_hash{$pid}; start_process; }; }; }; return 0; };
RE: Active directory madness - where is the phone number and the emai l
I've attached what LDAP gave me for a test user's attributes on a test script I was playing with the other day for your reference. The list will likely block it, but it should reach you directly. -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 1:37 PM To: 'Norris, Joseph'; Perl Win32 Users (E-mail) Subject: RE: Active directory madness - where is the phone number and the emai l It's not available using the WinNT provider.. The WinNT provider just has attributes that were commonly available via Lan Manager (and some more, but not telephone or e-mail). You must use the LDAP Provider.. And for that you must know the exact location of the user or use ADODB to find the actual path of the user you want to look at. Ex. zhnap . . . USNIntersite: aCSPolicyName: accountExpires: Win32::OLE=HASH(0x1a2aff8) accountNameHistory: adminCount: adminDescription: adminDisplayName: allowedAttributes: allowedAttributesEffective: allowedChildClasses: allowedChildClassesEffective: altSecurityIdentities: assistant: badPasswordTime: Win32::OLE=HASH(0x1a2b334) badPwdCount: 0 bridgeheadServerListBL: c: CA canonicalName: cn: First M. Last co: CANADA codePage: 0 comment: company: Corporate Company controlAccessRights: countryCode: 124 createTimeStamp: dBCSPwd: dSASignature: dSCorePropagationData: defaultClassStore: department: Large Department description: Description Field desktopProfile: destinationIndicator: directReports: displayName: First M. Last displayNamePrintable: distinguishedName: CN=First M. Last,CN=Users,DC=GOULDAD,DC=com division: dynamicLDAPServer: employeeID: extensionName: fRSMemberReferenceBL: fSMORoleOwner: facsimileTelephoneNumber: 111- flags: fromEntry: frsComputerReferenceBL: garbageCollPeriod: generationQualifier: givenName: First groupMembershipSAM: groupPriority: groupsToIgnore: homeDirectory: homeDrive: homePhone: 306-773-9009 homePostalAddress: info: initials: M instanceType: 4 internationalISDNNumber: ipPhone: 1.2.3.4 isCriticalSystemObject: isDeleted: isPrivilegeHolder: l: Swift Current lastKnownParent: lastLogoff: Win32::OLE=HASH(0x1a28050) lastLogon: Win32::OLE=HASH(0x1a2b2ec) legacyExchangeDN: lmPwdHistory: localeID: lockoutTime: logonCount: 0 logonHours: logonWorkstation: mS-DS-ConsistencyChildCount: mS-DS-ConsistencyGuid: mS-DS-CreatorSID: mSMQDigests: mSMQDigestsMig: mSMQSignCertificates: mSMQSignCertificatesMig: mail: [EMAIL PROTECTED] managedObjects: manager: masteredBy: maxStorage: memberOf: mhsORAddress: middleName: mobile: 316-650-5081 modifyTimeStamp: msNPAllowDialin: msNPCallingStationID: msNPSavedCallingStationID: msRADIUSCallbackNumber: msRADIUSFramedIPAddress: msRADIUSFramedRoute: msRADIUSServiceType: msRASSavedCallbackNumber: msRASSavedFramedIPAddress: msRASSavedFramedRoute: nTSecurityDescriptor: Win32::OLE=HASH(0x1a28200) name: CN=First M. Last netbootSCPBL: networkAddress: nonSecurityMemberBL: ntPwdHistory: o: objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=GOULDAD,DC=com objectClass: ARRAY(0x1a2823c) objectGUID: ¬¿e+-ï?F+-L½¦íü+ objectSid: ?? ?§ ¦FS?B¦tR°¦t,? objectVersion: operatorCount: otherFacsimileTelephoneNumber: otherHomePhone: otherIpPhone: otherLoginWorkstations: otherMailbox: otherMobile: otherPager: otherTelephone: otherWellKnownObjects: ou: pager: 913-927-3057 partialAttributeDeletionList: partialAttributeSet: personalTitle: physicalDeliveryOfficeName: Office Field possibleInferiors: postOfficeBox: 1991 postalAddress: postalCode: S9H 4M7 preferredDeliveryMethod: preferredOU: primaryGroupID: 513 primaryInternationalISDNNumber: primaryTelexNumber: profilePath: proxiedObjectName: proxyAddresses: pwdLastSet: Win32::OLE=HASH(0x1a283d4) queryPolicyBL: registeredAddress: replPropertyMetaData: replUpToDateVector: repsFrom: repsTo: revision: rid: sAMAccountName: fmlast sAMAccountType: 805306368 sDRightsEffective: sIDHistory: scriptPath: securityIdentifier: seeAlso: serverReferenceBL: servicePrincipalName: showInAddressBook: showInAdvancedViewOnly: siteObjectBL: sn: Last st: Saskatchewan street: streetAddress: 123 Address Street subRefs: subSchemaSubEntry: supplementalCredentials: systemFlags: telephoneNumber: 913-999- teletexTerminalIdentifier: telexNumber: terminalServer: textEncodedORAddress: thumbnailLogo: thumbnailPhoto: title: Big Organization tokenGroups: tokenGroupsGlobalAndUniversal: tokenGroupsNoGCAcceptable: uSNChanged: Win32::OLE=HASH(0x1a27ebc) uSNCreated: Win32::OLE=HASH(0x1a27ce8) uSNDSALastObjRemoved: uSNLastObjRem: uSNSource: unicodePwd: url: userAccountControl: 512 userCert: userCertificate: userParameters: userPassword: userPrincipalName: [EMAIL PROTECTED] userSMIMECertificate: userSharedFolder: userSharedFolderOther: userWorkstations: wWWHomePage: Web Page Field
Resolve IP address
Hello, Is there a module that anyone can recommend that will reverse resolve an IP address and return a domain. TIA. --Kevin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Regualr Expression Again...
It almost looks like you're working on a backslash, not a forward slash - which did you intend? I presume that's all you want to match, you are ONLY looking for the forward slash on the end of the line? $scandir=~/\/$/; or my preference, $scandir=~!/$!; -Original Message- From: Barlow, Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 8:38 AM To: '[EMAIL PROTECTED]' Subject: RE: Regualr Expression Again... Thanks for your input for the last question. I am trying to complete a pattern match (Determining if the string ends in a forward slash) and can't get it to work at all using: $scandir =~ /\Z\\/ I have also tried $scandir =~ /$\\/ I can get it to match at the beginning of a string using \A Can anyone advise on what I am doing wrong? I really really really appreaciate your help with this.. Regards, Neil Barlow -Original Message- From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]] Sent: 10 September 2002 15:15 To: Barlow, Neil Subject: RE: Regualr Expression You're missing a few slashes... $dir =~ s/\\/\//g; Or (more clearly) $dir =~ s|\\|/|g; To use a backslash in a matching expression and have it treated as a backslash (and not an escape sequence), you have to prefix it with another backslash. If a forward-slash is the delimiter for your expression, you have to prefix any forward slash in your expression with a backslash, too. It becomes a kind of hell... Your regex says s/\///g; or replace every forward-slash with nothing at all (delete them) -Original Message- From: Barlow, Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: Regualr Expression Hi all, I am dealing with directories and I read somewhere that it is best to use / rather than \ when dealing with directories. In order to cover my back - I am attempting to parse the string and replace any \ with / using the following: print Please enter directory to search: ; # directory prompt chomp($dir = STDIN); $dir =~ s/\///g; But the regular expression is not replacing the slashes - can anyone assist on this I really appreciate your input Regards, Neil Barlow ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Image Magick Failure under Perl
I've been using ImageMagick under perl to make thumbnails and scale pictures quite successfully. (I've done this under Win2k and WinXP). Recently I got a new computer and faithfully installed active perl 633. Using PPM I verified that I have the latest Image-Magick (5.26). On this computer even simple scripts using ImageMagick fail. The failure seems to be in magick.dll. This machine is running WinXP. I've tried rearranging the order of the path and made sure I have a valid temp variable without success. I'm fairly sure the failure is related to an installation issue (I de-installed/installed without help) The failure happens during the 'new' operation. Any suggestions? ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Disregarding Folders In A Directory
if (not -d $filespec) { print $filespec: I am a file\n } -Original Message- From: Barlow, Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 8:49 AM To: [EMAIL PROTECTED] Subject: Disregarding Folders In A Directory Hi all, I am a newbie to perl... I am using the opendir command to open up a directory and do some processing of the files contained within the directory. But the problem is that there are various folders which are being added into the directory. Is there a way to disregard the folders and just deal with te files that are in the directory? Thankyou for you assistance, Regards, Neil Barlow ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Quick Question - Decimals
Hello, I have a situation where I recieve numerical input from the user and would like to do the following: If I receive a 2 digit number, I would like to add a decimal in front of it, so that 22 will be .22 If I receive any other number, the decimal will be two places from the right, so that 113 wil be 1.13 and 1045 will be 10.45 Any help will be appreciated. --Kevin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
DBI::XBase
Hello, I am getting unreliable behavior from using DBI::XBase and am trying to get to the bottom of it. Besides the .dbf files, should any other files be in the directory that I am pointing to (such as .cdx, etc.)? Any pointers in working with XBase? The behavior I am getting is that the computer freezes and I have to reset the machine. Thanks in advance. Kevin. [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Perl TK question
Hello, I do not know much about the Perl/TK and before I begin learning it, I would like to make sure it can do what I need. The application will be for Win32 platforms. I basically need to develop a small application that will have a textbox to enter a URL which will be loaded in a browser component inside of the application (IE component - can I use activeX?). When minimized, the application will run on the system tray. Is this possible with Perl/TK? thanks --Kevin [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Fw: Hash of Hashes
Kevin wrote: Hello, I am having a bit of a problem working with nested data structures and after spending some time with the perl man pages, I am turning to the list for help. I am reading a DBI record into a hash reference - my $row = $sth-fetchrow_hashref() - I would like to create a hash to hold all of the returned rows (or thus, hashes) with the ID being the key, so for example $returned_rows{$row-{'ID'}} = $row Essentially I would have a hash of hashes, holding the result set of the query. My question is, how can I refer to the elements of a particular row? I have attempted: $returned_rows{11}{First_Name} and it returns no results (First_Name being a column). The easiest way to figure these things out is to dump the hash with Data::Dumper. use Data::Dumper; $Data::Dumper::Indent=1; print Data::Dumper-Dump([$row, $returned_rows], [qw($row $returned_rows)]); That should give you the insight to figure it out. If not, post the results for more help. Bill, Thanks for the reply. I have included the result set and some more of the code. Your help is appreciated. my $dbh = DBI-connect(DBI:XBase:C:/Perl/progs/customer) or die $DBI::errstr; my $sth = $dbh-prepare(select ID, First_Name from customer) or die $dbh-errstr(); $sth-execute() or die $sth-errstr(); while (my $row = $sth-fetchrow_hashref()) { $returned_rows{$row-{'ID'}} = $row; print Data::Dumper-Dump([$row, $returned_rows], [qw($row $returned_rows)]); } result: $row = { 'ID'= '11', 'First_Name'= 'Tom' }; $returned_rows = undef; When I attempt to put the Data::Dumper code outside of the while loop, I get the following: $row = undef; $returned_rows = undef; Thanks again. Kevin. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Mail::Sender and HTML::Template question
Hello, I am trying to send mail using Mail::Sender and have been unsuccessful. I am using HTML::Template object to hold the mail template . my $thtml = $self-load_tmpl($config-get_base_template_path . $config-get_MAIL_order_confirm_client, die_on_bad_params = 0); my $sender = new Mail::Sender {smtp = 'smtp.irubin.com', from = '[EMAIL PROTECTED]'}; $sender-Open({to = $Email, subject = 'SUBJECT'}); $sender-Send($thtml-output); $sender-Close; Thanks in advance. -Kevin [EMAIL PROTECTED] http://www.irubin.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: style
$file="${invar1}.txt"; Kevin Ireland Sr. Systems Engineer Gentiva Health Services (913) 814-2169 [EMAIL PROTECTED] -Original Message- From: Jean-Paul Felix [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 15:46 To: Perl-Win32-Users (E-mail) Subject: style Is there a more eloquent way to append .txt to a (string) variable please? $file=$invar1; $file.=".txt"; thanks ___ 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: mkdir
Christopher, You need to encase the parms in (). The following statements are equivalent due to the default mask that is applied. mkdir ("dirname"); mkdir ("dirname", "0777"); Kevin Ireland Sr. Systems Engineer Gentiva Health Services (913) 814-2169 [EMAIL PROTECTED] -Original Message- From: Christopher Hahn [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 16:19 To: Perl win32 email list (E-mail) Subject: mkdir Hello all, I got a compaint from mkdir that I didn't have sufficient arguments, when I thought that just the dirname should do. i.e. either mkdir "dirname"; or mkdir "dirname", "0777"; Here is the error: Not enough arguments for mkdir at scbuildprep.pl line 401, near ""updates"; Here is the command: mkdir "updates"; Wassup? Christopher -- Realisant mon espoir, je me lance vers la gloire Christopher Hahn: [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
(no subject)
Has anyone used Net::Telnet to connect to a Cisco Switch? Thanks, Kevin Foster Systems Administrator Engineering Services - Vignette Corp. Desk: (512) 741-1356 Cell: (512) 970-6748 "Building a better idiot through automation" ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
RE: Date math
True enough...it is a very large module. I use it in several scripts that run on a fairly slow mail server but haven't seen any serious problems with speed. I make the (perhaps naive) assumption that coders will read the documentation that comes with modules and would, therefore, discover the author's warning about size and speed. My recommendation comes from the surprisingly good results I am able to achieve with this package. The original post was fairly sparse and not knowing the writer's requirements, I recommended the most full-featured module that I have experience with. Kevin Crow Business Programmer/Analyst II Zetron, Inc Kirkland, Wa USA (425) 820-6363 www.zetron.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thomas_M Sent: Monday, November 20, 2000 5:39 AM To: [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject: RE: Date math Kevin Crow [mailto:[EMAIL PROTECTED]] wrote: the Date::Manip module is incredible. It will do date math as well as lots of other cool stuff. I haven't used Date::Manip; I use Date::Calc, and it has done what I needed to do. However I want to note a few things about Date::Manip. In the documentation, the author talks about it being the biggest and slowest date module, and perhaps the largest module in CPAN. The docs start out like this: "If you look in CPAN, you'll find that there are a number of Date and Time packages. Is Date::Manip the one you should be using? In my opinion, the answer is no about 90% of the time." Date::Manip is an everything-and-the-kitchen-sink approach, and while it is perhaps useful, there should be caveats attached with a recommendation of it. If you are writing CGI with more than a handful of users or are otherwise concerned about speed and/or size, look elsewhere. -- Mark Thomas[EMAIL PROTECTED] Sr. Internet Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ 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