#!/usr/bin/perl -w # ## Copyright (c) 2007 # my $pkgdoc = <<'EOD'; #/**------------------------------------------------------------------ +-------------- # @ file radiosondeparcer.pl # This scirpt parces the fetched radiosonde data from # the plymoth website. # # @project Kat # @ussage radiosondeparcer.pl ddd.hh.yyyy.index.txt # date: Jan 18, 2007 #--------------------------------------------------------------------- +-------------*/ EOD # $Log$ use strict; use warnings; use Getopt::Long; if (@ARGV <1) { print $pkgdoc; exit -1; } my $txtfile = shift; my $lat; my $long; open (DATA, $txtfile)||die "cannot open $txtfile for reading"; # First seek location line while (<DATA>) { next unless /(-?\d+(?:\.\d*)?)\s+ (-?\d+(?:\.\d*)?)\s+ \d+\s \d+/ +x; ($lat, $long) = ($1, $2); last; } # print "$lat, $long\n"; # Skip to data lines while (<DATA>) {last if /^-+$/}; while (<DATA>) {last if /^-+$/}; open (OUT, ">$txtfile.redo"); # Skip to data lines to get scf data while (<DATA>) { my ($LEV, $PRES, $HGHT, $TEMP, $DEWP, $RH, $DD, $WETB, $DIR, $SP +D, $THETA, $THEV, $THEW) = split ' '; next DATA if ($LEV =~ /0/); if ($LEV && $LEV =~ /SFC/) { last unless defined $SPD; print OUT "$lat $long $PRES $HGHT $TEMP $DEWP $D +IR $SPD\n"; } if ($PRES && $PRES =~ /850|500|250/) { last unless defined $SPD; print OUT "$lat $long $PRES $HGHT $TEMP $DEWP $D +IR $SPD\n"; } last unless defined $THEW; } close (DATA); close (OUT);
Now how do i make the program skip to the next line and conduct the rest of itself when $LEV = 0

In reply to Trying to skip for $LEV = 0 by MKevin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.