UPDATE: s/single quotes/backticks/ and oops, chdir is a perl func... /me face red

Hey,

That error message is telling you "missing semicolon on previous line". So if you go to line 13, then back up one line you find the problem line:

12:--> "chdir $toloc or dir qq(can't chdir $toloc $!\n);" 13: my $result = `/usr/bin/tar -xvpf $test`;
You don't have a semicolon at the end of that line. You've got a quoted string ("chdir... );") with no semicolon.

Also, you've misspelled die as "dir". You want something like:

chdir $toloc or die qq(can't chdir $toloc $!\n);

Hope this helps you the next time you have perl complaining about some error--now you know how to find more-or-less where your error is.

AH

p.s. I'll let someone else give the standard use strict and warnings speech.

----------
Using perl 5.8.6 unless otherwise noted. Apache/2.0.54 unless otherwise noted. Fedora Core 4 (2.6.11-1.1369_FC4) unless otherwise noted.

In reply to Re: What is wrong with tar? by alienhuman
in thread What is wrong with tar? by ckaspar

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.