Re: Printing all elements of an Array except the first?

2002-05-31 Thread Jeff 'japhy' Pinyan
On May 31, Jonathan E. Paton said: --- Ned Cunningham [EMAIL PROTECTED] wrote: Snip I want to write to a file all of the array(@data), except the first field @data[1..-1] means the array @data from element 1 to the last element. Sadly, Perl does not support that syntax. Ranges must

Re: Printing all elements of an Array except the first?

2002-05-31 Thread David T-G
Jonathan, et al -- ...and then Jonathan E. Paton said... % % --- Ned Cunningham [EMAIL PROTECTED] wrote: Snip % ... % @data = split(/\|/,$line); % $newnum=$newnum+1; % printf WRFILE (0%9d,$newnum); % % print WRFILE ;, @data, ;; ... % % I want to write to a file all of the

RE: Printing all elements of an Array except the first?

2002-05-31 Thread Ned Cunningham
beginners Cc: Jonathan E. Paton Subject:Re: Printing all elements of an Array except the first? Jonathan, et al -- ...and then Jonathan E. Paton said... % % --- Ned Cunningham [EMAIL PROTECTED

Re: Printing all elements of an Array except the first?

2002-05-31 Thread David T-G
Ned -- ...and then Ned Cunningham said... % % Great, % Now how about sorting on the new first element of the array each time I % step through a file??? How about a little more detail? I'm not sure quite what you mean by new; you top-posted instead of providing any contextual reference. Given

Re: Printing all elements of an Array except the first?

2002-05-31 Thread Jonathan E. Paton
I want to write to a file all of the array(@data), except the first field @data[1..-1] means the array @data from element 1 to the last element. Sadly, Perl does not support that syntax. Ranges must be low..high. @foo[1..-1] doesn't work. Jonathan throttles the camel

RE: Printing all elements of an Array except the first?

2002-05-31 Thread Ned Cunningham
:Re: Printing all elements of an Array except the first? Ned -- ...and then Ned Cunningham said... % % Great, % Now how about sorting on the new first element of the array each time I % step through

RE: Printing all elements of an Array except the first?

2002-05-31 Thread Shishir K. Singh
element. Any better ideas friends?? -Original Message- From: Ned Cunningham [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 11:27 AM To: 'David T-G'; perl beginners Cc: Ned Cunningham Subject: RE: Printing all elements of an Array except the first? OOPS :-( I wanted to sort

Re: Printing all elements of an Array except the first?

2002-05-31 Thread David T-G
Ned -- ...and then Ned Cunningham said... % % OOPS :-( % I wanted to sort the file that I am writing, by the second element in @DATA? OK. You're also writing out a count number, it looks like: % Snip % open CUST, $cust or die Cant open it :$!; % open WRFILE, $wrfile; % % while (defined

RE: Printing all elements of an Array except the first?

2002-05-31 Thread Shishir K. Singh
}}, ;, \n; } } close (WRFILE); __END__ # -Original Message- From: Shishir K. Singh Sent: Friday, May 31, 2002 11:53 AM To: 'Ned Cunningham'; 'David T-G'; perl beginners Subject: RE: Printing all elements of an Array except the first