Re: splitting on every other delimiter

2006-05-01 Thread John W. Krahn
Rance Hall wrote: > assume the following code: > > my $output = qx{systemcall}; > > assume that the output of the systemcall looks something like this > > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > ... > > what like to do is

Re: splitting on every other delimiter

2006-05-01 Thread Dr.Ruud
Rance Hall schreef: > name1\n > value1\n > name2\n > value2\n > ... > what like to do is get the name/value pairs into a hash of some sort There just was a thread on this on news:comp.language.perl.misc , see news:[EMAIL PROTECTED] and on. -- Affijn, Ruud "Gewoon is een tijger." -- To unsu

Re: splitting on every other delimiter

2006-05-01 Thread Rance Hall
Chas Owens wrote: On 5/1/06, Rance Hall <[EMAIL PROTECTED]> wrote: assume the following code: my $output = qx{systemcall}; assume that the output of the systemcall looks something like this name\n value\n snip what like to do is get the name/value pairs into a hash of some sort snip W

Re: splitting on every other delimiter @ 1146493312

2006-05-01 Thread Johan Meskens CS3 jmcs3
Intrah onat Diria .. Mon, 01 May 2006 09:06:21 -0500 , Rance Hall wrote "Revera y": > > For additional commands, e-mail: [EMAIL PROTECTED] > To unsubscribe, e-mail: [EMAIL PROTECTED] > -- > > > > [EMAIL PROTECTED] > 1-308

Re: splitting on every other delimiter

2006-05-01 Thread Chas Owens
On 5/1/06, Rance Hall <[EMAIL PROTECTED]> wrote: assume the following code: my $output = qx{systemcall}; assume that the output of the systemcall looks something like this name\n value\n snip what like to do is get the name/value pairs into a hash of some sort snip Why are you using a scal

splitting on every other delimiter

2006-05-01 Thread Rance Hall
assume the following code: my $output = qx{systemcall}; assume that the output of the systemcall looks something like this name\n value\n name\n value\n name\n value\n name\n value\n name\n value\n name\n value\n ... what like to do is get the name/value pairs into a hash of some sort split w

Re: Replying to the perl list (was Re: problem with whitespace not splitting on split.)

2006-04-29 Thread Jeff Peng
> In practice, I use two types of replies. One to all the list > recipients and one to only the author of this particular message. > It's silly to send the message to the entire list and send a > duplicate to the author. (He already has a copy because he is a > member of the list.) > I do agr

Re: Replying to the perl list (was Re: problem with whitespace not splitting on split.)

2006-04-29 Thread Mr. Shawn H. Corey
On Sat, 2006-29-04 at 07:47 -0700, Randal L. Schwartz wrote: > > "Rance" == Rance Hall <[EMAIL PROTECTED]> writes: > > Rance> All of my other lists behave in the reverse, if you reply, it goes to > Rance> the list, if you reply all, a second copy goes to the individual. > > Oh geez. Here we

RE: Replying to the perl list (was Re: problem with whitespace not splitting on split.)

2006-04-29 Thread Charles K. Clarkson
Randal L. Schwartz wrote: : Oh geez. Here we go again. : : Please read . : And understand that *no* list managed at lists.perl.org will : *ever* have reply-to set. Thank goodness. :) : : Your other lists coddle to the beginners who can't operate t

Re: Replying to the perl list (was Re: problem with whitespace not splitting on split.)

2006-04-29 Thread Randal L. Schwartz
> "Rance" == Rance Hall <[EMAIL PROTECTED]> writes: Rance> All of my other lists behave in the reverse, if you reply, it goes to Rance> the list, if you reply all, a second copy goes to the individual. Oh geez. Here we go again. Please read .

Re: problem with whitespace not splitting on split.

2006-04-28 Thread Chad Perrin
On Fri, Apr 28, 2006 at 10:20:52AM -0600, Chad Perrin wrote: > > > > > The *only* way you lose functionality by rewriting reply-to is if you > > also munge from so it looks like the massage came from the list. I've > > know lists that do that, but this isn't one of them. > > That would be a chan

Re: problem with whitespace not splitting on split.

2006-04-28 Thread Chad Perrin
On Fri, Apr 28, 2006 at 09:48:01AM -0400, Jay Savage wrote: > On 4/27/06, Chad Perrin <[EMAIL PROTECTED]> wrote: > > >I tend to agree with the principles on which you base your opinion, but > >I don't think they're properly applied here, necessarily. I've never > >been subscribed to any other int

Replying to the perl list (was Re: problem with whitespace not splitting on split.)

2006-04-28 Thread Rance Hall
Chad Perrin wrote: On Thu, Apr 27, 2006 at 08:42:51AM -0500, Rance Hall wrote: some mail readers are probably capable of reading the list header and figuring it out, but I bet others don't (like mine) I use Mutt, which allows me to list-reply, but without setting up custom configurations it

Re: problem with whitespace not splitting on split.

2006-04-28 Thread Jay Savage
On 4/27/06, Chad Perrin <[EMAIL PROTECTED]> wrote: On Thu, Apr 27, 2006 at 06:27:06PM -0400, Ryan Frantz wrote: I tend to agree with the principles on which you base your opinion, but I don't think they're properly applied here, necessarily. I've never been subscribed to any other interactive

[OT] list-reply (was: Re: problem with whitespace not splitting on split.)

2006-04-27 Thread Dr.Ruud
Chad Perrin schreef: > Do you, perhaps, lack an email client that properly > handles the list-reply header yourself? A capitalized "RE:" makes me expect the worst. I am a member of plenty of technical lists (perl, procmail, etc.) that don't munge the Reply-To. When I use a mail-client like Outl

Re: problem with whitespace not splitting on split.

2006-04-27 Thread Chad Perrin
On Thu, Apr 27, 2006 at 06:27:06PM -0400, Ryan Frantz wrote: > > Personally, I don't mind it either way as I always double-check my > replies and their destinations to be sure they're what I intended. Just > because email is fast and convenient, doesn't mean that we should ignore > simple steps s

Re: problem with whitespace not splitting on split.

2006-04-27 Thread Dr.Ruud
"Ryan Frantz" schreef: > The choice of munging the reply-to is left up to the list manager, > really, and (hopefully) is determined by the type/flow of traffic on > the list. In some cases, it makes sense to set the reply-to, in > others, not. Some clients (and servers) support the Mail-Reply-To

RE: problem with whitespace not splitting on split.

2006-04-27 Thread Ryan Frantz
> -Original Message- > From: Chad Perrin [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 27, 2006 6:14 PM > To: beginners@perl.org > Subject: Re: problem with whitespace not splitting on split. > > On Thu, Apr 27, 2006 at 08:42:51AM -0500, Rance Hall wrote: >

Re: problem with whitespace not splitting on split.

2006-04-27 Thread Chad Perrin
On Thu, Apr 27, 2006 at 08:42:51AM -0500, Rance Hall wrote: > > some mail readers are probably capable of reading the list header and > figuring it out, but I bet others don't (like mine) I use Mutt, which allows me to list-reply, but without setting up custom configurations it doesn't use list-

Re: #$ary ??? (was: Re: problem with whitespace not splitting on split. -SOLVED - with followup)

2006-04-27 Thread Jay Savage
On 4/27/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Jay Savage" schreef: > > > for (0..#$arrayname) { print $array[$_] } > > The "#$" should be "$#" and you have two different array names there > that I assume you meant equal. Not enough coffee this morning, I guess, but the point was to illustr

#$ary ??? (was: Re: problem with whitespace not splitting on split. -SOLVED - with followup)

2006-04-27 Thread Dr.Ruud
"Jay Savage" schreef: > for (0..#$arrayname) { print $array[$_] } The "#$" should be "$#" and you have two different array names there that I assume you meant equal. Alternative 1: print $ary[$_] for $[ .. $#ary; Alternative 2: print for @ary; -- Affijn, Ruud "Gewoon is een tijge

array element count (was: Re: problem with whitespace not splitting on split. -SOLVED - with followup)

2006-04-27 Thread Dr.Ruud
Rance Hall schreef: > I was printing the array in debug mode, but not in a way that would > indicate that the values where in separate elements. { local ($", $\) = ("\n", "\n"); print "@ary"; } > I was also printing the "count" of array elements and that apparently > is also wrong, I wa

Re: problem with whitespace not splitting on split. -SOLVED - with followup

2006-04-27 Thread Jay Savage
On 4/27/06, Rance Hall <[EMAIL PROTECTED]> wrote: [snip] > just to let everyone know, (I thought I had done this already but with > the list reply stuff I messed that up) > > The problem is fixed, my split was correct, but my test to see if my > split was correct was wrong Glad you got it worked o

Re: problem with whitespace not splitting on split. -SOLVED - with followup

2006-04-27 Thread Rance Hall
Timothy Johnson wrote: The confusion comes from the poor wording of the perldoc. "As a special case, specifying a PATTERN of space (' ') will split on white space just as "split" with no arguments does. Thus, "split(' ')" can be used to emulate awk's default behavior, whereas "split(/ /)"

Re: problem with whitespace not splitting on split.

2006-04-27 Thread Rance Hall
Chad Perrin wrote: On Wed, Apr 26, 2006 at 03:22:16PM -0500, Rance Hall wrote: I'm working on a new perl script thats giving me fits. [snip] I just sent a lengthy reply to this that was supposed to go to the list, but accidentally sent it to the individual. I don't care to try to reconstru

[OT] list-reply (was: Re: problem with whitespace not splitting on split.)

2006-04-26 Thread Dr.Ruud
Chad Perrin schreef: > Dr.Ruud: >> Chad Perrin: >>> Is there a particular reason this list uses list-reply, with reply >>> defaulting only to the individual? >> >> I use a usenet-interface, and that doesn't have this 'problem'. >> news://nntp.perl.org/perl.beginners > > I don't (and don't really

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Chad Perrin
On Thu, Apr 27, 2006 at 01:35:07AM +0200, Dr.Ruud wrote: > Chad Perrin schreef: > > > Is there a particular reason this list uses list-reply, with reply > > defaulting only to the individual? > > I use a usenet-interface, and that doesn't have this 'problem'. > news://nntp.perl.org/perl.beginne

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Dr.Ruud
Chad Perrin schreef: > Is there a particular reason this list uses list-reply, with reply > defaulting only to the individual? I use a usenet-interface, and that doesn't have this 'problem'. news://nntp.perl.org/perl.beginners -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Chad Perrin
On Wed, Apr 26, 2006 at 03:22:16PM -0500, Rance Hall wrote: > I'm working on a new perl script thats giving me fits. [snip] I just sent a lengthy reply to this that was supposed to go to the list, but accidentally sent it to the individual. I don't care to try to reconstruct it. It probably doe

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
>The confusion comes from the poor wording of the perldoc. > > "As a special case, specifying a PATTERN of space (' ') will >split on white space just as "split" with no arguments does. >Thus, "split(' ')" can be used to emulate awk's default >behavior, whereas "split(/ /)" will give

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Dr.Ruud
Mr. Shawn H. Corey schreef: > Rance Hall: >> @domain = split(' ',$domainlist); > > @domain = split /\s+/, $domainlist; > > It's not splitting on whitespace since you are telling it to split on > a single space character (ASCII 0x20). perldoc -f split: &

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Dr.Ruud
"Adriano Ferreira" schreef: > Rance Hall: >> @domain = split(' ',$domainlist); > > This usage of split only splits at spaces. perldoc -f split: "As a special case, specifying a PATTERN of space (' ') will split on white space just as "split" with no arguments does." -- Affijn, Ruud "Gewoon is

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
>-Original Message- >From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] >Sent: Wednesday, April 26, 2006 1:32 PM >To: Rance Hall >Cc: beginners@perl.org >Subject: Re: problem with whitespace not splitting on split. > >On Wed, 2006-26-04 at 15:22 -0500, Rance Hall

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Charles K. Clarkson
Mr. Shawn H. Corey wrote: : On Wed, 2006-26-04 at 15:22 -0500, Rance Hall wrote: : : @domain = split /\s+/, $domainlist; : : It's not splitting on whitespace since you are telling it to : split on a single space character (ASCII 0x20). I thought a single space character was white

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Tom Phoenix
On 4/26/06, Rance Hall <[EMAIL PROTECTED]> wrote: > @domain = split(' ',$domainlist); > $domainlist = "test.domain.com\n\ntest2.domain.com\n\n" > @domain becomes "test.domain.comtest2.domain.com" with > just one element. Could there be some other character in $domainlist? When I use "\n" as you

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Mr. Shawn H. Corey
; > > what should have happened was that if there was any whitespace in the > file (including new lines, and such) thats where the split would have > occurred @domain = split /\s+/, $domainlist; It's not splitting on whitespace since you are telling it to split on a single

RE: problem with whitespace not splitting on split.

2006-04-26 Thread Timothy Johnson
What happens if you are more specific? @domain = split(/\w/,$domainlist); -Original Message- From: Rance Hall [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 26, 2006 1:22 PM To: beginners@perl.org Subject: problem with whitespace not splitting on split. I'm working on a new

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Adriano Ferreira
On 4/26/06, Rance Hall <[EMAIL PROTECTED]> wrote: > @domain = split(' ',$domainlist); This usage of split only splits at spaces. For example, if $domaintlist contains 'a b c', you will get ('a', 'b', 'c'). It has nothing to do with other kinds of spaces. If you meant @domain = split /\s+/, $doma

problem with whitespace not splitting on split.

2006-04-26 Thread Rance Hall
I'm working on a new perl script thats giving me fits. Ive never quite seen anything like this. here is the command that is not giving me the results I want. @domain = split(' ',$domainlist); what should have happened was that if there was any whitespace in the file (including new lines, and

RE: Splitting on white space

2006-03-15 Thread John Bruin
Thanks very much - I has completely missed whitespace before the slash. John > -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED] > Sent: 16 March 2006 14:41 > To: John Bruin; beginners@perl.org > Subject: RE: Splitting on white space > > > I

Re: Splitting on white space

2006-03-15 Thread Tom Phoenix
On 3/15/06, John Bruin <[EMAIL PROTECTED]> wrote: > my $string = 'one two threefour'; > my @temp = split(/ \s{1,}/,$string); Your pattern matches a space followed by one or more whitespace characters (such as tab, space, or newline). There's just a single space between "two" and "three", an

RE: Splitting on white space

2006-03-15 Thread Timothy Johnson
It isn't splitting on the 'two three' because it doesn't match. / \s{1,}/ matches a space followed by one or more whitespace characters (you have a space in front of your \s) -Original Message- From: John Bruin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March

Splitting on white space

2006-03-15 Thread John Bruin
Hi everyone Can anyone please tell me why the code below is not splitting the 'two three'? If I use '\s*' instead of 's{1,}' it works but I would have thought the code below would have been more precise. my $string = 'one two threefour'; my @temp = split(/ \s{1,}/,$string); my $count_tem

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:48 PM skrev Tommy Nordgren: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" -- To unsubscribe,

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > > This is my full script: > #!/usr/bin/perl > use strict; > use warnings; > > if ( @ARGV !=2) { > die "Usage: nibfixup Nibfile Applicationname\n" ; > } > > my $nibfile = $ARGV[0]; > my $appname = $ARGV[1]; > > print "Running nibtool\n"; > my $dictionary = `/usr/bin/n

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:55 PM skrev Wagner, David --- Senior Programmer Analyst --- WGO: Tommy Nordgren wrote: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work "Home is not where you are born, but where your heart finds peace

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > > Sep 21, 2005 kl. 9:54 PM skrev John W. Krahn: > >> Tommy Nordgren wrote: >> >>> How do you split a string on the equality character? >>> Neither split (/=/,$myvar) >>> nor split ('=',$myvar) >>> appears to work >> >> How does it not work? > > When called with the sy

RE: Splitting on =

2005-09-21 Thread Bakken, Luke
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work > "Home is not where you are born, but where your heart finds peace" - > Tommy Nordgren, "The dying old crone" You are doing something incorrectly.

Re: Splitting on =

2005-09-21 Thread Jeff 'japhy' Pinyan
On Sep 21, Tommy Nordgren said: When called with the syntax I've used, it returns a list containing a single string. I'll try without the paranthesis. Can it be that perl treats the entire source text between left and right paranthesis as a regular expression. If so, I consider this a bug.

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:54 PM skrev John W. Krahn: Tommy Nordgren wrote: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work How does it not work? When called with the syntax I've used, it returns a list containing a si

RE: Splitting on =

2005-09-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work > "Home is not where you are born, but where your heart finds peace" - > Tommy Nordgren, "The dying old crone" Really need the context of wha

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work How does it not work? It works for me. $ perl -le' print for split /=/, "one=two" ' one two John -- use Perl; program fulfillment -- To unsu

Splitting on =

2005-09-21 Thread Tommy Nordgren
How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: problem with splitting on "words"

2004-07-30 Thread John W. Krahn
Charlotte Hee wrote: On Fri, 30 Jul 2004, Bob Showalter wrote: OK. Instead of using split, why not capture the tokens you're interested in. Something like: for my $w ($title =~ /([A-Za-z]+[^A-Za-z\s]*)\s*/g) { Let me see if I understand this expression: [snip] \s*/g This matches a blank space z

RE: problem with splitting on "words"

2004-07-30 Thread Bob Showalter
Charlotte Hee wrote: > On Fri, 30 Jul 2004, Bob Showalter wrote: > > for my $w ($title =~ /([A-Za-z]+[^A-Za-z\s]*)\s*/g) { > > > > That's amazing! Yes, that works. > > Let me see if I understand this expression: > /([A-Za-z]+ > This matches any letter, uppercase or lowercase, 1 or more times

RE: problem with splitting on "words"

2004-07-30 Thread Charlotte Hee
On Fri, 30 Jul 2004, Bob Showalter wrote: > Date: Fri, 30 Jul 2004 13:52:57 -0400 > From: Bob Showalter <[EMAIL PROTECTED]> > To: 'Charlotte Hee' <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: RE: problem with splitting on "words" > &g

RE: problem with splitting on "words"

2004-07-30 Thread Bob Showalter
Charlotte Hee wrote: > Hi Bob, > > In one of my tests I added the '>' to the character class [^\w->] but > I still didn't get 'B0->'. I'm guessing it's because that looks like a range. Using [^\w\->] should work. > I've just learned about character classes > so I am trying to get a better handl

RE: problem with splitting on "words"

2004-07-30 Thread Charlotte Hee
;K- and I would consider 'B0->' a word and 'K-' another word. thanks for the quick repy. Chee On Fri, 30 Jul 2004, Bob Showalter wrote: > Date: Fri, 30 Jul 2004 13:29:54 -0400 > From: Bob Showalter <[EMAIL PROTECTED]> > To: 'Charlotte Hee&#x

RE: problem with splitting on "words"

2004-07-30 Thread Bob Showalter
# should be 'B0->' > Journal 4 indexed word = K0s > Journal 4 indexed word = Pi0 > Journal 4 indexed word = Decays > > These are only example titles but the other titles have similar > characters in them as part of a "word". I tried adding the '-' an

problem with splitting on "words"

2004-07-30 Thread Charlotte Hee
Hello All, I am having trouble splitting words from titles from a list of research papers. I thought I could split the title into words like so: #!/usr/local/bin/perl use locale; %forums = ( 1 => 'B0->K+K-Ks', 2 => 'B+->K+KsKs Decays', 3 => 'Measurement of the

Re: splitting on \t

2001-07-01 Thread Brett W. McCoy
est = $entry[1]; > } > } > close FH; > > i am not certain why, but when i run this script, it doesnt seem to be > splitting a line on the \t character, rather it just feeds me the entire > line back as $entry[0]. Because you are not splitting on the \t character, you are

splitting on \t

2001-07-01 Thread charles
open FH, $virt or die "Cant open virtuser file $!\n"; while () { $each = $_; chomp $each; @entry = split /\/t/, $each; print "$entry[0]\n"; if ( $entry[0] eq $name ) { $dest = $entry[1]; } } close FH; i am not certain why, but when i run this script, it doesnt seem to be splittin