RE: readdir problem

2006-11-29 Thread Peter Eisengrein
Hi all, I am trying to read only files in a directory; I need to jump over the dot files and any subdirectories. Seems like a simple thing, however with opendir(DIR, $dir) || die can't opendir $dir: $!; foreach my $file (readdir DIR) { next if (/^\./); # skip over dot files

RE: Backticks and IIS6.0

2006-11-16 Thread Peter Eisengrein
I'm moving from Windows 2000 (IIS 5) to Windows Server 2003 (IIS6). I'm unable to capture the output of a program using backticks in a CGI script. I tried v5.6.1 build 631 and v5.8.8 build 819 with the same results. Below is a trivial CGI script as an example. use CGI ':standard';

RE: time manipulation

2006-10-27 Thread Peter Eisengrein
I would like to know if there exists some module that is able con add and substract times. For example, I want to see the time in seconds between the beginning and ending of an application. Something like this: $a=13:12:01; $b=13:02:01; $c=$a-$b; I would like $c to be

RE: Active Perl and custom (simple) modules - differences from li nux?

2006-06-08 Thread Peter Eisengrein
Title: RE: Active Perl and custom (simple) modules - differences from linux? This causes a different error: [error] [client 127.0.0.1] Bareword db not allowed while strict subs in use at ... [error] [client 127.0.0.1] Undefined subroutine main::db called at ... Can anyone see

RE: Suppressing OS messages in CGI

2006-06-08 Thread Peter Eisengrein
Use backticks instead. For example, my @dir = system(dir); # pushes data into @dir and prints my @dir = `dir`; # silently pushes data into @dir -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of EdSent: Thursday, June 08, 2006 4:12 PMTo:

RE: Looking for example Perl scripts to be used in Perl Training.

2006-05-22 Thread Peter Eisengrein
All the POD's have example code. True, but real beginners aren't going to be doing anything with Modules right away. I'd go to the Llama book first. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe:

RE: Network Timeouts

2006-05-12 Thread Peter Eisengrein
Dilemma, I have many scripts that have to hit every machine in my domain .. about 2400. I can't use Net::Ping to test the alive status of the boxes because our internal DNS system is a real PITA to clean up and using as-is will leave me with bad results. For now, I'm

RE: Finding partly duplicated records

2006-05-09 Thread Peter Eisengrein
Title: RE: Finding partly duplicated records I have a list of machines and IP addresses. The combination, $machine and $IPAddress is never duplicated in the list. However, $IPAddress may be duplicated and $machine may be duplicated. You can actually do this in a single pass and a

RE: running a perl app

2006-04-19 Thread Peter Eisengrein
Title: RE: running a perl app To determine the correct path for your perl interpretor, use: which perl -- Please give me a context. Note that the original post pertained to a Unix-like system (not Windows) - and the answer you've quoted above pertains primarily to

RE: waking up a sleeping thread

2006-04-19 Thread Peter Eisengrein
## do something here to wake the thread up ... but what? You can try: $thr-freshCoffee(); and if that doesn't work, you can try: $thr-inviteMyKidsOverOnASaturdayMorning(); The latter always seems to work for me. :) ___ Perl-Win32-Users

CGI Cookies on IE7.0, somewhat OT

2006-04-17 Thread Peter Eisengrein
I've written a CGI that used to work on IE6 but does not on IE7. That is, there is a form that writes a cookie which a second page then uses for processing. With IE7 the cookie comes up blank (but still works with Firefox and used to work with IE6). Has anyone played with IE7 and seen

RE: Replace Leading Spaces

2006-04-07 Thread Peter Eisengrein
Nelson, Please add Mark Thomas' solution to your timings to see how it compares to the others: I'd be curious to see how Wags' sprintf compares as well: s/^(\s+)/sprintf %s, q[0]x length($1)/eg; ___ Perl-Win32-Users mailing list

RE: Finding duplicate string in a set of files and sections

2006-04-06 Thread Peter Eisengrein
Thanks Peter, that will help. I am wondering if the use of anonymous hash and array may make more sense here than doing a bunch of `grep`. Can somebody show me how I would use it here? This isn't anonymous, but here's how I'd tackle it: ### untested my %dups; my %totaldups; foreach my

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Peter Eisengrein
system(qq~agrep $fir\t$sec\t $outfile tmp~); ## agrep is an external utility to find search pattern in a file and transfer it into other file. system(qq~agrep $thr tmp tmp1~); ## agrep is more faster than regular expression. Are two system calls to agrep really faster than a single,

RE: Finding duplicate string in a set of files and sections

2006-04-05 Thread Peter Eisengrein
I have this program below that work correcly but the performance is slow if the files are big. How can I write a program to do this instead the one I wrote. Without getting into too much detail there are several things that can help, all are related to the overall architecture of the code.

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Peter Eisengrein
Actually Regex is taking more time instead of agrep. That's why the idea of using either agrep or find. This is small input.txt which I am using it as a input file. If there is any other way of increasing the speed of same Perl script, it is really required. I don't have agrep but since

RE: [Perl-unix-users] how to improve text manipulation

2006-03-10 Thread Peter Eisengrein
While the foreach() may be slow, I don't see any way around it if it is possible that the date codes may change. Can you show some code? People may have ideas on how to improve performance of what you've already written. -Original Message-From: [EMAIL PROTECTED]

RE: I need your opinion: perl vs php

2006-02-27 Thread Peter Eisengrein
How wedded are you MySQL ? I personally would use it only for situations where there was a single user connecting at a time (or at most only a few) and data integrity is not important. MySQL lacks too many features of a reliable database for me to trust it. I don't want to get too

RE: remote ODBC problem

2006-01-06 Thread Peter Eisengrein
Has anyone else run into this problem and have found a solution? I am making an ODBC connection to a remote MS Access DB from my web server. When my Perl script runs, it cannot open the data source. I tested the connection using MS Query, and it is fine. Why can't Perl access the

RE: Comparing 2 text files

2005-11-11 Thread Peter Eisengrein
What is the best way to compare 2 text files for matching. Let's say both files have just people names Thanks Does it matter what position they are in, or do you only want to know what exists in both files? If it doesn't matter, you can do it as follows: my $count = 0; my $count2 = 0; my

RE: IP address calculation

2005-10-25 Thread Peter Eisengrein
I get IP network definition in format like this one 10.10.16.0/23 and need to calculate after counter additional networks. In the first step I need to validate the correctness of delivered IP network definition. In the second step increment in valid steps additional networks. In the

RE: send a UDP paket without a session

2005-10-11 Thread Peter Eisengrein
There is a Net::UDP module. It doesn't mention whether it is stateless, but since it is UDP I would have to assume it is. -Original Message-From: Markus [mailto:[EMAIL PROTECTED]Sent: Tuesday, October 11, 2005 11:25 AMTo: perl-win32-users@listserv.ActiveState.comSubject:

RE: Parsing PIX Log

2005-10-07 Thread Peter Eisengrein
my $entry = 'Sep 26 17:05:11 pixfw.testsec.org %PIX-3-106010: Deny inbound protocol 12 src outside:123.97.104.117 dst intf2:192.168.50.10'; my ($src,$dest) = $entry =~ /:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).+:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} )/; -Original Message- From: Kamal

IO::Socket::INET question

2005-08-31 Thread Peter Eisengrein
I have an app using IO::Socket::INET that accepts (and makes) connections. If the connection drops for whatever reason it takes a couple minutes for that tcp port to be flushed and accept a new connection. My question: if I add the ReusePort option to the new() method, will this flush the

RE: :Socket::INET question

2005-08-31 Thread Peter Eisengrein
You need to use the IO:Select module which makes the ports non- blocking. When you check the port for reading, it will indicate there is something to read. When you read it using sysread if it returns: 0 = the socket has disconnected. undef = there was an error on the handle, $! has been

RE: creating a combo box

2005-08-01 Thread Peter Eisengrein
Hi, Sorry for my previous message. I have discovered that I was using an older version of Win32::GUI that was installed using ppm, but now after installing it from cpan.org, it works fine. Nevertheless, the problem is that the Dialog was missing the -name parameter.

RE: Split function in Perl

2005-07-26 Thread Peter Eisengrein
I have a problem with the split function. string - - - one two three four five six seven should be split to - - - one two three four five six seven I seem to recall seeing this a long time ago done in a one-liner using eval. Anyone remember that?

RE: Change in goto behavior

2005-07-13 Thread Peter Eisengrein
At 08:30 AM 7/13/2005, Hugh Loebner wrote: Why on earth are you using a goto statement? They are pernicious. We have a goto in our code. I hate it, but there just isn't a good switch or case statement in Perl yet (I think I've heard that it's planned) It's not a case/switch, but you

RE: Change in goto behavior

2005-07-13 Thread Peter Eisengrein
if ($choice !~ /^sub[12]$/) { badchoice; } else { {$hash{$choice}}; } Actually this if statement should've been if ($hash{$choice}) { {$hash{$choice}}; } else { badchoice; } Much more gooder than the regex.

RE: Problem setting repository

2005-07-12 Thread Peter Eisengrein
ppm set repository RothConsulting http://www.roth.net/perl/packages Unknown or ambiguous setting 'repository'. See 'help settings'. Try ppm repository add RothConsulting http://www.roth.net/perl/packages ___ Perl-Win32-Users mailing list

RE: How to find the perl install directory?

2005-07-08 Thread Peter Eisengrein
Here's one way: ### for $dir (split(/;/,$ENV{'PATH'})){ opendir(DIR, "$dir") ||die "Can't open $dir for reading : $!\n"; while ($_ = readdir(DIR)){print "$dir\n" if ($_eq 'perl.exe');} close(DIR);} -Original Message-From: Apurva Shukla [mailto:[EMAIL PROTECTED]Sent:

RE: Notify me when upload complete.????

2005-07-05 Thread Peter Eisengrein
Yes I would like to do that!! However...Remember when a webserver script runs... I don't think it has the rights of the logged-in user. I tried a few things and don't know how to get by this. Which is why I posed this question ;o)) I've never used it, but Net::AIM looks like

RE: mystery

2005-06-29 Thread Peter Eisengrein
Can someone tell me what's going on in my script? Here it is: use strict; use POSIX qw(INT_MAX); my $i = INT_MAX; my $n = INT_MAX - 1000; print(i = $i\n); print(n = $n\n); Not sure of the *why* (I'm sure someone on the list smarter than I can answer), but it works if you change it

RE: mystery

2005-06-29 Thread Peter Eisengrein
The problem I'm having is with HTML emails, but that's a topic for another thread :-| You just had to open THAT can of worms again, didn't you? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe:

RE: Finding current directory

2005-06-27 Thread Peter Eisengrein
Hello all, How do I get the path name of the current directory? In other words, how can I find out the name of the folder in which a program is executing? use Cwd; my $cwd = cwd; Another way would be to parse it out of $0 ___

RE: Find the date of the newest file????

2005-06-20 Thread Peter Eisengrein
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?? I seem to recall a post on the list (probably in the last 6 months or so, certainly in the last 12) about a faster way to

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Peter Eisengrein
What would be the code if i used Win32:ODBC? The result of the select statement is a single value and not an array. Appreciate your help, as I am new to using remote connections to a SQL database with Perl. I have used itin a while loop and performed thousands of

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Peter Eisengrein
gt; } else{ print "Query returned no results.\n";} print $data[0];Peter Eisengrein [EMAIL PROTECTED] wrote: What would be the code if i used Win32:ODBC? The result of the select statement is a single value and not an array. App

RE: assigned array to keys of hash?

2005-06-06 Thread Peter Eisengrein
There's no way that I know of to do a bulk import of hash keys. what about map? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Net::Telnet

2005-06-01 Thread Peter Eisengrein
Hi, I am using this module (Net::Telnet) downloaded from CPAN, for a small interactive program in which I telnet to a particular host, login and give some commands (based on the options you get). I am not able to do this. I am able to login but whatever I do after that doesn't seem to

PalmOS Outlook sync?

2005-05-31 Thread Peter Eisengrein
Does anyone know of a module out there that does a PalmOS to Outlook HotSync? Searching cpan, it looks like there are several Palm modules and several Outlook modules, but not necessarily one to act as a conduit and to synchronize them. Certainly seems do-able but I didn't want to

RE: Passing parameters

2005-05-27 Thread Peter Eisengrein
I have two small .pl programs I've written. One calls the other with Win32::Process. The child program is just a splash screen. When the parent is done with its thing, I kill the child process. Works ok. What I would like to do is create a status bar on the splash. I have that

RE: network inventory

2005-05-26 Thread Peter Eisengrein
Is there anything out there that would allow to identify a network device as a (router, switch, firewall etc)? You can use snmp for this, but it is up to each manufacturer how (and where) they define it in the MIB. If it allows snmp put, you could change it, though (again, up to the

RE: Measure bandwidth

2005-05-25 Thread Peter Eisengrein
If your intention is specifically to measure CIFS performance, copying a few files back and forth would be ok, but try and pick a quiet time on the WAN... I disagree. If the intent it to measure user experience, you probably want to poll at regular intervals (say every 5 minutes) whether

RE: Measure bandwidth

2005-05-24 Thread Peter Eisengrein
If you are looking for download speed, your approach will probably work. If you want bandwidth stats, use MRTG. http://people.ee.ethz.ch/~oetiker/webtools/mrtg/ It's already written. It's customizable. It's perl. It does an snmp get (defaults to the interface usage but can read any snmp

RE: Changing file date info

2005-05-18 Thread Peter Eisengrein
Somewhere I read of an interesting method for marking files for backup. The plan is to mark files that have been backed up with a time that is impossible, like 10:61. Who really cares about the seconds on a file name? I plan to make at least two backups of each file on my computer

RE: Wintel MAC address fetch

2005-05-18 Thread Peter Eisengrein
There has got to be a more perl-ish way but a quick-n-dirty way would be to do a system('ipconfig /all') call, capture it, and do a regex for Physical Address and parse it out. -Original Message- From: Jan Miller [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 18, 2005 12:23 PM To:

RE: Wintel MAC address fetch

2005-05-18 Thread Peter Eisengrein
Can the MAC address of a computer which is not in the LAN be found using this method? Or... is there a method to find the mac address of a computer by its IP? Thanks. Teddy Yes, the ARP protocol is for exactly this. Just searched CPAN and (of course) there is a module called

RE: [OT] copy/paste editors

2005-05-17 Thread Peter Eisengrein
For god's sakes, I wouldn't wish notepad on anyone. Get a decent editor and learn how to use it. Okay mom! Grin. Hey, his ranting got me to download vim, so he's got one convert. :-) ___ Perl-Win32-Users mailing list

[OT] copy/paste editors (was: strangeness with if blocks)

2005-05-16 Thread Peter Eisengrein
I also have an editor I think is rather good (PrimalScript). When I copy and paste a troublesome block into an email, the code becomes an unholy mess I must dive into and manually fix, line by line. I have an editor that I think is pretty good (Optiperl) The problem is that

RE: File Parsing

2005-05-15 Thread Peter Eisengrein
Kamal, Welcome! You will find on this mailing list a generally friendly group. However, most will tell you they are glad to help if you take a shot at the code first and then show a snippet of the code where you are having a problem. Since you are new, I will gladly point you in the right

RE: MSWord Document Parsers

2005-05-05 Thread Peter Eisengrein
I presume you need to do this programmatically? Otherwise, why not just use MSWord-Save As... -Original Message- From: Lasher, Brian [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 04, 2005 2:36 PM To: Perl-Win32-Users@listserv.ActiveState.com Subject: MSWord Document Parsers

RE: MSWord Document Parsers

2005-05-05 Thread Peter Eisengrein
100s of files to do. There's probably a better way, but you could do a mass substitution of all extended ascii (chr's 128-255?) characters, replacing them with null. That would probably leave a bunch of other stuff in the file but it would be a start. Another, probably more complete option

RE: captive cursor

2005-05-02 Thread Peter Eisengrein
I just wanted to add that this is standard Windows multiline textbox behavior. Tab and Enter keys are kept within the control because they are supposed to be and that is most likely what your users will be expecting. Redefining this standard UI behavior is not recommended but obviously

RE: Store hash in SQL

2005-05-02 Thread Peter Eisengrein
Can you just do something like the following? my @sqlarray; foreach my $key (keys %hash) { push(@sqlarray,$key,$hash{$key}); } my $sqlscalar = join(|,@sqlarray); # ... database update Then when you retrieve it from the database you can just use map to put the hash back together. -Pete

RE: captive cursor

2005-04-29 Thread Peter Eisengrein
I have created a program with a few controls including a text field, but if I move the focus to that text field (or rich edit) I cannot move the focus to another control using the tab key, but only the mouse. For the RichEdit, there may be a more elegant way, but since tab

RE: captive cursor

2005-04-29 Thread Peter Eisengrein
my $Text = $W-AddTextfield( -name = 'TextField', -text = 'example', -top = 10, -left = 10, -width = 480, -height = 300, -multiline = 1, -tabstop = 1, ); The problem here seems to be with -multiline, because if you comment that out it works. Probably best to use a RichEdit. my

RE: captive cursor

2005-04-28 Thread Peter Eisengrein
Is this Win32::GUI or Tk? -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 10:27 AM To: Perl-Win32-Users@listserv.ActiveState.com Subject: captive cursor Hi, I have created a program with a few controls including a text

RE: Finding the number of CPUs on a windows 2003 terminal server

2005-04-25 Thread Peter Eisengrein
Does $ENV{'NUMBER_OF_PROCESSORS'} have the info you want, or are you looking for something else? -Original Message- From: Sandhu, Suchindra [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 9:45 AM To: perl-win32-users@listserv.ActiveState.com Subject: Finding the number of

RE: This is fun

2005-04-18 Thread Peter Eisengrein
$x=10; $x=$x++; print $x\n; $x=10; $y=$x++; print $x\n; #Results: $x=10, $x=11. #I understand it, but I think it's weird anyway. The first result ($x=10) puzzles me. Are not the $x on the LHS and RHS refering to the same scalar? I would think that

RE: Win32::GUI

2005-04-18 Thread Peter Eisengrein
$W-{dialogui} = 1; Is this correct? Actually it is $W-{-dialogui} = 1; But the problem is that the interface is still not accessible for a screen reader. No object from the form has the focus. If I pressed on a button using the mouse, it got the focus, but I was not able to

RE: Comparing strings

2005-04-12 Thread Peter Eisengrein
(1) use string length (number of characters a string holds): $length = length($name); I'd stay away from this as it will eventually let you down. For example: my $str1 = 'I'd stay away from this as it will eventually let you down.' my $str2 = 'My Mom will not stop looking at Internet

RE: function named reset()

2005-04-08 Thread Peter Eisengrein
To force interpretation as a subroutine call, either put an ampersand before the subroutine name, or qualify the name with its package. Alternatively, you can import the subroutine (or pretend that it's imported with the use subs pragma). 'use subs' doesn't seem to always work, though. when

RE: function named reset()

2005-04-07 Thread Peter Eisengrein
use subs 'reset'; Another way is to explicitly state that you want to use the main namespace: ### use strict; my $x = 'a'; my $y = 'b'; print x=$x,y=$y\n; reset; print x=$x,y=$y\n; main-reset; print x=$x,y=$y\n; sub reset { $x = 'c'; $y = 'd'; }

RE: function named reset()

2005-04-07 Thread Peter Eisengrein
I really think that this is the only genuinely useful suggestion I've heard. May be so, but I bet you make an effort in the future to not clobber built-in functions. Although, I think the 'use subs' pragma is a good suggestion as it would only require one added line.

RE: detect name of username and password of user

2005-04-06 Thread Peter Eisengrein
$ENV{'USERNAME'} contains the user. As far as password, well, Windows has security problems but it's not *that* insecure. Best bet is to grab the user and ask them to enter the password. If you want to keep the password from showing up, check out Term::ReadKey -Original

RE: smtp on non port 25

2005-04-05 Thread Peter Eisengrein
I've been using Mail::Sender and looked at Net::SMTP - is there a way or any other modules to use another port besides port 25? My isp has shut 25 down. Looking at the source of the module, it looks like you can define it in your new() statement: $smtp = Net::SMTP-new('mailhost', Port =

RE: smtp on non port 25

2005-04-05 Thread Peter Eisengrein
Looking at the source of the module, it looks like you can define it in your new() statement: $smtp = Net::SMTP-new('mailhost', Port = 12345); Yes, but then there's the slight problem that the receiving mail server has to be listening on that port :) Judging by the volume

RE: Google API

2005-03-25 Thread Peter Eisengrein
When I use the following code: use LWP::Simple; getprint(http://www.google.com/search?q=perl;); I get: 403 Forbidden URL:http://www.google.com/search?q=perl But when I do this: use LWP::Simple; getprint(http://www.google.com/;); I get the HTML in return. So, it might be Google that is

RE: copying structures

2005-03-17 Thread Peter Eisengrein
Roll your own? This is Perl, remember? It's already done :) Its great that it's already done but the bigger question, to me, is why does it copy a reference in the second example. I don't get it. Confused... ___ Perl-Win32-Users mailing list

RE: copying structures

2005-03-17 Thread Peter Eisengrein
Its great that it's already done but the bigger question, to me, is why does it copy a reference in the second example. I don't get it. In the first example, it's a list of scalars. The scalars are copied. In the second example, it's a list of anonymous hash references. The

RE: Keyword search is dragging

2005-03-15 Thread Peter Eisengrein
A couple of questions: 1- are you closing IN anywhere? 2- are you doing a foreach $keyword on every line of every file? That *could* get slow. 3- Does it start out fast and get slower as it goes? Or is it slow from the start? -Original Message- From: Craig Cardimon [mailto:[EMAIL

RE: adding a title to a file on windows

2005-03-10 Thread Peter Eisengrein
First you need a hard-and-fast rule for converting the names. In your example it would look like you want everything up to the last number in the second "word" (where words are delimited by "_"). Also, is it safe to assume they are all in the same directory? If that is the case, it could be

regex confusion...

2005-02-21 Thread Peter Eisengrein
Hey gang... having a bit of a regex conundrum. I have the following statement: ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: regex confusion...

2005-02-21 Thread Peter Eisengrein
also match a filename that starts with ccs_trsum. What am I doing wrong? -Original Message-From: Peter Eisengrein Sent: Monday, February 21, 2005 5:02 PMTo: Perl-Win32-Users Mailing List (E-mail)Subject: regex confusion... Hey gang... having a bit of a regex conundr

RE: :ping broken in 5.8.6?

2005-02-16 Thread Peter Eisengrein
For the record, it works ok with v5.8.3 on WinXP/SP2 -Original Message- From: Paul Sobey [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 8:30 AM To: Chris; perl-win32-users Subject: RE: :ping broken in 5.8.6? Does anyone know anything more about this? I've just

RE: Reg. expression help

2005-02-16 Thread Peter Eisengrein
You can do this a few ways. Here are two: my ($way_1) = $string =~ /(\w+\s{1,}\w+)\s{1,}\w+$/; my ($way_2) = join( ,@_[0,1] = split(/ +/,$string)); print way_1 = $way_1\n; print way_2 = $way_2\n; Out of curiosity, I benchmarked these and the regex is faster than the array slice. Lucky for me,

RE: Directory browsing in a dialogbox

2005-02-10 Thread Peter Eisengrein
THere are probably several ways to do this. Here's one: use Win32::GUI; my $file = Win32::GUI::GetOpenFileName(); print $file; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 10, 2005 3:04 PM To:

RE: executing Desktop shortcut

2005-02-04 Thread Peter Eisengrein
Worked ok for me opening a Word template on WinXP Pro: system('C:\Documents and Settings\peter\Desktop\LETTERHEAD.dot.lnk'); -Original Message- From: M. Smith [mailto:[EMAIL PROTECTED] Sent: Friday, February 04, 2005 4:28 PM To: perl-win32-users@listserv.ActiveState.com Subject:

RE: Sleep()

2005-01-14 Thread Peter Eisengrein
You might also check out these fine modules: Win32 Time::HiRes -Original Message- From: Allen, Matthew [mailto:[EMAIL PROTECTED] Sent: Friday, January 14, 2005 4:36 PM To: Chris; perl-win32-users Subject: RE: Sleep() sleep EXPR sleep Causes the script to sleep for EXPR

RE: using perl without installing it

2004-11-19 Thread Peter Eisengrein
Title: RE: using perl without installing it I have done it with perl residing on a network drive. As I recall, there was a minimum of files that was required, probably a .dll or two. So you can probably do it with a cd. Good luck. -Original Message- From: Miha Radej

RE: A regular expression question

2004-11-11 Thread Peter Eisengrein
Title: A regular expression question Your format does not match XXX-XXX-XXX so I'll guess you mean three fields delimited by a dash. here's one way to do it $string = "sct-1.62-1"; print "$1\n" if ($string =~ /^.+\-(.+)\-.+$/) -Original Message-From: Cai, Lixin (L.)

RE: Probably need help with a hash to do this

2004-11-10 Thread Peter Eisengrein
Title: RE: Probably need help with a hash to do this List::Compare does look like a neat way to do this. If you want to do code it yourself you could also use this fairly simple code. use strict; my @data = ""> '08|10|13|16|19|22|28|32|33|37|41|46|47|50|51|52|53|55|71|76', # row 1

RE: regex help

2004-11-02 Thread Peter Eisengrein
Title: RE: regex help Assuming your dates are always in the same format, this would work: print $1\n while ($_ =~ /(\d{1,2}\:\d{2} [ap]m)/gi); -Pete -Original Message- From: Malcolm Mill [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 02, 2004 4:11 PM To: [EMAIL

RE: Win32::MsgBox sometimes appears minimized

2004-10-13 Thread Peter Eisengrein
Title: RE: Win32::MsgBox sometimes appears minimized sometimes the same msg appears in the foreground (thats ok) but sometimes appears minimized in the background and i don't know why. Is there a pattern or commonality to when it does and does not happen? Can you show some code on how

RE: why doesn't this work?

2004-09-28 Thread Peter Eisengrein
Title: RE: why doesn't this work? One other way would be: sub callme { if ($ENV{Oracle}) { print Version 1\n; } else { print Version 2\n; } } I realize this is not quite the same thing, but why not do it this way? -Original Message- From: Eric Amick [mailto:[EMAIL

RE: Incrementing the date?

2004-09-13 Thread Peter Eisengrein
Title: RE: Incrementing the date? There may be a cleaner way, but I would use Time::Local and convert the date to epoch time, add one day (86400 seconds), then convert it back using localtime(); I can count from 0 to 23, and if the hour is missing insert it along with zero data, but how

RE: CGI grep

2004-09-09 Thread Peter Eisengrein
The short answer is, yes, perl is great for this kind of tast. Now, specifically, you want to have the user input a string and then match for it in the files in the mailq? Or, perhaps the string is their email address? However you want to address it, the logic will be pretty much the same:

RE: CGI grep

2004-09-09 Thread Peter Eisengrein
oh yeah, one thing I should've added to boost speed. If you found a match no need to keep looking, thus add the last statement if ($line =~ /$string/i) { print "$file MATCHES!!!\n"; # or whatever you wish to do with this last; }

RE: CGI.pm Question

2004-08-05 Thread Peter Eisengrein
Title: RE: CGI.pm Question #untested @names = $query-param; foreach (@names) { push(@array, $query-param{$_}); } #However I'd probably use a hash instead, like: foreach (@names) { $hash{$_} = $query-param{$_}; } #but that's just me... -Original Message- From: [EMAIL

RE: CGI.pm Question

2004-08-05 Thread Peter Eisengrein
Title: RE: CGI.pm Question oops, wrong bracket type. Use parens: push(@array, $query-param($_)); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 05, 2004 10:50 AM To: Peter Eisengrein; '[EMAIL PROTECTED]'; [EMAIL PROTECTED

RE: perl eating up memory slowly until program stops - any ideas ?

2004-07-06 Thread Peter Eisengrein
Are you using strict? That's the first recommendation. -Original Message-From: Jasper Marzin [mailto:[EMAIL PROTECTED]Sent: Tuesday, July 06, 2004 1:13 PMTo: [EMAIL PROTECTED]Subject: perl eating up memory slowly until program stops - any ideas ? Hello out there in

RE: Inventive ways to parse configuration files?

2004-06-07 Thread Peter Eisengrein
Title: RE: Inventive ways to parse configuration files? If your config files will be read and written only by Perl, you could just use Data::Dumper to write and then read your config hash. Or, you can simply write your config as a hash(es) (and/or arrays and/or scalars) and then

RE: SNMP/OID

2004-06-01 Thread Peter Eisengrein
If you are looking to do usual router-type stuff, save yourself the effort and use Tobias Oetiker's perl-based MRTG http://people.ee.ethz.ch/~oetiker/webtools/mrtg/-- this is a *great* app that creates graphs on any OID you tell it, but defaults to the usual sysuptime and interface stats.

RE: perl/spider/crawling question...

2004-05-27 Thread Peter Eisengrein
Title: RE: perl/spider/crawling question... if you can assume the info you want is somehow linked to their main page (either directly or by proxy) then you should be able to keep a file or database of each school's url. Then use on of the various modules (Win32::Internet, LWP, etc) to get the

RE: Regular expression to test for numeric values

2004-04-01 Thread Peter Eisengrein
Title: RE: Regular expression to test for numeric values use Scalar::Util; if (Scalar::Util::looks_like_number $num) { print Yes, $num is a number\n; } else { print no.\n; } ... found it with perldoc -q number, which also showed a number of regex's that do the same kinda thing

RE: Can a variable be made like this?

2004-03-24 Thread Peter Eisengrein
Title: RE: Can a variable be made like this? you can do what you want, but not quite as you stated. It would be something like this: $hi = $db-lookup; # how you do this depends on your db and script $hello = ${hi}goodday; print $hello; -Original Message- From: Kenneth Lodahl

RE: hash experts - hash key modification on all keys?

2004-03-09 Thread Peter Eisengrein
Title: RE: hash experts - hash key modification on all keys? For instance I want to run through all keys (as well all sub keys if hashes of hashes occurs) and replace spaces with underscores and set all to lower case. Wouldn't it be easier to replace the spaces before the keys are

RE: Query On Grep

2004-02-06 Thread Peter Eisengrein
Title: RE: Query On Grep you're absolutely right. That's what I get for coding without thinking. :-) -Original Message- From: Rhesa Rozendaal [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 04, 2004 6:42 PM To: Peter Eisengrein; [EMAIL PROTECTED] Subject: Re: Query On Grep

RE: Loadtests with perl?

2004-01-22 Thread Peter Eisengrein
Title: RE: Loadtests with perl? For filesystem-io you may be able to write a short sub that writes to a file and another that reads and then use Benchmark to exersize each 10 times or so. As for ethernet, are you looking to generate load, or do you just want to know stats about how it is

  1   2   >