Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

G'day RedTussock,

Welcome to the monastery.

I'm reasonably certain that your problem is in map qq/"$_"/, @fields[ 0 .. 5 ] and is probably caused by @fields not containing 6 elements. Here's some troubleshooting hints.

Check the files you're reading (i.e. ls -l /home/Smitty/scripts/perl/dl_parser/down/*). Are all of these the files you want? Perhaps use *.txt (or similar) to limit the files you're processing.

Do all of the files have the format you're expecting? You may be able to check this by inspection. If not, add some debugging code around while (<>) { like this:

my $last_file = ''; while (<>) { print "$ARGV\n" if $ARGV ne $last_file; $last_file = $ARGV;

[perlop - I/O Operators explains <> and $ARGV]

You should see something like:

some_file_name another_file_name Use of uninitialized value in ... different_file_name Use of uninitialized value in ...

You'll now know which files are causing the problems and you can focus your investigation accordingly.

-- Ken


In reply to Re^7: Parsing Data logger files ... by kcott
in thread Parsing Data logger files ... by RedTussock

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-19 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found