From alaricravenhall at hotmail.com Mon Apr 16 17:12:53 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Hello. Message-ID: I am new to Perl and mongering in general. I joined this list to learn more about this fun language. I hope to be able to work extensively with perl, and am interested in any meetings this group may ever have. Alaric _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From jl at boers.cc Mon Apr 16 17:23:07 2001 From: jl at boers.cc (J-L Boers) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Hello. In-Reply-To: Message-ID: Welcome aboard! J-L -----Original Message----- From: owner-memphis-pm-list@pm.org [mailto:owner-memphis-pm-list@pm.org]On Behalf Of Alaric Ravenhall Sent: Monday, April 16, 2001 5:13 PM To: memphis-pm-list@pm.org Subject: [Memphis.pm] Hello. I am new to Perl and mongering in general. I joined this list to learn more about this fun language. I hope to be able to work extensively with perl, and am interested in any meetings this group may ever have. Alaric _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Mon Apr 16 23:08:56 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Regexes, finding a
tag and throwing into arrays. Message-ID: Hi all. Can anyone tell me of an easy way to take a string of text, parsing by a
tag at the end each word, and put it into an array? I will have something similar to this: Ravenhall
Nemesis
Thulsa
Imoen
Tweedledum
Tweedledee
I want to INCLUDE the
tag in the array thusly: @names = {"Ravenhall
","Nemesis
","Thulsa
","Imoen
","Tweedledum
","Tweedledum
"} Forgive the crappy formatting, I DO use better syntax in my code than in email. I am thinking I need to use m// - but prolly use like m# to use hashes for delimiters. Anyway, any help you could provide would be .. well.. helpful. Also, it'd be keen to know how to refer to the elements in the array - I'm guessing I can do @names[1] type stuff. I really dig the $names = @names to count the scalars in the array. Sorry if my question is simple, I only know how this language works from manpages and PODs. Thanx, Ravenhall _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Tue Apr 17 07:13:09 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Regexes, finding a
tag and throwing into arrays. In-Reply-To: ; from alaricravenhall@hotmail.com on Mon, Apr 16, 2001 at 11:08:56PM -0500 References: Message-ID: <20010417071309.B3988@harmless.yellowsnow.org> * Alaric Ravenhall [010417 06:52]: > Hi all. > Can anyone tell me of an easy way to take a string of text, parsing by a >
tag at the end each word, and put it into an array? > I will have something similar to this: > > Ravenhall
Nemesis
Thulsa
Imoen
Tweedledum
Tweedledee
> > I want to INCLUDE the
tag in the array thusly: > > > @names = > {"Ravenhall
","Nemesis
","Thulsa
","Imoen
","Tweedledum
","Tweedledum
"} foreach ($string =~ m/(.+?
)/gi) { push @names, $_; } I'm sure there's a more elegant way, but this @names = $string =~ m/(.+?
/gi/; doesn't seem to create the list context for m//g. I'm not sure why. -- Brock Sides philarete@mindspring.com The original plan [for GNOME] was to aim to make a desktop as good as the Macintosh, and we should not lower our ambition by making one merely as good as Windows. -- RMS ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From HPhillips at harrahs.com Tue Apr 17 08:08:41 2001 From: HPhillips at harrahs.com (Hal Phillips) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Regexes, finding a
tag and throwing into arrays. Message-ID: <73DF33FD2646DA4F8F83E5F5CE3F36257D2E4F@memex1.harrahs.org> >From my buddy Steve, who I'm encouraging to join the list... -Hal >> This works for me. Send it on to Brock if you would please. #!/usr/bin/perl while( ) { @names = map { /(.+?
)/gi } $_; print( join( "\n", @names ), "\n" ); } __DATA__ foo1
foo2
foo3
foo4
-----Original Message----- From: Hal Phillips Sent: Tuesday, April 17, 2001 7:49 AM To: Steve Turman Subject: FW: [Memphis.pm] Regexes, finding a
tag and throwing into arrays. Hey Man, are you on the perl monger's list? We should start some conversations on there. -hp -----Original Message----- From: Brock Sides [SMTP:philarete@mindspring.com] Sent: Tuesday, April 17, 2001 7:13 AM To: memphis-pm-list@pm.org Subject: Re: [Memphis.pm] Regexes, finding a
tag and throwing into arrays. * Alaric Ravenhall [010417 06:52]: > Hi all. > Can anyone tell me of an easy way to take a string of text, parsing by a >
tag at the end each word, and put it into an array? > I will have something similar to this: > > Ravenhall
Nemesis
Thulsa
Imoen
Tweedledum
Tweedledee
> > I want to INCLUDE the
tag in the array thusly: > > > @names = > {"Ravenhall
","Nemesis
","Thulsa
","Imoen
","Tweedledum
" ,"Tweedledum
"} foreach ($string =~ m/(.+?
)/gi) { push @names, $_; } I'm sure there's a more elegant way, but this @names = $string =~ m/(.+?
/gi/; doesn't seem to create the list context for m//g. I'm not sure why. -- Brock Sides philarete@mindspring.com The original plan [for GNOME] was to aim to make a desktop as good as the Macintosh, and we should not lower our ambition by making one merely as good as Windows. -- RMS ------------------------------------------------------------------------ ---- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ------------------------------------------------------------------------ ---- ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From JBullard at email.usps.gov Tue Apr 17 11:04:59 2001 From: JBullard at email.usps.gov (James Bullard) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Hello. Message-ID: <0033000021730953000002L032*@MHS> Welcome aboard, Alaric! I'm still very much a Perl newbie myself, but some of the stuff I've seen and done with Perl amazes me when I compare it to other languages I've worked with, and I know that I've barely scratched the surface. If you haven't looked into them already, I strongly recommend O'Reilly's "Learning Perl" and "Programming Perl" books. They have another one, "The Perl Cookbook" I believe, but I haven't acquired it yet so I can't make an informed recommendation on that one. Take care, and welcome aboard! Clif ______________________________ Reply Separator _________________________________ Subject: [Memphis.pm] Hello. Author: owner-memphis-pm-list@gocho.pm.org at INTERNET Date: 4/16/01 6:33 PM I am new to Perl and mongering in general. I joined this list to learn more about this fun language. I hope to be able to work extensively with perl, and am interested in any meetings this group may ever have. Alaric _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Tue Apr 17 22:14:31 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:16 2004 Subject: [Memphis.pm] Thanks for the help and welcomes! Message-ID: The subject of this mail really says it all, but I'll say again, "Thanks!" I am going to test out the suggestions tonight and see what happens ;) I'm building a cgi script that uses the Net:Telnet () module to telnet to a port on the same machine, where I have set up a little service from my MUD (an online text based roleplaying game, think of Zork) to give me nicely formatted listings of who is on at the time. I'm EVENTUALLY going to use Perl to fetch messages from the in-game message boards, format them into HTML, and make a cool message board for our web page. I really enjoy this language. I'll keep everyone updated on my (probably slow) progress. Alaric _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ----------------------------------------------------------------------------