sorry i should have shown the entire thing. i was hiding the top half because there was info i didn't want to share
#!/usr/bin/perl -w use Net::FTP; use File::Copy; use Net::SMTP; use File::Basename; use Email::Send::SMTP::Gmail; use File::Rename; use POSIX qw(strftime); my $date = strftime("%m-%d-%y",localtime); my $time = strftime("%I:%M:%S",localtime); ###############define all the folders in this game############## my $whitefiles = "/Users/flieckb/Desktop/aero_2push_white/"; my $tiff = "/Users/flieckb/Desktop/aero_tiff/"; my $mybadmatch="_white.tif"; my $dllist='bflieck@industrialcolor.com'; ################################################################ my $current = "$date"; chomp $current; chomp $date; sub mail{ our($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.co +m', -login=>'XXXXXX', -pass=>'XXXX', -port=> '25', -debug=> 1, -timeout=> 1000); $mail->send(-to=>"$to", -from=>"$from", -subject=>"$subject", -body=>" +$body", -contenttype=>"text/html"); $mail->bye; } my $mybadmatch="_white.tif"; chdir( $tiff ) or mail ($to = $dllist, $from = $dllist, $subject= "can + not move $file", $body ="can not move $file" ); (@tiff_list) = glob "*tif"; my $upload_count = @tiff_list; foreach my $file (@tiff_list) { if ($file =~ m/$mybadmatch/is) { print "$file is white background match\n"; my $old = "$tiff$file"; my $new = "$whitefiles"; copy ($old, $new) or mail ($to = $dllist, $from = $dllist, $subject= " +can not move $file", $body ="can not move $file" ); open FILE, '>> /Users/flieckb/Desktop/whitefiles.txt' or warn $!; print FILE "$date\t$file\t"; print FILE "\n"; } else { print "$file :normal production image\n"; } } close FILE; chdir( $whitefiles ) or mail ($to = $dllist, $from = $dllist, $subject += "can not get to $whitefiles", $body ="can not get to $whitefiles") +; (@white_list) = glob "*tif"; foreach $file (@white_list) { my $oldfile = $file; # s/.* //g; rename($oldfile, $file); }

In reply to Re^2: rename files by flieckster
in thread rename files by flieckster

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.