I've got a little backup script running on Windows NT in which I call the InfoZIP zip program using the following construction:
system("zip -rq $target $project_root") or die "couldn't exec zip: $!";
The creation of the zip file occurs correctly, but I always get the die message.
I ran the following code as a test and verified that the return value was zero:
$test = system("zip x:\\test.zip x:\\test.txt");
print $test;
I checked the Camel Book, and sure enough, the or die construction executes the die portion if the left side is false. I guess I could be losing my memory, but I thought that normally executing programs return 0 to signify a normal exit. I use the
or die construction all the time.
At any rate, should I go ahead with something like
not system("zip -rq $target $project_root") or die "couldn't exec zip: $!"; or is there something I'm not seeing here.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.