RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
You're right, I was thinking of *? -Original Message- From: Luke Bakken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 3:31 PM To: Timothy Johnson Subject: RE: Creating a string with quotes and delimiters from an Array {0,1} is equivalent to ? On Wed, 27 Feb

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Michael Fowler
On Tue, Feb 26, 2002 at 07:13:52PM -, Angus Laycock wrote: > I am trying to handle parameters from UNIX that call a PERL script the uses > DBI, that then calls Sybase stored procedures. > > The problem I have found is that they don't pass the strings with single > quotes and dates are 02-27-

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread John W. Krahn
Angus Laycock wrote: > > Hi, Hello, > I have an array > @array = qw(alf bert charlie 4) > > and I want a string that contains this value < > 'alf','bert','charlie','4' > with the single quotes and commas. > > I know I can do this $string = join ( ',' , @array); > which gives me this >

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
Wednesday, February 27, 2002 11:11 PM Subject: RE: Creating a string with quotes and delimiters from an Array > > I guess I should have put this: !~ /^[-+]{0,1}\d+(.\d+){0,1}$/ since > there's really no time that you will need more than one positive or negative > in one number.

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
February 27, 2002 11:14 PM Subject: Re: Creating a string with quotes and delimiters from an Array > On Tue, Feb 26, 2002 at 06:07:33PM -, Angus Laycock wrote: > > I have an array > @array = qw(alf bert charlie 4) > > > > and I want a string that contains this value < &

RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
#x27;Angus Laycock'; Tanton Gibbs; [EMAIL PROTECTED] Subject: RE: Creating a string with quotes and delimiters from an Array maybe you can replace =~ /\D/ with "!~ /^[-+]?\d+(.\d+){0,1}$/" *whew* which means "does not equal: start with zero or more - or + # ^[-+]?

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Michael Fowler
On Tue, Feb 26, 2002 at 06:07:33PM -, Angus Laycock wrote: > I have an array > @array = qw(alf bert charlie 4) > > and I want a string that contains this value < 'alf','bert','charlie','4' > > with the single quotes and commas. $str = join(',', map { "'$_'" } @array); > Also, how can

RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
d of the string # (.\d+){0,1}$ -Original Message- From: Angus Laycock [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:41 AM To: Tanton Gibbs; [EMAIL PROTECTED] Subject: Re: Creating a string with quotes and delimiters from an Array What about on negative numbers like -1? Th

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Tanton Gibbs
Angus Laycock" <[EMAIL PROTECTED]> To: "Tanton Gibbs" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 1:41 PM Subject: Re: Creating a string with quotes and delimiters from an Array > What about on negative numbers like -1? They come up w

RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
From: Tanton Gibbs <[EMAIL PROTECTED]> To: Angus Laycock <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 27, 2002 10:30 PM Subject: Re: Creating a string with quotes and delimiters from an Array > Your best bet is to do this

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
= /\D/ ? "'$_'," : "$_,"; > > > > If you have the time. > > > > Thanks again > > > > Gus > > > > > > - Original Message - > > From: Tanton Gibbs <[EMAIL PROTECTED]> > > To: Angus

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Tanton Gibbs
it actually expands to $string = $string . "'$_',"; Hope this helps! Tanton - Original Message - From: "Angus Laycock" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 1:33 PM Subject: Re: Creating a string with quotes a

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
ECTED]> Sent: Wednesday, February 27, 2002 10:30 PM Subject: Re: Creating a string with quotes and delimiters from an Array > Your best bet is to do this with a foreach loop > > my $string = ''; > my @array = qw( alf bert charlie 4 ) > foreach( @array ) { > $string

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
ECTED]> Sent: Wednesday, February 27, 2002 10:30 PM Subject: Re: Creating a string with quotes and delimiters from an Array > Your best bet is to do this with a foreach loop > > my $string = ''; > my @array = qw( alf bert charlie 4 ) > foreach( @array ) { > $string

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
rings. Thanks Gus - Original Message - From: Timothy Johnson <[EMAIL PROTECTED]> To: 'Angus Laycock' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 27, 2002 10:24 PM Subject: RE: Creating a string with quotes and delimiters from an Array

Re: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Tanton Gibbs
[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 1:07 PM Subject: Creating a string with quotes and delimiters from an Array Hi, I have an array > @array = qw(alf bert charlie 4) and I want a string that contains this value < 'alf','bert','charlie&

RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
son Sent: Wednesday, February 27, 2002 2:23 PM To: 'Angus Laycock'; [EMAIL PROTECTED] Subject: RE: Creating a string with quotes and delimiters from an Array You could try something like this: foreach(@array){ unless($_ =~ /^\d+$/){ $scalar .= "\'$_\',"; #

RE: Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Timothy Johnson
- From: Angus Laycock [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:08 AM To: [EMAIL PROTECTED] Subject: Creating a string with quotes and delimiters from an Array Hi, I have an array > @array = qw(alf bert charlie 4) and I want a string that contains this value

Creating a string with quotes and delimiters from an Array

2002-02-27 Thread Angus Laycock
Hi, I have an array > @array = qw(alf bert charlie 4) and I want a string that contains this value < 'alf','bert','charlie','4' > with the single quotes and commas. I know I can do this $string = join ( ',' , @array); which gives me this > < one|two|three|four> but how do I get the si