RE: Perl on external hard drive

2006-09-11 Thread Timothy Johnson
Since Perl doesn't use the registry or absolute paths to find its modules that should work just fine. The only thing to watch out for is that you will be violating the ActiveState license if you distribute your own ActivePerl distribution outside of your organization without getting their okay

RE: 'use strict' and filehandles

2006-08-31 Thread Timothy Johnson
If you want to pass a filehandle like that I would recommend using the FileHandle module. As your script stands, however, you have no reason to pass the filehandle to the subroutine. You can just do a print ERRLOG $scalar to print. -Original Message- From: Ted Fines [mailto:[EMAIL

RE: Reading Excel spreadsheet into variables

2006-08-29 Thread Timothy Johnson
One more thing: If you're not already doing so, you should probably start putting use strict; use warnings; at the top of your scripts. It will be a pain in the short term but will help you out later on. -Original Message- From: Stephan Gross [mailto:[EMAIL PROTECTED] Sent:

RE: How do i open excel files under linux

2006-08-28 Thread Timothy Johnson
This is true, however I believe Spreadsheet::ParseExcel still works under Linux. -Original Message- From: Toddy Prawiraharjo [mailto:[EMAIL PROTECTED] Sent: Monday, August 28, 2006 4:05 PM To: beginners@perl.org Subject: How do i open excel files under linux Is it possible to open

RE: Reading Excel spreadsheet into variables

2006-08-28 Thread Timothy Johnson
$everything is a scalar reference to an array. You can dereference the array with the '@$everything' notation or the '@{$everything}' notation. (The second one removes any ambiguity about the reference, but 99% of the time the first way is okay.) You can access elements of the array by either

RE: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Timothy Johnson
Comments below. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 6:25 PM To: Perl Beginners Subject: Re: Using a regular expression to remove all except certaincharacters. Dr.Ruud wrote: snip You might actually be looking for this:

RE: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Timothy Johnson
Didn't see this one before I hit 'Send'. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 6:28 PM To: Perl Beginners Subject: Re: Using a regular expression to remove all except certaincharacters. John W. Krahn wrote: snip Or remove

RE: how to create a serial of array names in perl

2006-08-17 Thread Timothy Johnson
Yes, it is possible, but it would be ill-advised. I think what you are really looking for is an array of arrays. Check out 'perldoc perllol' (list of lists) for a description of how to do this. It's a good technique to learn anyway, since it opens the doors to more complex data structures.

RE: line command in perl

2006-08-16 Thread Timothy Johnson
I believe you want 'perldoc -f splice'. -f is for internal functions. -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 9:31 AM To: beginners@perl.org Subject: line command in perl Dear all, I want to find the usage of a specific function

RE: Recursive Copy

2006-08-16 Thread Timothy Johnson
Check out the File::Find. You can use it to recursively find and copy all of the files. If you want to manipulate the files based on pathname or filename, also check out File::Basename. Both should already be on your computer. -Original Message- From: Steve Jardine [mailto:[EMAIL

RE: math module and array manipulation

2006-08-14 Thread Timothy Johnson
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Monday, August 14, 2006 4:48 PM To: beginners@perl.org Subject: Re: math module and array manipulation chen li wrote: Dear all, I have an array contains 12 numbers. I want to calculate the mean and standard

RE: database troubles

2006-08-10 Thread Timothy Johnson
I have no idea what dbmopen is, but I would seriously recommend scrapping all of that and just going with DBI and DBD::ODBC (the DBI driver that allows you to work with ODBC data sources). Here's a small example of how you can work with DBI to get data from a database using a DSN you set up on

RE: Access MDF files

2006-08-09 Thread Timothy Johnson
Have you taken a look at the DBI documentation? my $sth = $dbh-prepare('SELECT * FROM Table'); $sth-execute(); while(my $row = $sth-fetchrow_hashref()){ my $name = $row-{NAME}; } -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 09, 2006 9:09

RE: string to perl

2006-08-07 Thread Timothy Johnson
Check out the documentation on the eval function perldoc -f eval -Original Message- From: Ryan Perry [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 1:12 AM To: Perl Beginners Subject: string to perl I have a string I want to pass to another function and I want that

RE: Downloadable Perl Manual

2006-08-03 Thread Timothy Johnson
If you're using Windows then ActivePerl integrates all of the perldocs into its HTML documentation. Start--Programs--ActivePerl--Documentation. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 03, 2006 10:28 AM To: beginners@perl.org Subject:

RE: perl script calls batch file

2006-08-03 Thread Timothy Johnson
Your best bet here might be to use the %ERRORLEVEL% variable in your batch script and then print it to the screen with an easily identifiable tag (E.g. 'ERRORLEVEL=x'). Your perl script can just look for your status messages and pull them out with a regex: my $result; foreach my $output(

RE: book to learn perl

2006-08-02 Thread Timothy Johnson
For learning the basics I actually recommend Perl From the Ground Up. You can buy a used copy for cheap on Amazon. It doesn't deliver what it says on the cover, but it does a good job of explaining basic concepts for people who don't have any experience in programming. Once you're ready to

RE: regex quoting

2006-07-28 Thread Timothy Johnson
Use \E to stop the quoting. -Original Message- From: Jeremy Kister [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 1:01 PM To: beginners@perl.org Subject: regex quoting perldoc -q quote talks about \Q before a regex to escape special characters. how do you use \Q when you want

RE: File opeartions help

2006-07-27 Thread Timothy Johnson
Try backticks instead of the system() call to capture the outputh. E.g. my @results = `$cmd`; -Original Message- From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED] Sent: Thursday, July 27, 2006 7:48 AM To: beginners@perl.org Subject: File opeartions help Hi, I am executing

RE: Splitting a script into multiple files

2006-07-26 Thread Timothy Johnson
Check out 'perldoc -f do'. Also, get a new laptop. :) -Original Message- From: Martin Tournoij [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 10:05 AM To: beginners@perl.org Subject: Splitting a script into multiple files snip My laptop, on which I do all my

RE: saving system output as $

2006-07-26 Thread Timothy Johnson
Try backticks instead of the system() call. my @results = `stat $inputScratch`; -Original Message- From: Ryan Moszynski [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 11:46 AM To: beginners@perl.org Subject: saving system output as $ is there a way to save the output of a

RE: using 'negative look-ahead' assertions

2006-07-21 Thread Timothy Johnson
If you really just want everything that doesn't match, do it like this: if($string !~ /pattern/){ do something... } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 5:52 PM To: beginners@perl.org Subject: using 'negative

RE: how to add a list of numbers

2006-07-20 Thread Timothy Johnson
-Original Message- From: tom arnall [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 12:08 PM To: beginners@perl.org Subject: Re: how to add a list of numbers snip Whatever happened to good old: my (@data,$result); @number = (1,2,3); $sum = 0;

RE: Object oriented programming with perl

2006-07-20 Thread Timothy Johnson
I think it might be clearer if you checked this doc: perldoc lib Which has a good explanation of using 'use lib' to define directories to search for modules. -Original Message- From: Shourya Sengupta [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 12:07 PM To: Joshua Colson

RE: array help

2006-07-20 Thread Timothy Johnson
-Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 4:18 PM To: beginners@perl.org Subject: Re: array help my @test = (/test , /playground); print @test; snip i need the output in following fasion /test /playground can you please tell me

RE: print statement error

2006-07-20 Thread Timothy Johnson
It works for me, but it sounds like '[A-Z][a-z]+' might not be doing what you think. That says One upper-case letter followed by one or more lower-case letters. I can see one problem with that right now. I live in Santa Clara, which won't match because it has a space in it. But this matched:

RE: Help with Stupid question

2006-07-17 Thread Timothy Johnson
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix Sent: Saturday, July 15, 2006 3:22 PM To: Ralph H. Stoos Jr. Cc: beginners perl Subject: Re: Help with Stupid question On 7/15/06, Ralph H. Stoos Jr. [EMAIL PROTECTED] wrote: I want to know if

RE: pattern matching

2006-07-17 Thread Timothy Johnson
\1 is the same thing as $1 inside of a regex, but it is generally recommended that you don't use it. From 'perldoc perlre': Warning on \1 vs $1 Some people get too used to writing things like: $pattern =~ s/(\W)/\\\1/g; This is grandfathered for the RHS of a substitute to

RE: awesome help, but, a question

2006-07-14 Thread Timothy Johnson
Run 'perldoc perlop' at the command-line. Check out the section about the Conditional Operator for the first question, and the second question will be under Quote and Quote-like Operators, in the m/PATTERN/cgimosx section. -Original Message- From: Ryan Moszynski [mailto:[EMAIL

RE: strip

2006-07-14 Thread Timothy Johnson
Here's one way to do it: # if($file =~ /^NQSname.+\.txt$/){ rename ($file,'NQSname.txt'); } # -Original Message- From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 5:29 PM To: beginners perl Subject: strip Hi: I have a filenames such as

RE: How to ignore spaces in directory names?

2006-07-13 Thread Timothy Johnson
This isn't a Perl problem, it has to do with how your shell is processing the command-line parameters. Put double-quotes around the directory name and you won't have a problem. -Original Message- From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:44 AM To:

RE: How to ignore spaces in directory names?

2006-07-13 Thread Timothy Johnson
Just to clarify: the double-quotes should go around the argument on the command-line, not the variable in Perl. -Original Message- From: Timothy Johnson Sent: Thursday, July 13, 2006 11:47 AM To: Nishi Bhonsle; beginners perl Subject: RE: How to ignore spaces in directory names? Put

RE: Copying files in windows from one directory to the other

2006-07-12 Thread Timothy Johnson
Probably the simplest way to do this would be to use the File::Copy module. It's about as straightforward as you can get. move($BNY_DOWNLOAD.\\.$filename,$BNY_DATA.\\.$filename) or die(Couldn't copy $filename to $BNY_DATA! $!\n); -Original Message- From: kilaru rajeev [mailto:[EMAIL

RE: calling a perl script on windows

2006-07-12 Thread Timothy Johnson
In addition to the suggestions that have already been given about associating the .pl file extension with perl.exe, I would heartily recommend that you install ActivePerl from http://www.activestate.com. It's free, and is the de facto standard for Windows Perl. There are other ones that work

RE: Date Time

2006-07-12 Thread Timothy Johnson
It looks like part of your message got munged by one of our mail clients, but here's a code snippet that should give you an idea of how you can proceed: ## use strict; use warnings; $| = 1; my $string = '200607081000@@01510'; #Check to make sure the regex matched, then proceed.

RE: regex repetition

2006-07-12 Thread Timothy Johnson
Why not just use split()? Then you can do a simple regex on each element: ### use strict; use warnings; my $string = '1-10;25;33;1-00-250'; my @array = split(/;/,$string); foreach my $element(@array){ if($element =~ /^\d+-?\d*?$/){ print $element = valid\n;

RE: pattern match

2006-07-11 Thread Timothy Johnson
At the moment I can't think of why this makes a difference (somebody help me here), but you aren't specifying a mode for the open() function. Also, you're not checking whether your match succeeded before using $1 (which is what I think you meant on that last line). I personally would write it a

RE: backslash on windows

2006-07-10 Thread Timothy Johnson
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Monday, July 10, 2006 5:02 AM To: beginners@perl.org Subject: Re: backslash on windows snip myscript.pl -cfg D:\users\config.txt inside the script, when capturing the config file mentioned above, the \ is

RE: How to use Perl for API testing

2006-07-10 Thread Timothy Johnson
Are you testing on IE? There is an Win32::IEAutomation module that should be able to handle what you want if IE is the browser you want to test. -Original Message- From: Suja Emmanuel [mailto:[EMAIL PROTECTED] Sent: Sunday, July 09, 2006 10:16 PM To: beginners@perl.org Subject: How

RE: File last modified time

2006-07-07 Thread Timothy Johnson
The documentation seems to indicate that the -M is the number of days older than the script start time the file modification time is. I think what you want would be something like: If( (stat $path)[9] time - 1200 ){ Do something... } Which will get the 10th (starts from 0) element of

RE: Errors with dynamic extensions loading when running from jsp

2006-07-06 Thread Timothy Johnson
Are you sure that the user the jsp is running under has permissions to the module directory? -Original Message- From: Ray Gebbie [mailto:[EMAIL PROTECTED] Sent: Thursday, July 06, 2006 12:45 PM To: beginners@perl.org Subject: Errors with dynamic extensions loading when running from jsp

RE: Hash - narff

2006-07-05 Thread Timothy Johnson
You'd be better off making a second hash: my %reverse_char; while(my($key,$value) = each %char){ $reverse_char{$value} = $key; } print $reverse_char{a}; -Original Message- From: Beginner [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 8:48 AM To: beginners@perl.org

RE: Script Required to Check a range of IP's

2006-06-29 Thread Timothy Johnson
You've gotten many good suggestions, but the main problem is that you are doing a TCP ping, and I'm pretty sure you are expecting the results to match your ICMP ping. From the Perldoc: You may choose one of six different protocols to use for the ping. The tcp protocol is the default. Note that a

RE: reg ex problem

2006-06-27 Thread Timothy Johnson
Here's one example of how you could go about it: ## use strict; use warnings; my $testString = test_freq = 1.0001;; print Test One: ; if($testString =~ /=\s*([0-9.]+)\s*;\s*$/){ print $1; }else{ print Failed!; } print \n; ##

RE: CSV file that can be loaded to Microsoft Outlook

2006-06-26 Thread Timothy Johnson
You have an extra double-quote in there after the email address. So far this doesn't seem to be a Perl problem. -Original Message- From: Mihir Kamdar [mailto:[EMAIL PROTECTED] Sent: Sunday, June 25, 2006 7:02 AM To: Mr. Shawn H. Corey Cc: beginners Subject: Re: CSV file that can be

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
It depends on which program was used to create the executable. I don't know about Perl2Exe, but PerlApp encrypts the contents of the executables to prevent tampering. -Original Message- From: I BioKid [mailto:[EMAIL PROTECTED] Sent: Friday, June 23, 2006 1:35 PM To: Timothy Johnson

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
I suppose if you're looking for a decompiler you should probably know the difference between a compiled and interpreted language. There are two products that can package Perl scripts into executables, but even they don't compile them. -Original Message- From: I BioKid [mailto:[EMAIL

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
To: Timothy Johnson Subject: Re: Any PERL Decompiler / code ? Hi johnson, Thanks for your reply - Infact I dnt which program was used to generate executable - could you tell me any possible program to get the code out of it ? funny thing is they dnt even have an extension name of .exe for eg a file

RE: Another (hopefully more clear) plea for help with CSV data

2006-06-22 Thread Timothy Johnson
Here's one thought: Why not create a hash of arrays? Each hash key would be a column name, and each record would be spread across the arrays using the same array index. If you really wanted to get fancy you could create a hash of cached results to speed up future queries. I wouldn't recommend

RE: A loop to parse a large text file--output is empty!

2006-06-14 Thread Timothy Johnson
-Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 8:02 AM To: Timothy Johnson; Michael Oldham; [EMAIL PROTECTED] Org Subject: RE: A loop to parse a large text file--output is empty! From:Timothy Johnson [EMAIL PROTECTED] snip print

RE: What is a prompt package that actually works on Windows

2006-06-13 Thread Timothy Johnson
What are you trying to do, and how is it failing? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael Goldshteyn Sent: Tuesday, June 13, 2006 12:50 PM To: beginners@perl.org Subject: What is a prompt package that actually works on Windows It is definitely not

RE: A loop to parse a large text file--output is empty!

2006-06-13 Thread Timothy Johnson
One problem is that you are using the $_ variable twice. while(FILE) assigns $_ to the current line being read, and foreach(@array) assigns $_ to the current element of the array in question. It's usually a good idea to be more explicit anyway, and keep the $_ usage to a minimum so you don't

RE: desktop application

2006-06-13 Thread Timothy Johnson
If you're looking to set up something like this, I strongly recommend buying the Perl Dev Kit from ActiveState. You'll get PerlApp and PerlMSI, which make distribution easy, and PerlTray, which makes writing System Tray applets in Perl much easier. You're probably also going to want to get

RE: A loop to parse a large text file--output is empty!

2006-06-13 Thread Timothy Johnson
: Tuesday, June 13, 2006 7:13 PM To: Timothy Johnson; [EMAIL PROTECTED] Org Subject: RE: A loop to parse a large text file--output is empty! Thanks Timothy. I tried the code you supplied and unfortunately the output file is still empty. Do you think there might be a problem with the regular expression

RE: parsing a CSV file with more fields than column names

2006-06-08 Thread Timothy Johnson
As long as you're sure that there aren't any commas in your data, you could always do this: my @records = split(/,/,$line,17); This will limit your total records to 17, and will dump the rest into the 17th record. Then you can split the last record again if you want. If you have some

RE: modifying @INC permanently

2006-06-08 Thread Timothy Johnson
Win32 changes to the environment from within your script won't be permanent, so that won't work unless you do the system call that sets the environment variable permanently (and also the local one, because it won't reflect the changes to the system call until it is invoked again). Do you have

RE: parsing a CSV file with more fields than column names

2006-06-08 Thread Timothy Johnson
-Original Message- From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 2:04 PM To: beginners@perl.org Subject: RE: parsing a CSV file with more fields than column names Hello Rich Hi, Chris, thanks for your response See docs for perlfunc,

RE: parsing a CSV file with more fields than column names

2006-06-08 Thread Timothy Johnson
-Original Message- From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 2:37 PM To: beginners@perl.org Subject: RE: parsing a CSV file with more fields than column names Are you SURE that there might be commas in the other fields? I would hope that whoever

RE: Help with line length in script

2006-06-08 Thread Timothy Johnson
Here's the offending line: ### $TXT .= swrite(@ @ @,$rec, $stats{virus}-{$rec}, $percent).%\n if $text; ### The @ part is telling format to print up to 21 characters of $rec and truncate the rest, left justifying it. If you want to make the printout of $rec longer, add more of

RE: defaults

2006-06-07 Thread Timothy Johnson
-Original Message- From: Bryan R Harris [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 07, 2006 4:43 PM To: Beginners Perl Subject: Re: defaults snip Take this (lame) example of an RSVP to an invitation: ** $_ = Bill, 3; # name, number of

RE: Windows: Fork and run a process in the background

2006-06-06 Thread Timothy Johnson
Try this: system( start evince /path/to/pdf.pdf ); Both cheap and nasty. -Original Message- From: Daniel Kasak [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 06, 2006 5:37 PM To: beginners@perl.org Subject: Windows: Fork and run a process in the background Greetings. I'd like

RE: Simple loop question

2006-05-31 Thread Timothy Johnson
Here's one way to accomplish what you want, and it eliminates some of the redundancy. BTW, get used to using strict. It really does help in the long run and it's better to learn it early than to decide to go back later and fix your old programs. ###

RE: Perl script to search and replace a string in a file

2006-05-31 Thread Timothy Johnson
Check out the File::Find module. It should come standard with your distribution. -Original Message- From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 2:39 PM To: beginners@perl.org Subject: Perl script to search and replace a string in a file Hi: I have the

RE: Perl OS system equivalence or Perl scripts for UNIX-and-Windows

2006-05-25 Thread Timothy Johnson
Do you have control over the Windows box you will be using for these scripts, or are these for a general distribution? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 4:21 PM To: beginners@perl.org; [EMAIL PROTECTED] Subject: Perl OS

RE: Perl OS system equivalence or Perl scripts for UNIX-and-Windows

2006-05-25 Thread Timothy Johnson
-Original Message- From: Ricky Zhou [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 5:30 PM To: [EMAIL PROTECTED] Cc: beginners@perl.org; [EMAIL PROTECTED] Subject: Re: Perl OS system equivalence or Perl scripts for UNIX-and-Windows On 5/25/06, [EMAIL PROTECTED] [EMAIL

RE: Help: Is there any way to get the name of the Window Server that the Perl script is currently running on?

2006-05-25 Thread Timothy Johnson
There is a COMPUTERNAME environment variable that will have this info. -Original Message- From: Japerlh [mailto:[EMAIL PROTECTED] Sent: Thursday, May 25, 2006 6:21 PM To: beginners Subject: Help: Is there any way to get the name of the Window Server that the Perl script is currently

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

2006-05-22 Thread Timothy Johnson
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Sunday, May 21, 2006 11:06 PM To: beginners@perl.org Subject: Re: Looking for example Perl scripts to be used in Perl Training. snip I think both Learning Perl and Perl Cook Book are right for your purpose. I got

RE: No Such File Error on Simple Scrape

2006-05-22 Thread Timothy Johnson
One simple thing you might want to start doing is including the filename in your error message. Quite often this message means that either you're not in the starting directory you think you're in or part of your filename is being interpreted as something other than what you intended.

RE: file list

2006-05-22 Thread Timothy Johnson
Check out the File::Find module. It should come standard with your distribution. You may have to re-read the docs a couple of times before it makes sense, but it works well. Post here if you have any problems. -Original Message- From: SkyBlueshoes [mailto:[EMAIL PROTECTED] Sent:

RE: Help: Need PPT document for Perl Training

2006-05-19 Thread Timothy Johnson
1) Start--Run 2) In the text-box provided, type Powerpnt.exe 3) Click Ok. 4) In the application window that appears, click File--New HTH! -Original Message- From: Japerlh [mailto:[EMAIL PROTECTED] Sent: Friday, May 19, 2006 3:47 AM To: beginners@perl.org Subject: Help: Need PPT

RE: reg exp speed?

2006-05-19 Thread Timothy Johnson
One thing you could do is precompile the regex and save it in a variable ala my $regex = qr/.*ST\S+\s*\S*B15--.*[^02468]]/o; my @match_sp = $all_lines =~ /$regex/mg; Note the 'o' option on the qr//, which tells perl to compile the regex only once. I'm not sure if it applies in this case or

RE: Any CPAN module similar to Winrunner

2006-05-18 Thread Timothy Johnson
What operating system are you using? -Original Message- From: Shalaka [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 6:26 AM To: beginners@perl.org Subject: Any CPAN module similar to Winrunner Hi List! I'm a beginner in Perl, i want to know if there is any module available

RE: question on Perl determinism with hash keys

2006-05-16 Thread Timothy Johnson
If you mean in the same order, then no. perldoc -q order -Original Message- From: Gavin Bowlby [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 5:25 PM To: beginners@perl.org Subject: question on Perl determinism with hash keys All: If I populate a %hash within a Perl

RE: question on Perl determinism with hash keys

2006-05-16 Thread Timothy Johnson
PROTECTED] Sent: Tuesday, May 16, 2006 5:37 PM To: Timothy Johnson; beginners@perl.org Subject: RE: question on Perl determinism with hash keys Timothy et al: Thanks, I did mean in the same order. Any idea on the relative performance of a hash tied to IxHash vs. a vanilla hash? I have a Perl program

RE: question on Perl determinism with hash keys

2006-05-16 Thread Timothy Johnson
Understandable. Why do you need the keys function to return the keys in the same order? What is it that you're trying to do? -Original Message- From: Gavin Bowlby [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 5:57 PM To: Timothy Johnson; beginners@perl.org Subject: RE

RE: :ftp with retry Big brother notifications from applications

2006-05-15 Thread Timothy Johnson
I had to deal with some of this when I recently wrote a BB agent to Nagios translator in Perl. You should be able to send the information you want directly to BB using the IO::Socket module, connecting to port 1984( or whatever custom port) on your BB server and sending a status message. Big

RE: :ftp with retry Big brother notifications from applications

2006-05-15 Thread Timothy Johnson
..bbclient.log' for append!\n); select OUTFILE; $| = 1; select STDOUT; print IP=$host\n; while(my $recv = $bbclient){ print OUTFILE $recv; #print $recv; } } -Original Message- From: Timothy Johnson Sent: Monday, May

RE: date time from server problem/question

2006-05-11 Thread Timothy Johnson
If the server is a Windows server you can use the Win32::FileTime module to get the info you need. -Original Message- From: Graeme McLaren [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 9:55 AM To: beginners@perl.org Subject: date time from server problem/question Hi all,

RE: Trapping errors

2006-05-10 Thread Timothy Johnson
Do something like this: ### Win32::OLE-Option(Warn = \Error_Handler); sub Error_Handler{ print WARN!!! .Win32::OLE-LastError.\n; } ## -Original Message- From: Gallagher, Tim (NE) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 11:20 AM To: Perl Beginners

RE: array question

2006-05-09 Thread Timothy Johnson
-Original Message- From: Bryan R Harris [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 09, 2006 11:24 AM To: Beginners Perl Subject: Re: array question On Tue, 2006-09-05 at 18:33 +0200, Dr.Ruud wrote: One exception: the pattern / / does not work like the pattern ' '. But it should,

RE: print file

2006-05-08 Thread Timothy Johnson
It would probably be better to let the OS tell you why the open failed by using the $! or $^E variables when you're checking why the open() failed. It could be failing because the file was not found, or the file could be locked somehow, or the user might not have read permissions on the file.

RE: array question

2006-05-08 Thread Timothy Johnson
You could cycle through the array and use split() to split each element by whitespace and then append the result to the @new_array array using push(); -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 12:58 PM To: beginners@perl.org Subject: array

RE: Email going from plain text to be able to show text in color, bold, etc

2006-05-05 Thread Timothy Johnson
HTML email is pretty easy to do, especially for simple formatting. There shouldn't be anyone out there that can't receive HTML email. If you really want to accommodate everyone, you could add both the HTML and text format emails. I'm not 100% sure how that one is done, but I know it can be

RE: executing block on STDIN

2006-05-01 Thread Timothy Johnson
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Ettinger Sent: Monday, May 01, 2006 5:02 PM To: Mr. Shawn H. Corey Cc: beginners@perl.org Subject: Re: executing block on STDIN On 5/1/06, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: snip I'm not

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
What happens if you are more specific? @domain = split(/\w/,$domainlist); -Original Message- From: Rance Hall [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 26, 2006 1:22 PM To: beginners@perl.org Subject: problem with whitespace not splitting on split. I'm working on a new perl

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 26, 2006 1:32 PM To: Rance Hall Cc: beginners@perl.org Subject: Re: problem with whitespace not splitting on split. On Wed, 2006-26-04 at 15:22 -0500, Rance Hall wrote: I'm working on a new

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
The confusion comes from the poor wording of the perldoc. As a special case, specifying a PATTERN of space (' ') will split on white space just as split with no arguments does. Thus, split(' ') can be used to emulate awk's default behavior, whereas split(/ /) will give you as many

RE: sort {} to work with undef values when its expecting an object

2006-04-25 Thread Timothy Johnson
Just a thought, but couldn't you put the logic in your grep statement? Something like this: grep {defined($_-value()) or defined($_-part('Name')-value())} @objects; -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 12:22 PM To:

RE: golf

2006-04-19 Thread Timothy Johnson
You mean like this? perl -p -e s/\n/ / (Some tweaking may be necessary for non-Win32 OS) -Original Message- From: Chad Perrin [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 19, 2006 6:36 PM To: beginners@perl.org Subject: golf This is kind of a frivolous question, but . . . is

RE: Regex Help

2006-04-18 Thread Timothy Johnson
You need to anchor your regex. Your regex is matching '!!' because it is matching an exclamation point followed by zero or more non exclamation-point characters anywhere in the string. Thus the first '!' is matching the regex, and the second '!' is outside of your match. Try this:

RE: Catching the output in file

2006-04-17 Thread Timothy Johnson
You could always use backticks (``) to capture the output in an array and then print it to a file. -Original Message- From: Irfan J Sayed [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 7:11 AM To: beginners@perl.org Subject: Catching the output in file Hi, I am executing

RE: Lexical analysis of log file

2006-04-17 Thread Timothy Johnson
Was this logfile made by a particular product? There might be a module made specifically for it. -Original Message- From: Joshua Colson [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:57 PM To: Perl Beginners Subject: Lexical analysis of log file I have a log file of the

RE: regex matching conditionally

2006-04-14 Thread Timothy Johnson
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 12:15 PM To: beginners@perl.org Subject: Re: regex matching conditionally Timothy Johnson wrote: Will the string always have the two quotes in the same place and only one per string? What

RE: does rename have problems on W2K, W Server 2003, etc?

2006-04-14 Thread Timothy Johnson
You might want to add the $^E and $! error variables in your output. I've been using rename with XP,W2k, and W2k3 for a few years now without problems. Another thought: Make sure that it's working in the directory you think it is. It's pretty easy to accidentally copy the file somewhere else.

RE: how to tell perl to look for where a new module is installed

2006-04-14 Thread Timothy Johnson
perldoc lib -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 2:40 PM To: beginners@perl.org Subject: how to tell perl to look for where a new module is installed snip I install in new module like this: c:/perl/local/new.pm. How should tell the

RE: reverse the order of a row in Excel

2006-04-14 Thread Timothy Johnson
not the first person to have this problem, so it is good to get the information out there for other beginners. -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 2:44 PM To: Timothy Johnson Subject: RE: reverse the order of a row in Excel Hi Timothy

RE: how to tell perl to look for where a new module is installed

2006-04-14 Thread Timothy Johnson
. # VMS users wanting to put [.stuff.moo] into # their @INC would write use lib 'stuff/moo'; -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 3:15 PM To: Timothy Johnson Subject: RE: how to tell perl to look for where a new

RE: regex matching conditionally

2006-04-13 Thread Timothy Johnson
Will the string always have the two quotes in the same place and only one per string? What about something like this? /.*?\{([^\}]*)\}(?=.*)/gi -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Thursday, April 13, 2006 5:16 PM To: beginners@perl.org Subject:

RE: Class::Struct: Can't access struct field elements

2006-04-10 Thread Timothy Johnson
The code you provided can't be the example taken straight out of Programming Perl, because it doesn't compile. Also, you've mistyped one of the variables. You should always use strict and use warnings to avoid this kind of thing. Can't call method name on an undefined value at

RE: reverse the order of a row in Excel

2006-04-10 Thread Timothy Johnson
Do you have any experience using Win32::OLE with Excel? That would be the way to go. I got this going, and there is only one weird idiosyncrasy that I found. When you input data into a range using the Values property you do it by putting your data into an anonymous array, but when you retrieve

  1   2   3   4   5   6   7   8   9   10   >