The warning that you comment is due to:

$delay_ATO_CTO_min = "";

After that assignment you try to use $delay_ATO_CTO_min as a number:

if ($delay_ATO_CTO_min > 10){

Nevertheless, the script you posted doesn't seem to parse the input file you provided (the fields in the input file are not separated by ";", you don't check for "empty" lines (e.g. lines with only the time), etc...). Here is a version of your script with some of these problems corrected:

use strict; use warnings; while (<DATA>){ chomp($_); my ($aircraft_id,$ATO,$ATO_min,$CTO,$CTO_min) = (split /\s+/)[1,2,3, +4,5]; next if (!defined $ATO); my $delay_ATO_CTO_min = 0; if ((defined $CTO && $CTO =~ /\d\d:\d\d/) && (defined $ATO && $ATO +=~/\d\d:\d\d/)){ $delay_ATO_CTO_min = $CTO_min-$ATO_min; } my $flight_big_delay; # condition on the delay if ($delay_ATO_CTO_min > 10){ $flight_big_delay = $aircraft_id; print "$aircraft_id;$ATO_min;$CTO_min;$delay_ATO_CTO_min;$flight_b +ig_delay\n"; } else{ print "$aircraft_id;$ATO_min;$CTO_min;$delay_ATO_CTO_min\n"; } } __DATA__ 08:48:45 08:49:43 DAL11 08:47 527 08:50 530 08:50:41 08:51:40 08:52:38 08:53:36 ACA87 08:51 531 08:53 533 08:54:35 08:55:33 SHT8K 08:48 528 08:55 535 08:56:31 08:57:30 DLH9F 08:53 533 08:57 537

Outputs:

DAL11;527;530;3 ACA87;531;533;2 SHT8K;528;535;7 DLH9F;533;537;4

citromatik


In reply to Re: warnings unexpecetd by citromatik
in thread warnings unexpecetd by steph_bow

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.