Re: DBI problem

2005-12-13 Thread Octavian Rasnita
Hi, As far as I know, the method fetchrow_hashref doesn't require a parameter (like fetchall_hashref). Teddy - Original Message - From: john [EMAIL PROTECTED] To: beginners@perl.org Sent: Tuesday, December 13, 2005 09:30 AM Subject: DBI problem Hi all- I'm attempting to loop thru

Re: [SPAM DETECT] New lines are not removed using HTML::Strip::Whitespace module

2005-12-13 Thread Xavier Noria
On Dec 13, 2005, at 5:59, Durai raj wrote: I tried to remove white space and newlines from HTML pages using HTML::Strip::Whitespace module. It removes the white space, but not NEW LINES. Here is my script: use HTML::Strip::Whitespace

RE: extracting substrings from string using regexp

2005-12-13 Thread Owen Cook
On Tue, 13 Dec 2005, Pant, Hridyesh wrote: But in windows when I am trying to install Module YAPE::Regex I am getting below error Can't call method ok on an undefined value at C:/Perl/site/lib/PPM/UI.pm line 881, $__ANONIO__ line 17 Sorry, I can't help you with Windows. Also just

RE: extracting substrings from string using regexp

2005-12-13 Thread Timothy Johnson
This sounds like you might have a problem with your ActivePerl installation. You might want to reinstall or bring this up on the ActivePerl mailing lists. In the meantime, I'll send you a zipped copy of what I have in my YAPE directory. Just drop it into c:\perl\site\lib and see if that works

Re: [SPAM DETECT] New lines are not removed using HTML::Strip::Whitespace module

2005-12-13 Thread Durai raj
Hi, Thanks for the reply. Is there any other perl modules or tools available to remove the white space in HTML and JavaScript pages? Thanks, Durai Xavier Noria [EMAIL PROTECTED] wrote: On Dec 13, 2005, at 5:59, Durai raj wrote: I tried to remove white space and newlines from HTML pages

Re: [SPAM DETECT] New lines are not removed using HTML::Strip::Whitespace module

2005-12-13 Thread Xavier Noria
On Dec 13, 2005, at 10:41, Durai raj wrote: Hi, Thanks for the reply. Is there any other perl modules or tools available to remove the white space in HTML and JavaScript pages? Try HTML::Clean maybe. However, note that the docs say whitespaceRemove excess whitespace ...

How to push data onto a Class::Struct array?

2005-12-13 Thread Dan Fish
I've got a Class::Struct array (@stack) that has, as one of it's members, another array of Class::Struct (@bop) I know how to make assignments explicitly, but can't figure out the syntax to use to push onto the (stack-bop) array. I need to do this mainly because I'll be pushing varying numbers

Re: [SPAM DETECT] New lines are not removed using HTML::Strip::Whitespace module

2005-12-13 Thread Chris Devers
On Tue, 13 Dec 2005, Durai raj wrote: Thanks for the reply. Is there any other perl modules or tools available to remove the white space in HTML and JavaScript pages? Hang on -- why do you want to remove white space? To make serving content faster consume less bandwidth? If so, you might

package name

2005-12-13 Thread Brent Clark
Hi all For some reason I keep geting this message. Global symbol $arguments requires explicit package name at sql_handler.pm line 37. Global symbol $arguments requires explicit package name at sql_handler.pm line 40. Global symbol $table requires explicit package name at sql_handler.pm line

Re: DBI problem

2005-12-13 Thread Frank Bax
At 02:30 AM 12/13/05, john wrote: I'm attempting to loop thru an input file, executing a SELECT query with the value from each line. The script works for the first iteration, and then gives these error messages: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at

Re: package name

2005-12-13 Thread John Doe
Brent Clark am Dienstag, 13. Dezember 2005 13.25: Hi all Hi Brent For some reason I keep geting this message. Global symbol $arguments requires explicit package name at sql_handler.pm line 37. Global symbol $arguments requires explicit package name at sql_handler.pm line 40. Global symbol

RE: extracting substrings from string using regexp

2005-12-13 Thread Dhanashri Bhate
Hi, The 500 Cannot connect error usually comes if you're behind a firewall. Try this, On command propmt run the commands: set HTTP_proxy= yourproxy :port set HTTP_proxy_user=username set HTTP_proxy_pass=password Or go to My Computer-properties-advanced-environment variables-user variables and

Re: sort files by creation time

2005-12-13 Thread Bob Showalter
Brian Volk wrote: Of course I have one more rookie question and a reference to a perldoc is just fine. :~) If I use the following code, why do I not need to declare the $a and the $b w/ my? Correct. This is explained in perldoc perlvar: $a $b Special package variables when using

append to an Excel File

2005-12-13 Thread vinay mohan
HOW CAN I APPEND DATA TO AN EXISTING EXCEL FILE OR MODIFY THE DATA PRESENT IN THE EXCEL FILE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: append to an Excel File

2005-12-13 Thread Ing. Branislav Gerzo
vinay mohan [vm], on Tuesday, December 13, 2005 at 19:57 (+0530) wrote: vm HOW CAN I APPEND DATA TO AN EXISTING EXCEL FILE OR MODIFY THE DATA vm PRESENT IN THE EXCEL FILE Hello to you too! Are you angry to us? What did you tried, where did you searched, show us some code. P.S.: search.cpan.org

RE: sort files by creation time

2005-12-13 Thread Brian Volk
-Original Message- From: Brian Volk Sent: Tuesday, December 13, 2005 8:10 AM To: 'Brian Franco' Subject: RE: sort files by creation time -Original Message- From: Brian Franco [mailto:[EMAIL PROTECTED] Sent: Monday, December 12, 2005 7:34 PM To: Brian Volk Subject: Re: sort

Re: sort files by creation time

2005-12-13 Thread OXx
Hello all, I try to launch my perl application as a windows service. I compile it with PAR so I have mysoft.exe Then i installed win32::daemon, no problem. I try this script so: use Win32::Daemon; %Hash = ( machine = '', name= 'PerlTest', display = 'Oh my

Win32::daemon start as service problem

2005-12-13 Thread OXx
Hello all, I try to launch my perl application as a windows service. I compile it with PAR so I have mysoft.exe Then i installed win32::daemon, no problem. I try this script so: use Win32::Daemon; %Hash = ( machine = '', name= 'PerlTest', display = 'Oh my

reference assignment - lol

2005-12-13 Thread Dermot Paikkos
Hi, I am a bit stuck with references and was hoping someone could help me out. In File1 I need to isolate the last number in the column and see if it exists in file2. If so, I would like to add the content of the line from file1 and print it out. There may be other ways of doing this but I

Re: reference assignment - lol

2005-12-13 Thread Wiggins d'Anconia
Dermot Paikkos wrote: Hi, I am a bit stuck with references and was hoping someone could help me out. In File1 I need to isolate the last number in the column and see if it exists in file2. If so, I would like to add the content of the line from file1 and print it out. There may be

Re: sort files by creation time

2005-12-13 Thread JupiterHost.Net
OXx wrote: Hello all, I try to launch my perl application as a windows service. I compile it with PAR so I have mysoft.exe Then i installed win32::daemon, no problem. I try this script so: use Win32::Daemon; a) always always always: use strict; use warnings; on code you post to this

file changes monitor

2005-12-13 Thread Octavian Rasnita
Hi, I have created a program that monitors a text file which sits on another computer from the network, and when it sees a change in that file, it opens it, and gets the newly added lines. I have seen that the program consumes too many computer resources and I want to improve it a little. The

Re: file changes monitor

2005-12-13 Thread JupiterHost.Net
Octavian Rasnita wrote: Hi, I have created a program that monitors a text file which sits on another Why not use File::Tail or File::Tail::App or some other File::Tail:: mod? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: file changes monitor

2005-12-13 Thread Mulander
Hi, In your situation I would try doing something like: a) Check the size of the local file b) connect to the remote computer c) check the size of the remote file d) if local and remote file sizes do not match then I would use seek to jump to offset where my file ends. e) read in the changes and

RE: file changes monitor

2005-12-13 Thread Timothy Johnson
What operating system are you on? For Win32, check out the Win32::ChangeNotify module. -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 13, 2005 9:46 AM To: beginners@perl.org Subject: file changes monitor Hi, I have created a program that

Re: file changes monitor

2005-12-13 Thread Mulander
Hi again, I did some testing on the method I meantioned before here is the code: #!/usr/bin/perl use warnings; use strict; my $a = 'a.txt'; my $b = 'b.txt'; if(-s $a != -s $b){ print Files differ\n; open F1,$a or die Can't open: $!; open F2,$b or die Can't open: $!; seek F2,-s $a,0; print

Re: file changes monitor

2005-12-13 Thread Octavian Rasnita
From: Mulander [EMAIL PROTECTED] Hi, In your situation I would try doing something like: a) Check the size of the local file ** My program does that. b) connect to the remote computer c) check the size of the remote file ** Yes, I am doing that. d) if local and remote file sizes do not match

Re: file changes monitor

2005-12-13 Thread Octavian Rasnita
From: Mulander [EMAIL PROTECTED] Hi again, I did some testing on the method I meantioned before here is the code: Thank you for the code. I will try to do it again. I will try to find how File::Tail does that blocking, because my problem is that this program should run continuously, and if I use

Re: How to push data onto a Class::Struct array?

2005-12-13 Thread John W. Krahn
Dan Fish wrote: I've got a Class::Struct array (@stack) that has, as one of it's members, another array of Class::Struct (@bop) I know how to make assignments explicitly, but can't figure out the syntax to use to push onto the (stack-bop) array. I need to do this mainly because I'll be

Re: file changes monitor

2005-12-13 Thread Jenny Chen
Please check on this link: http://www.oreilly.com/catalog/cookbook/chapter/ch08.html Jenny --- Octavian Rasnita [EMAIL PROTECTED] wrote: From: Mulander [EMAIL PROTECTED] Hi again, I did some testing on the method I meantioned before here is the code: Thank you for the code. I will try to

Chanching a string inside a file

2005-12-13 Thread MARG
Hi, I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to PATH=$PATH/home/bin:/usr/local/httpd/bin I'm using the following: perl -pi~ -e 's/PATH=$PATH/home/bin/PATH=$PATH/home/bin:/usr/local/httpd/bin ' .bash_profile but i'm getting a lot of errors. What might be wrong ?

RE: Chanching a string inside a file

2005-12-13 Thread Timothy Johnson
What might be the errors? -Original Message- From: MARG [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 13, 2005 4:18 PM To: beginners@perl.org Subject: Chanching a string inside a file snip but i'm getting a lot of errors. What might be wrong ? snip -- To unsubscribe,

Re: Chanching a string inside a file

2005-12-13 Thread MARG
Hi Timothy, Timothy Johnson wrote: What might be the errors? Bareword found where operator expected at -e line 1, near /httpd/bin (Missing operator before bin?) Sintax error at -e line 1, near /usr/local/ Excecution of -e aborted due to compilation errors Warm Regards, MARG

Re: Chanching a string inside a file

2005-12-13 Thread John W. Krahn
MARG wrote: Hi, Hello, I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to PATH=$PATH/home/bin:/usr/local/httpd/bin I'm using the following: perl -pi~ -e 's/PATH=$PATH/home/bin/PATH=$PATH/home/bin:/usr/local/httpd/bin ' .bash_profile but i'm getting a lot of

Re: Chanching a string inside a file

2005-12-13 Thread MARG
Hi John, Thank you for your ansewer. I don't have any error anymore, but the file remains unchanged :( Any ideas ? Warm Regards, MARG John W. Krahn wrote: MARG wrote: Hi, Hello, I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to

Re: Chanching a string inside a file

2005-12-13 Thread John W. Krahn
MARG wrote: John W. Krahn wrote: MARG wrote: I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to PATH=$PATH/home/bin:/usr/local/httpd/bin I'm using the following: perl -pi~ -e 's/PATH=$PATH/home/bin/PATH=$PATH/home/bin:/usr/local/httpd/bin ' .bash_profile but i'm getting

Re: Chanching a string inside a file

2005-12-13 Thread MARG
Hi John, No good. The file remains unchanged :( But thank you anyway. Warm Regards, MARG John W. Krahn wrote: MARG wrote: John W. Krahn wrote: MARG wrote: I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to PATH=$PATH/home/bin:/usr/local/httpd/bin I'm using the

Re: Chanching a string inside a file

2005-12-13 Thread John W. Krahn
MARG wrote: John W. Krahn wrote: MARG wrote: John W. Krahn wrote: MARG wrote: I'm trying to change the string in .bash_profile: PATH=$PATH:/home/bin to PATH=$PATH/home/bin:/usr/local/httpd/bin I'm using the following: perl -pi~ -e

Re: Chanching a string inside a file

2005-12-13 Thread MARG
Hi John, I finally made it: # perl -pi -e's~^(PATH=\$PATH:\$HOME/bin)~$1:/usr/local/httpd/bin~' .bash_profile Thank you so much. If it weren't you puting me in the right tracks, i'd never make it. Warm Regards, MARG John W. Krahn wrote: MARG wrote: John W. Krahn wrote: MARG wrote: John

manipulating each string in a file

2005-12-13 Thread anand kumar
Hi All, I have a task i.e , I have to read each string from a file check wheather it is in the list(predifned array) or not, if found i have to make some changes to the string and rewrite back to file. here on exception is that in some cases : for eg: if the

Re: DBI problem

2005-12-13 Thread john
Teddy, Yes, you're right. I changed this line: while ((my $ref) = $sth2 -fetchrow_hashref($num)) {... by removing the parameter, and quotes around 'my $ref' : while (my $ref = $sth2 -fetchrow_hashref()) {... and the script works now. Thanks for your help. John Octavian Rasnita wrote:

Re: DBI problem

2005-12-13 Thread john
Frank, I can't see it in emacs. What do you mean by dump the last line of the file in binary? Sounds like something I need to learn about. John Frank Bax wrote: At 02:30 AM 12/13/05, john wrote: I'm attempting to loop thru an input file, executing a SELECT query with the value from each

Named pipe performance ??

2005-12-13 Thread Michael Gale
Hello, I am testing out named pipes and am seeing a performance problem, below is my writer and read scripts. The read never receives the same amount of messages. In the writer I moved the file open and close to inside the loop, which slowed down the overall process that 80%-90% of the