I have the following script in my cgi-bin to unzip a file named "-ubl.zip" to a directory 'LeagueSite'. HERE IS THE SCRIPT ON MY SPACE:
#!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); my $Verzeichnis = "/home/wwwubl/public_html/LeagueSite/"; my $zipfile = $Verzeichnis . "_ubl.zip"; if (-e $zipfile) { $r = system("unzip -o -q -C $zipfile -d $Verzeichnis"); if ($r==0) { print "Success!\n"; unlink($zipfile); } else { print "Error " . $r . "\n"; } }
When I call this script, I get the following error: Software error: Global symbol "$r" requires explicit package name at unzipfiles.cgi line 10. Global symbol "$r" requires explicit package name at unzipfiles.cgi line 11. Global symbol "$r" requires explicit package name at unzipfiles.cgi line 16. Execution of unzipfiles.cgi aborted due to compilation errors. What do I have configured incorrectly in this script to make it do what I want it to do. This zipped file is put up three times weekly and is 3Megs in size. It is always named _ubl.zip and it always needs to unzip to my LeagueSite directory. My email is volunteer1967@hotmail.com and I will check back on this site as well. Thanks in advance, Mark Cooley

In reply to Script to unzip a zip file on the server...... by Anonymous Monk

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.