in reply to Extracting coordinates

while (<LIST>) { $filename1 = <LIST>;

This discards every other line line in the file; is that really what you want? if not, you have an easier time writing

while $filename1 (<LIST>) { # removing trailing newline on $filename1: chomp $filename1; ... }

Also I don't understand why you need such a complicated regex - using split on whitespace seems much easier to me.

All in all I have a hard time following your code - if you gave a verbal description of what it should actually do, it would be easier to help you.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Extracting coordinates
by Ignas (Novice) on Mar 20, 2010 at 23:51 UTC
    DER-71-14/05.16 4930.2800 -6590.5100 0.0000 ----------------^^^^^^^^^-^^^^^^^^^^---

    I need to take these parts and put them into a database side by side (SQL). Sorry for the messy code, I've no idea how else I could do this (no previous programming experience, no knowledge).

    I'd also like to have it done as fast as it can be done, that's why I tried to do such a regex. It would be best to do everything in one load (that is, calculate the 15 GB just once).

    Thanks

      my ($identifier, $coord1, $coord2) = split /\s+/, $line; # then you have $coord1 = '4930.2800', $coord2 = '-6590.5100'