I got stock on this problem. I am trying to move emails from new to cur folder, I check the content of directory first and after that try to move it:
#!/usr/bin/perl
use strict;
use warnings;
my $newDir = "/home/iphone/Maildir/new";
my $curDir = "/home/iphone/MailDir/cur";
opendir(DIR, "$newDir");
my @FILES= readdir(DIR);
closedir DIR;
foreach (@FILES) {
my $newFile="$currentDir"."\/".$file;
my $curFile="$oldDir"."\/".$file;
rename $newFile, $curFile;
}
Well it does not work and I think the reason is the name of the file with periods, comas etc like:
1340717641.M913153P29268.krasowski,S=3001,W=3072:2,S.
Any idea how to solve this ??
Thanks like always
Robert
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.