Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
perl script help

Reply  
Thread Tools
cyberpac9's Avatar
Member with 177 posts.
 
Join Date: Sep 2005
Experience: Advanced
08-Feb-2010, 09:52 AM #1
perl script help
i am new to perl (i should say, i've never even looked at a perl script before today), but i do have a programming background...

so, we have a script that, among other things, takes a .doc file and changes the extension to .htm...there is an issue, however, with parentheses...so i wanted to added a little snippet that finds the parentheses and removes them...the piece i added apparently does not work...

what do you think i should change?
Code:
sub convertWordDoc {
    my $htmDoc, $tempDir, $cmdLine;
    $htmDoc = $File::Find::name;
    $htmDoc =~ s/\.doc$/\.htm/i;

###################################
#
#  Added to search and remove ( and )
#
###################################
	
	$htmDoc =~ s/[()]//g;
	
###################################
#
#  End addition
#
###################################
    
    convert2htm($File::Find::name, DELETE_SOURCE_DOC, DELETE_FILES_DIR);
    -e $htmDoc or die "word2htm failed on $File::Find::name";
}
__________________
The dyslexic, agnostic, insomniac, lays awake all night wondering..."Is there really a DOG?"
ehymel's Avatar
Senior Member with 660 posts.
 
Join Date: Aug 2007
Location: Texas
08-Feb-2010, 04:56 PM #2
This is more of a regexp question than a perl question. Your expression is failing because parentheses are special characters, so to search for them literally you have to prefix with a backslash:

Code:
$htmDoc =~ s/[\(\)]//g;
cyberpac9's Avatar
Member with 177 posts.
 
Join Date: Sep 2005
Experience: Advanced
08-Feb-2010, 05:06 PM #3
i'll give that a try...thanks
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:45 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.