Hi, I have problem of filtering a log file from my perl script.

This is the file content of the file pinpe.csv:
2009-06-16
2009-01-29
2009-06-02
2008-03-05
2007-08-05

Here is my perl code.
use Net::Telnet; @DATE=$telnet->cmd("date '+%Y-%m-%d'"); chomp($DATE[0]); @Discon=$telnet->cmd("cat /data/pinpe.csv | nawk '{print \$4}' | perl +-ne 'print if \$_ lt $DATE[0]'"); chomp($Discon[0]); print "@Discon[0]\n";
and this is the output error:
Illegal octal digit '8' at -e line 1, at end of line
Now my dilemma is I want to filter this ouput by my preferred dates. I wanted it to output the date from yesterday and backwards. In other words I want to filter all the dates less than today's date (i.e. 2007-07-30, 2007-07-29, 2007-07-28, etc. and below). Tnx in advance. :) Was it perl thought that I was dealing with an octal number and when he came along with 8 which stopped it from making any sense, so perl quite rightly complained? Pls help. Tnx.

Br, Pete

In reply to extract a log file to filter previous dates by pinpe

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.