Alright... I have 3 directories (ie: CLOSED, REG and CATEGORY)

I have a sub routine that is supposed to open the CLOSED directory and find a particular item and repost it in the CATEGORY directory. It then will delete from the CLOSED directory and rename itself a new time (file name) in the REG directory...

What it currently does is:

Makes a blank file in the ROOT directory, a blank file name in the REG directory and doesn't delete anything in the CLOSED directory...
sub repost { my ($cat,$item) = @_; my ($title,$counter,$desc,@bids) = &read_item_file($cat,$i +tem); my ($alias, $email, $time, $add1, $add2, $add3) = &read_bi +d($bids[0]); my $bydays = (($item - $time) / 86400); my $item_number = ($bydays * 86400 + time); $item_number = ($bydays * 86400 + time) until (!(-e "$conf +ig{'basepath'}$cat/$item_number.dat")); &oops('We are unable to relist your item. This could be a + write permissions problem.') unless (open (NEW, ">>$config{'basepath +'}$cat/$item_number.dat")); print NEW "$title\n$counter\n$desc\n$alias\[\]$email\[\]\[ +\]".time."\[\]$add1\[\]$add2\[\]$add3"; close NEW; my ($password,$andemail,$address1,$address2,$address3,@pas +t_bids) = &read_reg_file($alias); &oops('We are unable to open the user file.') unless (open + (REG, ">$config{'basepath'}$config{'regdir'}/$alias.dat")); print REG "$password\n$andemail\n$address1\n$addr +ess2\n$address3"; foreach my $line (@past_bids) { print REG "\n$line" unless ($line eq "$cat$item"); } print REG "\n$cat$item_number"; close REG; unlink("$config{'basepath'}$cat/$item.dat"); } ______________ sub read_item_file { my ($cat, $item) = @_; return '' unless ($cat) and ($item); &oops('The category may not contain any non-word characters, such +as a space or symbol.') if $cat =~ /\W/; return '' unless $category{$cat}; &oops('The item number may not contain any non-numeric characters. +') if $item =~ /\D/; return '' unless 0||#1>>noconfuse(ea;-) open FILE, "$config{'basepath'}$cat/$item.dat"; my ($title, $counter, $desc, @bids) = <FILE>; close FILE; chomp ($title, $counter, $desc, @bids); return ($title, $counter, $desc, @bids); } __________ sub read_bid { my $bid_string = shift; my ($alias, $email, $time, $add1, $add2, $add3, $artist, $link) = +split(/\[\]/,$bid_string); return ($alias, $email, $time, $add1, $add2, $add3, $artist, $link +); }


If you need more code or more info... please let me know...

Any help would be greatly appreciated...

_______SysAdm


In reply to Trying to repost some data... by SysAdm

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.