Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Wednesday, April 27, 2005 at 17:29 (-0700) has on mind: JWK> "my @a;" creates the lexical variable @a at compile time and since it has just JWK> been created it will be empty. "my @a = ();" creates the variable during JWK> compilation but the assignment (IIRC) has to be d

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: I will answer and ask all questions in one email! k. 8>foreach () { Is there any good reason to slurp the entire file into memory? What would you suggest? I want to read the entire file via a filehandle. I have plenty of system memory, therefore why not? Why not

examples using Template::Plugin::Page

2005-04-27 Thread Ramprasad A Padmanabhan
Hi all, I have a html reports page that has now grown too large to manage. I want to paginate my report. I am already using templates , similar to Template.pm so I would like keep the presentation stuff outside my perl code. I was trying to use Data::Page with Template::Plugin::Page but I am

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
I will answer and ask all questions in one email! k. > $!"; > 5> my @fa =(); > 6> my @ha =(); > 7> my $i =0; > 8>foreach () { > Is there any good reason to slurp the entire file into memory? What would you suggest? I want to read the entire file via a filehandle. I have plenty of syste

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread John W. Krahn
Ing. Branislav Gerzo wrote: JupiterHost.Net [JN], on Wednesday, April 27, 2005 at 10:23 (-0500) thinks about: JN> No its not, you can if you want but it pointless: I read it somewhere (it was perl cookbook/learning perl from o'reilly maybe). Always declare my @a = ( ); And here is why, if I remembe

Re: Reading MSAccess Files under Linux?

2005-04-27 Thread Paul Kraus
> It got me thinking: Is there a way to read MSAccess files under Linux using > perl? > Its tricky get odbc working on your nix box google will turn up a ton of tutorials. Then use dbi dbd::odbc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

mysql driver problem? (slightly off topic)

2005-04-27 Thread Graeme McLaren
Hi all, this is slightly off topic but I'm sure someone here has come across this problem. I cannot connect to mysql on my redhat 9 box. I ran: shell> perl -MCPAN -e 'install Bundle::DBD::mysql'; and it did say that there was a problem but all I've manged to find out from google is that there

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
You do realize that the characters 'F', '0' and '1' are included in the character class \w which split() is removing? :-) yeah I realized that typo too late :), I meant \s not \w but then plain old my @tmp = split; is even better :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Ing. Branislav Gerzo
JupiterHost.Net [JN], on Wednesday, April 27, 2005 at 10:23 (-0500) thinks about: JN> No its not, you can if you want but it pointless: I read it somewhere (it was perl cookbook/learning perl from o'reilly maybe). Always declare my @a = ( ); And here is why, if I remember correctly - if you dec

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread John W. Krahn
Jay Savage wrote: 4> open (V4, "samcmd v4 2>\&1 |" ) || die "unable to open pipe... Broken?$!"; Don't do this. the precedence of || is too high. your code attempts to open a pipe, and if it can't, then it attempts to open "die..." and starts throwing exceptions. No, that is NOT what happens,

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread John W. Krahn
JupiterHost.Net wrote: [EMAIL PROTECTED] wrote: yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway Then do it at a later time and do it right, I imagine most all of us are busy also :) here is my updated code. and here is a sample output: My goal is to get all F01 which I am

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway here is my updated code. and here is a sample output: My goal is to get all F01 which I am but I am having issues capturing all of these values into my array. When I run the I get the data I want to s

Re: regex substitution

2005-04-27 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Hi all, Hello, I want a regex to replace all continuous occurrences of '-' with something else say 'x' except the first one These are some examples "- Ram" ===> "- Ram" "-- bla"===> "-x blah" "bla ---" ===> "bla -

Re: keyword expansion script

2005-04-27 Thread John W. Krahn
CM Analyst wrote: I am struggling to modify an existing Perl script that was originally written for a Unix version of ClearCase (SCM tool). The script is supposed provide "keyword expansion" functionality for files that are checked into the SCM system. My task is to make the same script run on W

Re: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread David Van Ginneken
Try something like this. I just tried it on 60+ files and it seems to work. (If you have multiple worksheets you may need to modify the cell_handler to exclude the ones you don't want) use Spreadsheet::ParseExcel; use File::Basename; use strict; my $resultMessage = ''; my $maxrow = 0; my $oBook;

Re: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Craig Moynes
Ok perlers, It was actually fairly easy. I added a delete just before the end of the for loop. delete $oBook->{Worksheet}; Not sure how the references work internally in Perl. I guess that when oBook is assigned a new Spreadsheet the previous Spreadsheet is not getting cleaned up. Cheers, On

Re: my (fooref) = shift;

2005-04-27 Thread John W. Krahn
Matthew Sacks wrote: I see many examples in the camel book where a subroutine takes one argument and the one argument is an array ref. my (foo_ref) = shift; There is however at least one example where it is my foo_ref = shift; I am trying to figure out if this matters. What would shift care abou

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
all f01 records are not printed if one uses print +(split)[7] rather print +(split)[5,6,7] will print all f01 records. sorry derek "JupiterHost.Net"

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
I am confused with your email. what does (split) [-1] mean? Finally, Yes I do understand the differing precedence between or and | | . I have a habit using | |. I do also understand that if you use or you should use ( ) as opposed to | | you do not have to use ( ). Any comments? Derek B.

Reading MSAccess Files under Linux?

2005-04-27 Thread Siegfried Heintze
I noticed the discussion about using perl to read MS Excel files. I assume this works under Linux. It got me thinking: Is there a way to read MSAccess files under Linux using perl? Sieg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: yes that is true, [5,6,7] need to be typed otherwise all entries are not Yes what is true? Please reply inline. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

my (fooref) = shift;

2005-04-27 Thread Matthew Sacks
I see many examples in the camel book where a subroutine takes one argument and the one argument is an array ref. my (foo_ref) = shift; There is however at least one example where it is my foo_ref = shift; I am trying to figure out if this matters. What would shift care about list context?

Re: bulky regex

2005-04-27 Thread Peter Rabbitson
On Wed, Apr 27, 2005 at 01:50:57PM -0400, Jay Savage wrote: > You can drop the stuff from the end, too. If 'ups' is optional and > the spacing is variable, then of course handle that with * > > $description =~ > s/\s*free\+(?:ups)*\s*ground\s+shipping\s*[!]*\s*//i; # or /ig if > needed > >

Re: bulky regex

2005-04-27 Thread Jay Savage
On 4/27/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > On Wed, Apr 27, 2005 at 01:31:08PM -0400, Jay Savage wrote: > > > > Don't make things so complicated. You want to find some words and > > replace them with nothing. You don't care where in the string the > > pattern appears. Therefore, you

keyword expansion script

2005-04-27 Thread CM Analyst
I am struggling to modify an existing Perl script that was originally written for a Unix version of ClearCase (SCM tool). The script is supposed provide "keyword expansion" functionality for files that are checked into the SCM system. My task is to make the same script run on Windows and I am n

Re: bulky regex

2005-04-27 Thread Peter Rabbitson
On Wed, Apr 27, 2005 at 01:31:08PM -0400, Jay Savage wrote: > > Don't make things so complicated. You want to find some words and > replace them with nothing. You don't care where in the string the > pattern appears. Therefore, you don't have to predict where in the The word 'ups' is not manda

Re: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Craig Moynes
Hi Gents, I tried both suggestions: # # For each log in the array # - grab the directory and name of the file. # - send via sendmail # foreach $hashEntry ( @LOGS ) { my ( $localfile)= $hashEntry->{name}; my ( $err_msg ) = ""; # error messag

Re: bulky regex

2005-04-27 Thread Jay Savage
On 4/27/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > Hello everyone, > This is the first time I was able to get a complex regex actually working as > I expect, but I wanted someone to comment on it, in case I am overlooking > something very major. > I am trying to throw away a certain string ou

Re: bulky regex

2005-04-27 Thread Peter Rabbitson
On Wed, Apr 27, 2005 at 12:16:05PM -0500, Peter Rabbitson wrote: > description =~ s/ #take away free ground shipping text > > (?: #non-capturing block for | inclusion >(^)#start of string > | #or >(?<=\S)#lookbehind non-space character

bulky regex

2005-04-27 Thread Peter Rabbitson
Hello everyone, This is the first time I was able to get a complex regex actually working as I expect, but I wanted someone to comment on it, in case I am overlooking something very major. I am trying to throw away a certain string out of random text. The occurences might be as follows: Free U

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
perl people there was a lot of threads to my question ...thank you! I will start from the most recent. I took and understood the advise of my @a = (); changed to my @a; Yes I do understand the differing precedence between or and | | . I have a habit using | |. I do also understand that if

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
yes that is true, [5,6,7] need to be typed otherwise all entries are not accounted for. Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 "JupiterHost.Net"

RE: Edit Windows PATH

2005-04-27 Thread Chris Devers
On Wed, 27 Apr 2005, Bakken, Luke wrote: > That will change the environment for the cmd.exe process that is > executed by that one system() call. Changing %ENV will change the > environment for all processes started by the perl script. That's the behavior on POSIXy systems, but I had the impres

RE: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Bakken, Luke
> my $oBook; > my $oWks; > foreach $hashEntry ( @LOGS ) > { > > my ( $localfile)= $hashEntry->{name}; > my ( $err_msg ) = ""; # error message > variable > > > my $cmd = ""; > > # > # Get row count of each fi

RE: Edit Windows PATH

2005-04-27 Thread Bakken, Luke
Chris Devers wrote: > On Fri, 1 Jan 1988, amr wrote: > >> Do we have Perl script that can edit & add to the Windows (XP, 2000) >> path.? > > Is there a reason that a simple system() command won't work here? > > my $status = system( "SET PATH=%PATH%;$new_path" ); > die "Couldn't set %PAT

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
I was assuming it was a typo/email munge, and that the command he pipes actually produces consistent output. That may be a faulty assumption on my part. YOu know what they say about assumptions In Its hard to say Derek doesn't give us much to work with :) general, though, when parsing log files (

Re: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Jay Savage
On 4/26/05, Craig Moynes <[EMAIL PROTECTED]> wrote: > Hi All, > I am using the spreadsheet::parseexcel module to open up a series (31) > spreadsheets and grab the row counts. > > Here is an excerpt with the ParseExcel Code. > > my $oBook; > my $oWks; > foreach $hashEntry ( @LOGS ) > { > >

RE: Password

2005-04-27 Thread Rentachintala, Jagan
Thanks jose j Cintron for your solution. I don't know why I never thought of this. Have a good day! Jagan Jagan Rentachintala | Consultant | Idea Integration | (904) 360-2421 | www.idea.com | (NYSE: MPS) Idea Integration, An MPS Group Company - IT solutions from the desktop to the data cente

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Jay Savage
On 4/27/05, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > > If all you want is the last column, this is a really long way to go about > > it. > > > > while () { > > print (split)[7]; > > print "\n"; > > } > > I think that won't work due to some rows formatted like so: > > 2

Re: Edit Windows PATH

2005-04-27 Thread Chris Devers
On Fri, 1 Jan 1988, amr wrote: > Do we have Perl script that can edit & add to the Windows (XP, 2000) path.? Is there a reason that a simple system() command won't work here? my $status = system( "SET PATH=%PATH%;$new_path" ); die "Couldn't set %PATH%: $!" if $status; Normally I'm oppos

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Jay Savage
On 4/27/05, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: > Jay Savage [JS], on Wednesday, April 27, 2005 at 10:26 (-0400) > thoughtfully wrote the following: > > JS> If all you want is the last column, this is a really long way to go about > it. > JS> while () { > JS> print (split)

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
Ing. Branislav Gerzo wrote: JupiterHost.Net [JN], on Wednesday, April 27, 2005 at 08:15 (-0500) thoughtfully wrote the following: 5> my @fa =(); 6> my @ha =(); JN> my @fa; JN> my @ha; JN> the = () isn't necessary and doesn't keep you from getting uninitialized JN> value warnings like you think it

Re: Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Peter Rabbitson
On Wed, Apr 27, 2005 at 09:06:39AM -0500, Peter Rabbitson wrote: > Also there was an example on the web that completely threw me off. Although > this works: > > local ($/); > Sorry about this last one, I undrestand the idea of local for globs, I just thought that local $/; and local ($/); d

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
If all you want is the last column, this is a really long way to go about it. while () { print (split)[7]; print "\n"; } I think that won't work due to some rows formatted like so: 2005/01/20 15:39 17 2% -il-o-b- - - - - sg F01000 unless that was typo? In that case "7" is

Re: Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Jay Savage
On 4/27/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > > also > > "or die" is more preferable than "|| die" > > Why is that? :) I was actually going to post a question about ambiguity > syntax later, but here it is anyway. Are the following 4 equivalent? > No. > 1) > if ($b) { > $a = $b; >

Re: Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Offer Kaye
On 4/27/05, Peter Rabbitson wrote: > > also > > "or die" is more preferable than "|| die" > > Why is that? :) It's a question of style, it is not better as in "the code will work better". It is mentioned in "perldoc perlstyle" that it is preferable to use "or" and "and" instead of "||" and "&&".

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Ing. Branislav Gerzo
Jay Savage [JS], on Wednesday, April 27, 2005 at 10:26 (-0400) thoughtfully wrote the following: JS> If all you want is the last column, this is a really long way to go about it. JS> while () { JS> print (split)[7]; JS> print "\n"; JS> } (split)[-1] is better, not ? -- How

Re: Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Ing. Branislav Gerzo
Peter Rabbitson [PR], on Wednesday, April 27, 2005 at 09:06 (-0500) has on mind: PR> Why is that? :) I was actually going to post a question about ambiguity PR> syntax later, but here it is anyway. Are the following 4 equivalent? to mee it seems so. PR> local ($/); PR> ,I have no idea how it un

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Jay Savage
On 4/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway > here is my updated code. and here is a sample output: > My goal is to get all F01 which I am but I am having issues capturing all > of these values into my array. W

RE: rows returned and while statement

2005-04-27 Thread Giff Hammar
You could use this after the while loop: if ($sth->rows() == 0) { # First offense code } Giff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 26 April, 2005 11:24 To: beginners@perl.org Subject: rows returned and while statement Ok I have an issue wh

Re: Password

2005-04-27 Thread José J. Cintrón
If your script is the one generating the log file, it should be as simple as to find the line that writes the password and just replace it with whatever string you want. for example old line print $UN."/".$PW new line print $UN."/XX" you get the idea. If the log is being generated by

Re: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Craig Moynes
On 4/26/05, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > Craig Moynes wrote: > > Hi All, > > I am using the spreadsheet::parseexcel module to open up a series (31) > > spreadsheets and grab the row counts. > > > > Here is an excerpt with the ParseExcel Code. > >

Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Peter Rabbitson
> also > "or die" is more preferable than "|| die" Why is that? :) I was actually going to post a question about ambiguity syntax later, but here it is anyway. Are the following 4 equivalent? 1) if ($b) { $a = $b; } else { $a = $c; } 2) $a = $b or $c; 3) $a = $b || $c; 4) $a = $b ? $b : $

"Invalid method in request" errors in Apache error log, was Re: error

2005-04-27 Thread Chris Devers
Please use a descriptive subject line. The whole point of this list is to help people with errors, so "error" doesn't really stand out! :-) On Wed, 27 Apr 2005, Octavian Rasnita wrote: > I have found the following errors in the Apache's error log file. Does > anyone know what they represent? >

Re: Edit Windows PATH

2005-04-27 Thread Offer Kaye
On 1/1/88, amr wrote: > Hi All, > > Do we have Perl script that can edit & add to the Windows (XP, 2000) path.? > The PATH environment variable can be accessed using the %ENV hash: print "$ENV{PATH}"; You can change $ENV{"PATH"} in the script and it will change the PATH for the rest of the scri

serial programming in Perl, was Re: Hello

2005-04-27 Thread Chris Devers
Please use a descriptive subject line. Half the spam I get has "Hello" for a subject, so your message nearly got flagged as spam & deleted. On Wed, 27 Apr 2005, laxmi goudappa patil wrote: > Doing serial programming in perl. when i read a port, if there is data > on the port it reads successful

Re: Hello

2005-04-27 Thread Offer Kaye
On 27 Apr 2005 11:34:21 -, laxmi goudappa patil wrote: > Hello.. > Im new to the Perl.. Post some code, no one will be able to help you otherwise. Also, "Hello" is a bad subject for an email to this list. Please use a more meaningful subject in the future. -- Offer Kaye -- To unsubscribe,

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread Ing. Branislav Gerzo
JupiterHost.Net [JN], on Wednesday, April 27, 2005 at 08:15 (-0500) thoughtfully wrote the following: >> 5> my @fa =(); >> 6> my @ha =(); JN> my @fa; JN> my @ha; JN> the = () isn't necessary and doesn't keep you from getting uninitialized JN> value warnings like you think it does, thats only scal

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway Then do it at a later time and do it right, I imagine most all of us are busy also :) here is my updated code. and here is a sample output: My goal is to get all F01 which I am but I am having issues

Re: REGEXP removing - il- - -b-f and - il- - - - f

2005-04-27 Thread DBSMITH
yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway here is my updated code. and here is a sample output: My goal is to get all F01 which I am but I am having issues capturing all of these values into my array. When I run the I get the data I want to see which is just the F01

Edit Windows PATH

2005-04-27 Thread amr
Hi All, Do we have Perl script that can edit & add to the Windows (XP, 2000) path.? Thanks Amr

Hello

2005-04-27 Thread laxmi goudappa patil
 Hello.. Im new to the Perl.. Doing serial programming in perl. when i read a port, if there is data on the port it reads successfully. if there is no data at that moment im recieving the same data which has n't written to the port.. i have two parts of the program.. one is writing to the port,

Re: regex substitution

2005-04-27 Thread Offer Kaye
On 4/27/05, Ramprasad A Padmanabhan wrote: > Hi all, > > I want a regex to replace all continuous occurrences of '-' with > something else say 'x' except the first one > Here's one way: s/-(-+)/"-".("x"x length$1)/ge; Explanation: Flags: "g" means global, i.e. replace all occurences, and "

Re: regex substitution

2005-04-27 Thread Ing. Branislav Gerzo
Ramprasad A Padmanabhan [RAP], on Wednesday, April 27, 2005 at 15:55 (+0530) thinks about: RAP> I want a regex to replace all continuous occurrences of '-' with RAP> something else say 'x' except the first one this is nearly what you want, it should be a bit improved: my @input = ("- Ram", "--

regex substitution

2005-04-27 Thread Ramprasad A Padmanabhan
Hi all, I want a regex to replace all continuous occurrences of '-' with something else say 'x' except the first one These are some examples "- Ram" ===> "- Ram" "-- bla"===> "-x blah" "bla ---" ===> "bla -xxx" And also "-- blah ---"

error

2005-04-27 Thread Octavian Rasnita
Hi, I have found the following errors in the Apache's error log file. Does anyone know what they represent? Thanks. Teddy [Wed Apr 27 13:15:15 2005] [error] [client 10.50.28.247] Invalid method in request \x80C\x01\x03 [Wed Apr 27 13:16:34 2005] [error] [client 10.50.28.247] Invalid method in re

Re: Use Perl to extract keywords

2005-04-27 Thread M. Kristall
Robert Kerry wrote: I want to use Perl to extract keywords from plaintext, don't know whether there are some exsiting package / algorithm for doing that? Thank you. Regards, Robert. If you are attempting to "extract" keywords as a search engine might (i.e. find all words of substance), you might s