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,
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
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.
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.
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
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
- 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
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
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
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
[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.
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
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/ {
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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. :-)
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
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
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:
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
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
34 matches
Mail list logo