Re: strings printing bug

2008-04-27 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > On Apr 26, 9:55 am, [EMAIL PROTECTED] (Rob Dixon) wrote: >> >> [EMAIL PROTECTED] wrote: >>> >>> The following script is to read 4 consecutive lines at a time from a >>> file, concatenate the first 3 lines >>> (with a ", "), and print the result to STDOUT. If the 3 lin

Re: strings printing bug

2008-04-27 Thread Chas. Owens
On Sat, Apr 26, 2008 at 3:42 PM, <[EMAIL PROTECTED]> wrote: > I tried your suggestion and got the following output: > 1) the first col didn't print, and the 3rd col overwrote the 2nd; this > is the main stumbling block > 2) also, what if example.txt has 36 lines with the same format as > descr

Re: strings printing bug

2008-04-27 Thread evan9021
I tried your suggestion and got the following output: 1) the first col didn't print, and the 3rd col overwrote the 2nd; this is the main stumbling block 2) also, what if example.txt has 36 lines with the same format as described. FYI I'm using cgywin's version of perl. -- On Apr 26, 9:55 am, [EMAI

Re: strings printing bug

2008-04-26 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > The following script is to read 4 consecutive lines at a time from a > file, concatenate the first 3 lines > (with a ", "), and print the result to STDOUT. If the 3 lines aren't > concatenated they print correctly, however > if they are, the result is gibberish. Any sug

Re: strings printing bug

2008-04-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: The following script is to read 4 consecutive lines at a time from a file, concatenate the first 3 lines (with a ", "), and print the result to STDOUT. If the 3 lines aren't concatenated they print correctly, however if they are, the result is gibberish. Any suggestions

Re: Strings vs Arrays

2006-12-30 Thread M. Lewis
John W. Krahn wrote: M. Lewis wrote: I now we can push (concatenate) data onto an array. I would assume that we could concatenate data on to a string as well with something like: $newstring = $oldstring . $newdata Yes. Maybe this isn't correct though. I've not yet tried it. My question is

Re: Strings vs Arrays

2006-12-30 Thread Leonid Grinberg
To push something to an array: push(@array, $data); To push something onto a scalar: $scalar = $scalar . $data; -or- $scalar .= $data; The better method depends entirely on what you intend to do with the data and how you have it. It is also very easy to both split a string into an array, @arr

Re: Strings vs Arrays

2006-12-30 Thread John W. Krahn
M. Lewis wrote: > > I now we can push (concatenate) data onto an array. > > I would assume that we could concatenate data on to a string as well > with something like: > > $newstring = $oldstring . $newdata Yes. > Maybe this isn't correct though. I've not yet tried it. > > My question is one

Re: Strings??? Sub???

2004-07-11 Thread Jenda Krynicky
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]> > Charlene Gentle wrote: > > I need a example of how to receive a string (after someone entered a > > name for a txt file into a tk-box). It has to do the following : > > > > 1. Send the string to a sub > > 2. The sub should save the txt file for later

Re: Strings??? Sub???

2004-06-20 Thread Gunnar Hjalmarsson
Charlene Gentle wrote: I need a example of how to receive a string (after someone entered a name for a txt file into a tk-box). It has to do the following : 1. Send the string to a sub 2. The sub should save the txt file for later use. 3. The file should show in a message box that it has been save

Re: Strings with extended characters

2004-04-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Is there a simple way to reject any string that has extended characters in > it? In other words, only accept the 88 (I think it's 88) regular keyboard > characters and numbers. I can't find a simple way to do this. if ( $string =~ /[^[:print:]]/ ) { print "This st

Re: Strings with extended characters

2004-04-01 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: Is there a simple way to reject any string that has extended characters in it? In other words, only accept the 88 (I think it's 88) regular keyboard characters and numbers. I can't find a simple way to do this. Does this help? if($string !~ m/^\w+$/) { die "I hate ex

RE: Strings with extended characters

2004-04-01 Thread Jayakumar Rajagopal
Jim Please send two sample strings one that contains 'reject'able stuff, and other with those 88. That would clarify us better. Jay -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 9:58 AM To: [EMAIL PROTECTED] Subject: Strings with extend

Re: Strings with extended characters

2004-04-01 Thread Daniel Staal
--As of Thursday, April 1, 2004 9:58 AM -0500, [EMAIL PROTECTED] is alleged to have said: Is there a simple way to reject any string that has extended characters in it? In other words, only accept the 88 (I think it's 88) regular keyboard characters and numbers. I can't find a simple way to do

Re: Strings Perl

2004-02-24 Thread Rob Dixon
Jerry Preston wrote: > > I know how to do this in C, but how to in Perl? I want to chop the > following string: > >if ((bulk>0) || (sub>0)||(chuckcon>0)) conpin (smu3, bulk, sub, chuckcon, > 0); > > Apart so that all is left is: > >if ((bulk>0) || (sub>0)||(chuckcon>0)) > > The key word to

Re: strings

2004-02-14 Thread R. Joseph Newton
Mark Goland wrote: > Rob, > Thanks, this is a very clever solution. I will merge be murging files > [ excel spread sheets saved in csv ], first line of files display's fileds. > All files have same fields, but in different orders. Doe's anyone know of a > way I can automate converssions of exc

Re: strings

2004-02-14 Thread Mark Goland
v ?? Mark - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 13, 2004 7:26 AM Subject: Re: strings > Mark Goland wrote: > > > > I have a tring which contains 60 to 80 keywords, I need to know what p

Re: strings

2004-02-13 Thread Rob Dixon
Mark Goland wrote: > > I have a tring which contains 60 to 80 keywords, I need to know what position a > keyword is in. I need an efficint way to extra position of key words, here is > how I am currently finding positions, > > $string="type,model,color,date"; > > # this is how I am currently gettin

RE: strings

2004-02-12 Thread Toby Stuart
> -Original Message- > From: Mark Goland [mailto:[EMAIL PROTECTED] > Sent: Friday, February 13, 2004 1:28 PM > To: [EMAIL PROTECTED] > Subject: strings > > > Hi All, > > I have a tring which contains 60 to 80 keywords, I need to > know what position a keyword is in. I need an efficint

Re: Strings and operators?

2003-06-14 Thread Tassilo von Parseval
On Sat, Jun 14, 2003 at 08:56:21AM -0500 deborah wrote: > How does Perl interpret a string when used in a numeric comparison > equation? It depends. > I accidently used a numeric comparison operator when I was comparing > strings and I found that no matter what strings I compared, Perl always

Re: Strings and operators?

2003-06-14 Thread John W. Krahn
Deborah wrote: > > How does Perl interpret a string when used in a numeric comparison > equation? > I accidently used a numeric comparison operator when I was comparing > strings and I found that no matter what strings I compared, Perl always > said they were equal. > > Any other operation (suc