[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Parsing astronomical data in Perl



At 21.30 -0500 1998.12.21, Brian McNett wrote:
>One question:  Perviously I was doing an unshift() to prepend a 0th
>element for each record.  Is this now unnecessary?  I don't want to drop
>the first letter of the first field. (I realize this question sounds
>rather clueless, but programming of all stripes is more of a sideline for
>me.  I occasionally still sound like a cluelessnewbie).

It's up to you how you want to deal with it.  Right now it is something like:

   $data = substr($line, $arr[0], $arr[1]-$arr[0]);

You could do:

   $data = substr($line, $arr[0]-1, $arr[1]-$arr[0]);

Then where you signify the first character as 1, this line will subtract 1
for you and make it the actual position 0, which is what you want.  Or you
could mess with $[, but as perlfunc says, "don't do that".  :)

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch