After all, I thought the name of this group was Perl BEGINNERS...

-----Original Message-----
From: Michelle Rogers [mailto:[EMAIL PROTECTED]
Sent: Monday, June 28, 2004 10:33 AM
To: James Edward Gray II; Naser Ali
Cc: Perl Beginners
Subject: Re: string seperated by multiple spaces


wow..somebody woke up on the wrong side of bed, this morning...
shesh...
Michelle Rogers
----- Original Message ----- 
From: "James Edward Gray II" <[EMAIL PROTECTED]>
To: "Naser Ali" <[EMAIL PROTECTED]>
Cc: "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Monday, June 28, 2004 12:28 PM
Subject: Re: string seperated by multiple spaces


> On Jun 28, 2004, at 11:15 AM, Naser Ali wrote:
>
> > Below is the actual code. This is just the preliminary code to test the
> > logic, it is not final yet, therefore, I am not using "Warnings",
> > "Strict"
> > or for that matter anything else.
>
> It's easy to make excuses, harder to do the right thing.  Help us help
> you.  I've seen enough of your posts, these lessons should be learned
> by now.  You START with warnings and strict, when they can help you
> most.
>
> I bet you would be getting warnings right now, if only you would turn
> them on.  Then, if you followed them, you might just solve your own
> problem.
>
> > Also I am slurrping the whole file, and I know I do not have to, but
> > alternate ways, I ll decide later.
>
> Why?  Why code it twice?  Two different techniques.  Just use the right
> one, and stop hindering your own growth as a programmer.
>
> > ----------------------------------------------------------------------- 
> > --
> > open(TFILE, "file.txt");
>
> ... or die "..."; # MUST test success
>
> > @first=<TFILE>;
>
> Not needed, and you know it.
>
> > close (TFILE);
> >
> >
> > for ($i=0; $i <= $#first; $i++) {
>
> In Perl, we write that:
>
> for my $i (0..$#first) {
>
> Of course, you aren't even using indexes, so better is:
>
> foreach (@first) {
>
> >   $Avg=$first[$i];
>
> Why?
>
> >           chomp($Avg);
> >           ($label,$TD,$YT,$M,$L,$Y,$W)= split (/\s+/,$Avg);
>
> ... split ' ', $Avg;
>
> If it's not working, $Avg doesn't contain what you think it does.  Add
> a print statement before to prove it.
>
> >            print "$label,$TD,$YT,$M,$L,$Y,$W\n";
> > }
>
> James
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to