CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
An extra "!" get added

 



nagarajsh
New User

Aug 11, 2009, 10:11 AM

Post #1 of 3 (4151 views)
An extra "!" get added Can't Post

Hi,

I have following script to find the newly created file in a directory and display the complete link to the file.

$dir = "\\\\123.53.12.123\\ABC\\Reports\\EFG\\Details\\XYZ";

opendir (DIR, "$dir/");
@FILES = grep(/.xls/,readdir(DIR));
closedir (DIR);

foreach $FILES (@FILES) {
if (-M "$dir/$FILES" > 0) {
$latest_xls = $FILES;
}
}

## ppt files
opendir (DIR, "$dir/");
@FILES = grep(/.PPT/,readdir(DIR));
closedir (DIR);

foreach $FILES (@FILES) {
if (-M "$dir/$FILES" > 0) {
$latest_ppt = $FILES;
}
}

$EMAI_XLS = "file:\\\\123.53.12.123\\ABC\\Reports\\EFG\\Details\\XYZ\\$latest_xls";

$EMAIL_PPT = "file:\\\\123.53.12.123\\ABC\\Reports\\EFG\\Details\\XYZ\\$latest_ppt";

## send mail with link $EMAI_XLS ,$EMAI_PPT



I have around 20 files generated in different folders and the script send mail with 20 links.

Now, the problem is daily 99% of the times all the files do open but one or the other file can not be opened from the link. when i move the mouse over the link, i see that the files which do not open has one extra "!" in the expansion. say the actual file is, \\123.53.12.123\ABC\Reports\\EFG\Details\XYZ\2009081112AM_iAmFile.xls, it would have become \\123.53.12.123\!ABC\Reports\\EFG\Details\XYZ\2009081112AM_iAmFile.xls. So when the file will give error when the recipient clicks on the link.



Anything i am doing wrong? there is no particular file which is wrong always. it can be any of the 20 filesa dn it might open good on another system and might fail on someone else system. Any idea?



thanks for the time and thanks in advance,




nagarajsh
New User

Aug 17, 2009, 10:17 AM

Post #2 of 3 (4116 views)
Re: [nagarajsh] An extra "!" get added [In reply to] Can't Post

Can someone please guide me?


KevinR
Veteran


Aug 17, 2009, 12:48 PM

Post #3 of 3 (4114 views)
Re: [nagarajsh] An extra "!" get added [In reply to] Can't Post

Appears to have nothing to do with perl. I have no idea where the extra ! is coming from but it does not appear to come from the code you posted.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives