--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote: > Stuart White wrote: <snip>
> I don't think so: > ...<snip> > The only place a colon split splits is where you > have a colon. > That was MY typo. Oops. In the book there is a colon after merlyn, not a question mark. Irrespective of that, I was still trying to figure how that worked with split and why my example wasn't. I'm reasonably sure that I've figured that out now though. > > > These first two make sense, pretty much. I > think > > > this is one place where $team1 > > > and $team2 might be more sensible, though it is > even > > > better, if there is some > > > order to which team is listed first in the > pairing, > > > to have you identifier > > > reflect that order, say $home_team and $visitor > [if > > > these are accurate of > > > course] > I looked at the data, and it is consistent. Then I tried this, and it didn't exactly do what I wanted. While the home team is always listed first in that line, the first line of action is not always the home team. So while I imagine knowing the home and visiting team will be useful down the road, it didn't satisfy my immediate need. Plus, there really is two teams that I needed: the nicknames (Spurs Suns) and the abbreviations, (SAN, PHX). the nicknames I wanted, at this point, for just a test: Spurs roster: blah blah blah, Suns roster: blah blah blah. So that I wouldn't have to hardcode "Spurs roster." I think that since the nicknames and the abbreviations have a relationship that a hash can represent, I might just hardcode that because it might make something else in the future easier...I can't see how to tell the program otherwise that they are related without writing: %AbbrevAndNicknames = ("SAN", "Spurs", "PHX", "Suns"); #and so on and so forth (I think i might have went on a tangent here, apologies if this doesn't make sense.) > ...or you could even use $team_left and $team_right, > since those terms would > accurately describe the relative positions of the > two substrings within each > line. > that would work too, but since I know home team is left and visitor is right, perhaps I put team_left and team_right in the comments. Good idea though. <snip> > > > > Ok, I didn't know this. I thought I could, and > should > > do it all in one or two lines. I get confused > about > > what data $_ has sometimes. > > This is a very good indicator that you should be > using the default $_ less and > named variables more. It all may look the same to > the compiler, but since human > error is the most likely cause of problems, it is > more important to be as > understandable as possible to the human reader. Agreed. I started with my own variables, but I had a buddy helping me, and he thought should just use $_. He said I'd get used to it and figure it out. So I just continued using $_. But you are right though, and I think I'll at least have the first editions of my programs with my own variables. <snip> > > I must confess that I am a bit at a loss as to what > to do with the information > at this point. I have forgotten what your goal is > in terms of the form of > output information you want. Presumably, you should > have some structure ready > to receive the information extracted here, so you > can assign the value extracted > to those structures. > No problem. I sort of addressed it in response to your following reply. Your presumption is correct, that is the plan. > > > Please review > Are you on Windows, with ActiveState? If so: > Start|Programs|ActiveState ActivePerl > 5.8|Documentation > will get you going. Yes, I am. I'll try that. Thanks. __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>