Hi Monks!
At this part of my code

opendir(DIR,$dlist)|| die "Can't open $dlist\n"; my @content=readdir(DIR); foreach my $all_dir(@content){ chomp($all_dir); $all_dir=~s/\n//g; if($all_dir=~m/\w+/g){ my $mod = (stat "$dlist/$all_dir")[9]; print "</b></font>"; print "<input type=\"radio\" name=\"dirtosee\" value=\"$all_ +dir\"><font face='Verdana, Arial, Helvetica, sans-serif' size=\"2\" c +olor=\"#0084a5\"><b> </b></font><font face='Verdana, Arial, Helvetica +, sans-serif' size=\"2\" color=\"#0084a5\"><b>$all_dir</b></font>"; print "&nbsp;&nbsp;&nbsp;<font color=black size=2>as: "; print scalar localtime $mod; if($hide eq "1"){ print "</font>&nbsp;&nbsp;<a href=log_main.pl?flag=$flag&dir +tosee=$dirtosee&flag_to_see=$flag_to_see&filestosee=0&hide=0><font fa +ce='Verdana, Arial, Helvetica, sans-serif' size=\"1\" color=\"#0084a5 +\"><b>Hide Zip</font></a><br>"; }else{ print "</font>&nbsp;&nbsp;<a href=log_main.pl?flag=$flag&dir +tosee=$dirtosee&flag_to_see=$flag_to_see&filestosee=1&hide=1><font fa +ce='Verdana, Arial, Helvetica, sans-serif' size=\"1\" color=\"#0084a5 +\"><b>Show Zip</font></a><br>"; } if($filestosee){ opendir(ZDIR, "$dlist$all_dir") or die $!; while (my $zip_file = readdir(ZDIR)) { #ignore files beginning with a period next if ($zip_file =~ m/^\./); # Get zip files only #next unless (-f "$dlist$all_dir"); # RX to find files ending in .zip next unless ($zip_file =~ m/\.zip$/); print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"check +box\" name=\"ziptosee\" value=\"\"><font face='Verdana, Arial, Helvet +ica, sans-serif' size=\"1\" color=\"#000000\"><b>$zip_file</b></font> +<br>\n"; } closedir(ZDIR); } } } closedir(DIR) or die "Can't close DIR";


It shows all directories found with a radio button in front for each one, but inside of each directory are zip files, could be one or more, my program unzips the files fine. What I am trying to do here is to pass a parameters to only display the zip files from a directory clicked on it, but the way it is now, it is showing for all of them, since the open directory code is inside of a while loop.
How could a click on the link "Show Zip" and only show what is inside of that directory, and not inside of the others, unless clicked?

Thanks for the help!!!

In reply to Specific File in Directory 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.