Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Path::Tiny paths require defined, positive-length parts

by Old_Gray_Bear (Bishop)
on Jun 19, 2014 at 01:49 UTC ( [id://1090376]=note: print w/replies, xml ) Need Help??


in reply to Path::Tiny paths require defined, positive-length parts

Line 30 reads sub append_today {. Please post the code that you actually are running when you get the error.

Nota Bene:

Main( @ARGV ); Main( "C:\\TEMP\\DAILY.csv", "C:\\TEMP\\MONTHLY.csv" );
Does not do what you probably think it does. See the documentation on subroutine prototypes.

UPDATE

After your update to your code, line 30 is now  my $fh = path( $infile )->openr_raw;. Much more reasonable.

So, why is $infile empty? You might try printing @_ before and after line 18, and before line 28. Or just fire up the Perl Debugger (perl -d insert_my_code_here) and step through the code.

UPDATE^2

Stepping through the code with the debugger is most enlightening. You call the main() routine twice. What happens if there are no command-line arguments?

----
I Go Back to Sleep, Now.

OGB

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1090376]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found