Re: Terrible at my logic - some more inputs

2002-10-25 Thread Sisyphus

- Original Message - 
From: Krishna, Hari [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 26, 2002 12:37 AM
Subject: Terrible at my logic - some more inputs


 forgot to include the print statement
  
 print OUTPT $ln54_1 $ln54_2 $ln54_3 $ln54_4 $ln54_5 $ln54_6 $ln54_7
 $ln54_8;
  
 Here's somemore inputs:
  
 707 14788 21 414 9 355 8 344 1
 805 4 724 2  781 2 719 41
 788 30781 2  427 31820 8
  
 Here's what my output looks like:
  
 707 14 788 21  414 9  355 8  344 1
 805 4  724 2   781 2  719 4 1
 788 30 781 2   427 3 1820 8
  
 Here's what I am expecting my program to do:
  
 707 14 788 21  414 9 355 8  344 1
 805 4  724 2   781 2 719 41
 788 30 781 2   427 31820 8
  
 Whats up with this??
  
 Thanks a lot for your help.
  
 Regards,
 Hari.

no warnings;
my @string = (707 14788 21 414 9 355 8 344 1,
  805 4 724 2  781 2 719 41,
  788 30781 2  427 31820 8);
for(@string) {
   for(my $i = 0; $i = 42; $i += 6) {
   print substr($_, $i, 6),  ;
   }
print \n;
}

prints:
707 14 788 21  414 9  355 8  344 1
805 4  724 2   781 2  719 4 1
788 30 781 2   427 3 1820 8

I think this is what you also get. Why do you expect something else ?

Cheers,
Rob

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: Terrible at my logic - some more inputs

2002-10-25 Thread csaba . raduly

On 25/10/2002 15:37:16 Krisna, Hari wrote:

forgot  to include the print statement

print  OUTPT $ln54_1 $ln54_2 $ln54_3 $ln54_4 $ln54_5 $ln54_6 $ln54_7
$ln54_8;


change this to:

print  OUTPT
$ln54_1!$ln54_2!$ln54_3!$ln54_4!$ln54_5!$ln54_6!$ln54_7!$ln54_8!;

You separate the columns with spaces and your input also contains spaces,
this makes it difficult to distinguish between the two (is that space from
the input or is it a separator ?). Use the exclamation marks as
eye-catchers; you'll be able to see what's going on.



--
Csaba Ráduly, Software Engineer   Sophos Anti-Virus
email: [EMAIL PROTECTED]http://www.sophos.com
US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs