replacing characters in a string

2004-05-19 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I cant find a simple perl function to replace characters in a string. Im trying to inserts strings like bob's into a database and need to convert that to bob''s so that sql doesnt whine when i do an insert. Any suggestions? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: replacing characters in a string

2004-05-19 Thread Sapet Frederic
On 18 May 2004 19:12:19 - [EMAIL PROTECTED] (PerlDiscuss - Perl Newsgroups and mailing lists) wrote: I cant find a simple perl function to replace characters in a string. Im trying to inserts strings like bob's into a database and need to convert that to bob''s so that sql doesnt whine

Re: Not reading the whole file

2004-05-19 Thread Jan Eden
Richard Heintze wrote on 04.05.2004: I think I solved my own problem. I'm using a my @backgr_data=INFILE; Or use my $backgr_data = join '', INFILE; - Jan -- There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. - Jeremy S.

Re: Not reading the whole file

2004-05-19 Thread Christopher G Tantalo
Jan Eden wrote: Richard Heintze wrote on 04.05.2004: I think I solved my own problem. I'm using a my @backgr_data=INFILE; Or use my $backgr_data = join '', INFILE; - Jan The dbi module would be the best solution, as the quote method supports any number of quotes in the string itself.

Re: Not reading the whole file

2004-05-19 Thread Christopher G Tantalo
Christopher G Tantalo wrote: Jan Eden wrote: Richard Heintze wrote on 04.05.2004: I think I solved my own problem. I'm using a my @backgr_data=INFILE; Or use my $backgr_data = join '', INFILE; - Jan The dbi module would be the best solution, as the quote method supports any number of

Re: replacing characters in a string

2004-05-19 Thread Wiggins d Anconia
I cant find a simple perl function to replace characters in a string. Im trying to inserts strings like bob's into a database and need to convert that to bob''s so that sql doesnt whine when i do an insert. Any suggestions? There are regex's and the tr/y functions/operators? But in this

Re: replacing characters in a string

2004-05-19 Thread PerlDiscuss - Perl Newsgroups and mailing lists
- Yes I am using DBI. That's perfect, I didnt realize they had this functionality, but it makes alot of sense that they do. Thank you, thank you. Wiggins D Anconia wrote: I cant find a simple perl function to replace characters in a string. Im trying to inserts strings like bob's into a

how-to log in proceedure

2004-05-19 Thread smrtalec
I working on a rather complex database cgi program and i've never done much work with user logins. Ideally I woudl love to set up a secure login which will verify passwords aggaints data stored in an SQL table. The modle I wish to use ie below. The area I need help with is the proper way to

Re: how-to log in proceedure

2004-05-19 Thread Wiggins d Anconia
I working on a rather complex database cgi program and i've never done much work with user logins. Ideally I woudl love to set up a secure login which will verify passwords aggaints data stored in an SQL table. The modle I wish to use ie below. The area I need help with is the proper way to

Perl Coding Standarts

2004-05-19 Thread Marcos . Rebelo
I'm looking for Perl coding standards. I found some in the net but seems they are just web pages not really in use. I was looking for really in use perl coding standards and some opinions about them. I would also like to know if there is tools checking for this standards. For know I'm using

Re: Perl Coding Standarts

2004-05-19 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: I'm looking for Perl coding standards. I found some in the net but seems they are just web pages not really in use. I was looking for really in use perl coding standards and some opinions about them. I would also like to know if there is tools checking for this standards.

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread LRMK
here is a function to remove the duplicated elements it treates the elements as strings you can use this for numaric values after changing 'eq' to '==' only problem of this code it significantly alter the order of the array sub unique(@){ my(@source) = @_; my @destination; @source

Re: Query

2004-05-19 Thread Ramprasad A Padmanabhan
I think you forgot this is the perl list not the awk list But anyway in perl I will do something like perl -ne 'print if(((split(/:/,$_))[2]) =~/\bbhargav\b/)' data.file Ram On Wed, 2004-05-19 at 11:29, [EMAIL PROTECTED] wrote: I am using the below command awk -F: ' $3 ~/bharghav/ {

Re: combining data from more than one file...

2004-05-19 Thread Johan Viklund
Hi, See code On Tue, 18 May 2004 13:16:37 -0400, Michael Robeson [EMAIL PROTECTED] wrote: Ok great. Most of what you show does make sense. However, there are some bits of code that I need further clarification with. Some bits I am able to tell what they are doing but I do not quite know how

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Remo Sanges
On May 19, 2004, at 10:14 AM, Jason Dusek wrote: Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? It's a very common problem... a simple solution is to use hash: #!/usr/bin/perl use strict; use warnings; my @array

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Randy W. Sims
Jason Dusek wrote: Hi, Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? Hmm, none of the solutions so far have been stable. In other words all the solutions so far modify the order of elements from the source

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Ramprasad A Padmanabhan
On Wed, 2004-05-19 at 14:28, Randy W. Sims wrote: Jason Dusek wrote: Hi, Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? Hmm, none of the solutions so far have been stable. In other words all the

Re: Query

2004-05-19 Thread Jose Alves de Castro
On Wed, 2004-05-19 at 06:59, [EMAIL PROTECTED] wrote: I am using the below command awk -F: ' $3 ~/bharghav/ { print $0 } ' data.file but this command produces both Vijayb:12345:Vijay B bharghav vijaya:12347:vijaya bharghavi what to if I want only record containing exactly the word

Re: tail -f does not exit

2004-05-19 Thread Claude
Rob == Rob Dixon [EMAIL PROTECTED] writes: I got your code running nicely, although I had to make a small change due to an older Perl (5.004) I am using: [...] Rob You need to close and reopen the file if you want to check for a rename. Rob Something like the program below. Which actually

RE: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Bob Showalter
Randy W. Sims wrote: How would you implement a version of the function that produced an array where the elements are in the same order and only the first of any duplicates are kept? @uniq = do { my %seen; grep !$seen{$_}++, @arr }; Or, if you want a function: sub uniq { my %seen; grep

Install epic plugin in the eclips

2004-05-19 Thread Marcos . Rebelo
I don't have access to the internet from my computer. How do I set the epic working for me? Thanks MArcos -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Jeff 'japhy' Pinyan
On May 19, Randy W. Sims said: Hmm, none of the solutions so far have been stable. In other words all the solutions so far modify the order of elements from the source array. How would you implement a version of the function that produced an array where the elements are in the same order and only

Installation Problem -- Text::CSV

2004-05-19 Thread Jeff Westman
Hi All, I am running Active Perl 5.8.0, and installed CSV.pm into c:\perl\lib\text. When I run the test.pl file with it I get C:\ perl test.pl 1..20 Can't locate auto/Text/CSV/autosplit.ix in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/lib/AutoLoader.pm line 158. at

regexp

2004-05-19 Thread Graf Laszlo
Hi I have the following HTML structure: sm:a sm:b BBB /sm:b sm:c CCC /sm:c /sm:a Every line in this structure is an element of an array, named @lines, and I access the elements using a foreach loop. When I know the tag's name, by

RE: Installation Problem -- Text::CSV

2004-05-19 Thread Bob Showalter
Jeff Westman wrote: Hi All, I am running Active Perl 5.8.0, and installed CSV.pm into c:\perl\lib\text. When I run the test.pl file with it I get C:\ perl test.pl 1..20 Can't locate auto/Text/CSV/autosplit.ix in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at

Re: regexp

2004-05-19 Thread JupiterHost.Net
Graf Laszlo wrote: Hi Hello, I have the following HTML structure: Looks more like XML... sm:a sm:b BBB /sm:b sm:c CCC /sm:c /sm:a Every line in this structure is an element of an array, named @lines, and I access the elements using a foreach loop. When I know the

Re: regexp

2004-05-19 Thread James Edward Gray II
On May 19, 2004, at 9:52 AM, Graf Laszlo wrote: Hi I have the following HTML structure: sm:a sm:b BBB /sm:b sm:c CCC /sm:c /sm:a Every line in this structure is an element of an array, named @lines, and I access the elements using a

Re: regexp

2004-05-19 Thread Jose Alves de Castro
On Wed, 2004-05-19 at 15:52, Graf Laszlo wrote: Hi Hi I have the following HTML structure: sm:a sm:b BBB /sm:b sm:c CCC /sm:c /sm:a Every line in this structure is an element of an array, named @lines, and I access the elements

Re: Can Perl be faster than C ?

2004-05-19 Thread drieux
On Apr 27, 2004, at 3:37 AM, John W. Krahn wrote: Sumanth Sharma wrote: [..] Are there instances/scenarios where Perl can really be faster that C/C++. (Do not include coding or design time here, consider only run-time). Yes. Check out this URL for proof. :-)

perl / unixODBC and Oracle 9i

2004-05-19 Thread Johnson, Shaunn
Howdy: I'm running Perl 5.8.x on RHEL ver. 3 and I am trying to connect to Oracle 9i (both the database and the Application Server's repository). With Perl 5.6.1, I used DBI and Oracle:DBD and things worked well, with Perl 5.8.x, the readme docs for the DBD module says that it is incompatible

Move file from one zip to another using Archive::Zip

2004-05-19 Thread carl
Hola, How do I remove a file from a zip file and add it to a different existing archive? From the Archive_Zip documentation I understand that I'm clobbering the existing archives when i use the code below. How do I not clobber them? thank you. use Archive::Zip qw( :ERROR_CODES :CONSTANTS

RE: Installation Problem -- Text::CSV

2004-05-19 Thread Jeff Westman
Bob Showalter [EMAIL PROTECTED] wrote: Jeff Westman wrote: Hi All, I am running Active Perl 5.8.0, and installed CSV.pm into c:\perl\lib\text. When I run the test.pl file with it I get C:\ perl test.pl 1..20 Can't locate auto/Text/CSV/autosplit.ix in @INC (@INC contains:

RE: perl / unixODBC and Oracle 9i

2004-05-19 Thread Bob Showalter
Johnson, Shaunn wrote: Howdy: I'm running Perl 5.8.x on RHEL ver. 3 and I am trying to connect to Oracle 9i (both the database and the Application Server's repository). With Perl 5.6.1, I used DBI and Oracle:DBD and things worked well, with Perl 5.8.x, the readme docs for the DBD

Re: Move file from one zip to another using Archive::Zip

2004-05-19 Thread Wiggins d Anconia
Hola, How do I remove a file from a zip file and add it to a different existing archive? From the Archive_Zip documentation I understand that I'm clobbering the existing archives when i use the code below. How do I not clobber them? thank you. use Archive::Zip qw( :ERROR_CODES