I've been tasked with implementing Shadow IDS 1.8 into a production environment at my job. I'm a little of a Perl newb, having done a few small things with it, but nobody else knows much about it around here, so I was given the task. Hooray :P
Anyway, there's a piece of one of the scripts that is apparently breaking, or doing something strange (not sure which). The piece of code is this:

my $binip = pack "c4", ($a, $b, $c, $d);

The previous line is this:

my ($a, $b, $c, $d) = split(/\./, $src_ip);

Which is the first line of a foreach loop:

foreach $src_ip (sort by_ip keys(%tgt_sys))

The script is set to dump STDERR to a log file. When this script runs, it seems to run fine, then the log fills up with this message:

Character in "c" format wrapped at /usr/local/shadow/SHADOW-1.8/find_scan.pl line 142, <STDIN> line 5507847.

Line 142 is where the first piece I posted; the line with the pack function in it. I did some checking into the pack function, but what I've learned so far about it doesn't seem to explain what is causing this message to be generated, and honestly, I'm not even sure exactly what it means. I figured out that line 5507847 is the last line of the file that is being streamed into the script, so I'm guessing that for some reason the 'pack' line isn't "handling" it correctly. My supervisor suggested it may be the presence of a newline, so I tried a chomp. But it didn't work; either I put it in the wrong place, or it wasn't the newline.
I need some help.

20040904 Edit by castaway: Changed title from ''pack' errors'


In reply to pack() gives me "character wrapped" warnings by Chris_LSU

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.