homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


  New Poll  
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » The Archives   » The Big Archives   » PERL on windows problem

 - UBBFriend: Email this page to someone!    
Author Topic: PERL on windows problem
The Chump
Geek
Member # 593

Member Rated:
5
Icon 8 posted February 19, 2003 07:13      Profile for The Chump   Author's Homepage     Send New Private Message       Edit/Delete Post 
What's wrong with this?
open(NEW,">H:/Apache2/htdocs/gladiators/$file")

I've been yanking my hair out because there shouldn't be.
I've also tried
open(NEW,'>H:/Apache2/htdocs/gladiators/$file')
and
open(NEW,">H:\\Apache2\\htdocs\\gladiators\\$file")

Someone please, HHEEEEEEELLLLLLPPPPPPP

PS. I kmow, I know, but NOT using windows is NOT an option in this instance.

--------------------
Vedi Vidi Velcro "I came, I saw, I stuck around"
quality in posting since dec 2000

Posts: 184 | From: In my chair, in front of my laptop, at my desk, in my kitchen, in my aprtment, o | Registered: Dec 2000  |  IP: Logged
spungo
BlabberMouth, a Blabber Odyssey
Member # 1089

Member Rated:
4
Icon 1 posted February 19, 2003 08:02      Profile for spungo     Send New Private Message       Edit/Delete Post 
Try ...

open(NEW,">H:\/Apache2\/htdocs\/gladiators\/$file");

--------------------
Shameless plug. (Please forgive me.)

Posts: 6529 | From: Noba Scoba | Registered: Jan 2002  |  IP: Logged
RussellReed
Single Celled Newbie
Member # 2029

Rate Member
Icon 1 posted February 20, 2003 10:52      Profile for RussellReed     Send New Private Message       Edit/Delete Post 
Which version of Perl for Windows are you using?

I tried a similar test in ActiveState Perl, and your syntax is correct.

Do all of the directories in the path already exist? The open will fail if they don't.

You can do the following to get a little more information about the failure:

open(NEW,">H:/Apache2/htdocs/gladiators/$file")
or die "Unable to open $file: $!";

Posts: 1 | Registered: Feb 2003  |  IP: Logged
The Chump
Geek
Member # 593

Member Rated:
5
Icon 1 posted February 21, 2003 06:42      Profile for The Chump   Author's Homepage     Send New Private Message       Edit/Delete Post 
Thanks guys.
I couldn't get it to work but I did find a work around.
$file = "H:\\Apache2\\htdocs\\gladiators\\".$name.".txt";
open(NEW, ">$file");

although I still don't understand why it didn't work the first time. I'm using the latest Perl and ActiveState versions.

Posts: 184 | From: In my chair, in front of my laptop, at my desk, in my kitchen, in my aprtment, o | Registered: Dec 2000  |  IP: Logged


All times are Eastern Time  
  New Poll   Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

© 2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam