Win32::SetupSup and ActiveState Perl 8

2003-12-16 Thread Kevin Gibbs
Does anyone know of a ppm for SetupSup that works with the latest version of
Perl?

Thanks,

Kevin.

This e-mail is confidential and may contain legally privileged information.  You 
should not disclose its contents to any other person.  If you are not the intended 
recipient, please notify the sender immediately.

Whilst the Council has taken every reasonable precaution to minimise the risk of 
computer software viruses, it cannot accept liability for any damage which you may 
sustain as a result of such viruses.  You should carry out your own virus checks 
before opening the e-mail (and/or any attachments).

Unless expressly stated otherwise, the contents of this e-mail represent only the 
views of the sender and do not impose any legal obligation upon the Council or commit 
the Council to any course of action.



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Problem with Win32::Console and END block.

2003-12-16 Thread Beckett Richard-qswi266
Does anyone know a way around this one. I want to set my dos window up with
80 cols and 100 lines, but when I do I break my END block.

use strict;
use warnings;
$| =1;
# use Win32::Console;
# my $BUFFER = new Win32::Console(STD_OUTPUT_HANDLE);
# $BUFFER-Size(80,100);
for (1..5) {print .; sleep 1}
exit;

END {print \n\nPress Enter\n; STDIN;}

In the above form it works. BUT remove the comments from the first 2
(commented) lines, and the PRINT statement in the END block stops working.
The STDIN still works, though.

I _can't_ have the syntax wrong this time, Shirley?

W2K, V5.8.1 build 807.

Thanks.

R.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Command Line WinZip Executed From Win32 Perl Script

2003-12-16 Thread $Bill Luebkert
Bharucha, Nikhil wrote:

 Hi,
 
  
 
 Has anyone redirected WinZip output to a separate file?  I cant seem to
 get it to work.  Currently, it defaults to Standard Output but writes to
 the beginning for the first zip and then it appends, and it always
 writes Searching.. to Standard Error.  One site recommended adding 
 with the file but Winzip thinks it is another file to zip.

A sample code snippet would help.

Snipping some code from one of my scripts (this seems to work for me) :

my $winzip = 'D:/Util/WinZip/wzzip.exe';
my @zip_options = qw(-a -r -p -whs); # add, recurse, sub paths, +hidden/system
my $zipfile = 'somename.zip';

# send a newline to Winzip if not registered version

open OUT, | $winzip @zip_options $zipfile '*.*' E:/tmp/wzzip.log or
  die wzzip pipe: $!;
print OUT \n;
close OUT;

I'm running it under tcsh which is probably why I quoted '*.*'.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::SetupSup and ActiveState Perl 8

2003-12-16 Thread Randy Kobes
On Tue, 16 Dec 2003, Kevin Gibbs wrote:

 Does anyone know of a ppm for SetupSup that works with the
 latest version of Perl?

There's a Win32-Setupsup ppm package for ActivePerl 8xx at
http://theoryx5.uwinnipeg.ca/ppms/.

-- 
best regards,
randy kobes
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Command Line WinZip Executed From Win32 Perl Script

2003-12-16 Thread tanman
Nick,

Download the WinZip Command Line Support Add-On here:

http://www.winzip.com/other.htm

See if that works better for you.

HT

- Original Message -
From: Bharucha, Nikhil [EMAIL PROTECTED]
Date: Tuesday, December 16, 2003 11:28 am
Subject: Command Line WinZip Executed From Win32 Perl Script

 Hi,
 
 
 
 Has anyone redirected WinZip output to a separate file?  I can't 
 seem to
 get it to work.  Currently, it defaults to Standard Output but 
 writes to
 the beginning for the first zip and then it appends, and it always
 writes Searching. to Standard Error.  One site recommended 
 adding with the file but Winzip thinks it is another file to zip.
 
 
 
 
 
 Nick
 
 
begin:vcard
n:Tanner;Howard
fn:Howard Tanner
version:2.1
email;internet:[EMAIL PROTECTED]
end:vcard



file permissions via UNC path

2003-12-16 Thread John Deighan
I have a Perl script, running under IIS, using PerlEx. It is able to read 
and write files located on external storage using a UNC path. However, if 
that same Perl script invokes a second Perl script (using the backticks 
syntax, e.g. `perl otherscript.pl`), then that second Perl script cannot 
read the same file - I get a no such file type of error message in the $! 
variable. Why would this happen?
John Deighan
Public Consulting Group
1700 Kraft Dr.
Suite 2250
Blacksburg, VA  24060
[EMAIL PROTECTED]
540-953-2330  x12
FAX: 540-953-2335

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file permissions via UNC path

2003-12-16 Thread Sisyphus
John Deighan wrote:
I have a Perl script, running under IIS, using PerlEx. It is able to 
read and write files located on external storage using a UNC path. 
However, if that same Perl script invokes a second Perl script (using 
the backticks syntax, e.g. `perl otherscript.pl`), then that second Perl 
script cannot read the same file - I get a no such file type of error 
message in the $! variable. Why would this happen?
Looks to me that the UNC path is being interpreted as a local file path.
Something to do with the number of backslashes you're providing perhaps.
I've actually come across the reverse problem where, under backticks, 
'\\perl\\bin\\perl' is being interpreted as a network path. In my case, 
the fix was to specify 'D:\\perl\\bin\\perl' - which still mystifies me, 
given that the script running the backticks command is in the 'D' drive.

Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Trying to install Perl on XP Professional -- getting dialog error 2755, 110

2003-12-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Sorry to be so slow in responding. What happened was that I was working with 
XP for the first time and made a security change and I did it at the wrong place. So 
basically ended up with no real access to the machine. Ended up having to have the 
machine rebuilt.

I just a few minutes ago retried and everything worked as it should when it 
came to installing Perl on the machine.  Just as I would have expected.

So thanks to each who responded, but as usual the real enemy was me!

Wags ;)
[EMAIL PROTECTED] wrote:
 Subject: Trying to install Perl on XP Professional -- getting dialog
 error 2755, 110
 
 
   I have never had problem w/ installing Perl until I tried to install
 on XP Professional. I have tried both 5.6.1.635 and 5.81.807 and both
 fail with the same error.  
 
   I took a look on www.microsoft.com and it talks about .NET install
 and a problem w/ a temp folder being encrypted, but I have checked
 the temp folder where I am installing from and it is not encrypted.  
 
   The error dialog given is:
 
   Internal Error 2755, 110
   c:\TEMP\ActivePerl-5.6.1.635-MSWin32-x86.msi
 
   System was just created last week. It is XP Professional Version
 2002 Service Pack 1 w/ 504 meg of memory. 
 
   Any ideas or where I should be looking?
 
   Thanks!
 
 Wags ;)
 


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Trying to install Perl on XP Professional -- getting dialog error 2755, 110

2003-12-16 Thread Jeff Griffiths
this is the tricky thing with XP for many users. XP uses NTFS by 
default, which means that ACL permissions are applied to all 
filesystems. The Activeperl msi installer is actually installed using 
the MSI service, run as the SYSTEM account and NOT as your user account, 
so many users run into problems with this particularly in cases where:

1. they are installing to a new drive formatted with NTFS where the 
SYSTEM account has no privs

2. they are installing from a drive or loaction the SYSTEM account 
doesn't have access to (eg a mapped drive)

3. the c:\%systemroot%\Installer folder's permissions have been messed 
with, or it has been removed.

jeffG

Wagner, David --- Senior Programmer Analyst --- WGO wrote:
	Sorry to be so slow in responding. What happened was that I was working with XP for the first time and made a security change and I did it at the wrong place. So basically ended up with no real access to the machine. Ended up having to have the machine rebuilt.

	I just a few minutes ago retried and everything worked as it should when it came to installing Perl on the machine.  Just as I would have expected.

	So thanks to each who responded, but as usual the real enemy was me!

Wags ;)
[EMAIL PROTECTED] wrote:
Subject: Trying to install Perl on XP Professional -- getting dialog
error 2755, 110
	I have never had problem w/ installing Perl until I tried to install
on XP Professional. I have tried both 5.6.1.635 and 5.81.807 and both
fail with the same error.  

	I took a look on www.microsoft.com and it talks about .NET install
and a problem w/ a temp folder being encrypted, but I have checked
the temp folder where I am installing from and it is not encrypted.  

	The error dialog given is:

Internal Error 2755, 110
 c:\TEMP\ActivePerl-5.6.1.635-MSWin32-x86.msi
	System was just created last week. It is XP Professional Version
2002 Service Pack 1 w/ 504 meg of memory. 

	Any ideas or where I should be looking?

	Thanks!

Wags ;)



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: seek parameters

2003-12-16 Thread Sisyphus
Glenn Linderman wrote:
Here's a strangeness:

my $res = sysseek( @stk[ -2, -3, -1 ] );

fails to compile, but

my $res = sysseek( $stk[ -2 ], $stk[ -3 ], $stk[ -1 ] );

compiles fine.  As far as I can tell, they have the same effect.

And curiously,  the error from the first is about the number of parameters.

That would mean that '@stk[-2,-3,-1]' is being seen as other than 3 
arguments. But that's impossible, isn't it ?

('parameters' mean 'arguments' doesn't it ?)

I certainly can't explain it.

Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


unlink

2003-12-16 Thread Eric Edwards
Hey Listers-
This is not homework.  I am teaching myself perl.
Question:
Does the unlink command not work on windows?  The book I am using has some
code examples using it but I am wondering if it might be UNIX specific.  I
hope my code isn't that bad.
Thanks!
Eric

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Term::ReadKey weirdness

2003-12-16 Thread Glenn Linderman
Hi,

I'm writing a program that needs single character input from the console 
window.  So Term::ReadKey seems to be a natural solution.

So I wrote some perl code as follows.  Usually the program asks for a 
key, and gets it.  Sometimes it wants to check for the existance of a 
keypress without delay, so fin_key and fin_iskey were to deal with 
those.  And then fin_kbexpect was to deal with the case where it wants a 
whole line, ending with carriage return.  One could switch out of raw 
mode, and and use STDIN for a whole line, but funny things happen when 
switching from raw to normal mode: if the user has typed characters 
before the mode is switched to normal, they don't echo so it is 
confusing.  This is confusing, but understandable behavior.

What is less understandable is that when using the commented out version 
 of fin_key, called from fin_kbexpect, the carriage return key seems to 
be delayed.  If one types a carriage return, nothing seems to happen (it 
is not printed by the debug print statement) until another key is 
pressed.  Then the carriage return stands up to be counted, and so does 
the next key.  However, it is pretty confusing for the user to have to 
type ahead to get the previous line ending to be recognized.

The uncommented version of fin_key, which uses fin_iskey and a sleep 
loop, doesn't have such a problem.

Looking at the internals of Term::ReadKey (which I can't claim to fully 
understand) it appears that there is a difference: calling the getch vs 
calling the ReadConsoleInput.  Perhaps mixing those isn't the best idea?

Anyway, the current handling of carriage returns by ReadKey( 0 ) is 
extremely disconcerting in use.  The

my $debug = 1;
#
{ my $kbd_mode;
  use Term::ReadKey;
#  sub fin_key
#  { unless ( $kbd_mode )
#{ ReadMode('raw');
#  $kbd_mode = 1;
#}
#my $key = ReadKey( 0 );
#return ord $key;
#  }
  #
  sub fin_iskey
  { unless ( $kbd_mode )
{ ReadMode('raw');
  $kbd_mode = 1;
}
my $key = ReadKey( -1 );
return 0  unless defined $key;
return ord $key;
  }
  #
  sub fin_key
  { my $key;
$key =  fin_iskey();
until ( $key )
{ sleep ( .1 );
  $key =  fin_iskey();
}
  }
  #
  sub fin_done
  { if ( $kbd_mode )
{ ReadMode('normal');
  print kbd mode was set\n;
  $kbd_mode = 0;
}
return;
  }
  #
  END {  fin_done(); }
}
#
sub fin_kbexpect
{ my $gotcr;
  my $buf = '';
  until ( $gotcr )
  { my $key =  fin_key();
print key=$key   if $debug;
if ( $key == 13 )
{ $buf .= chr 10;
  do_type( chr( $key ) . chr( 10 ));
  $gotcr = 1;
} elsif ( $key == 8 )
{ do_type( \cH \cH );
  substr $buf, -1, 1, '';
} elsif ( $key  127  ||  $key  32 )
{ do_type( \cG );
} else
{ $buf .= chr $key;
  do_type( chr $key );
}
  }
  $in{'buf'} = $buf;
  $in{'ix'} = 0;
  $in{'max'} = length $buf;
  return;
}
--
Glenn -- http://nevcal.com/
===
Like almost everyone, I receive a lot of spam every day, much of it
offering to help me get out of debt or get rich quick.  It's ridiculous.
-- Bill Gates
And here is why it is ridiculous:
 The division that includes Windows posted an operating profit of $2.26 
 billion on revenue of $2.81 billion.
 --from Reuters via 
http://biz.yahoo.com/rc/031113/tech_microsoft_msn_1.html

So that's profit of over 400% of investment... with a bit more 
investment in Windows technology, particularly in the area of 
reliability, the profit percentage might go down, but so might the bugs 
and security problems?  Seems like it would be a reasonable tradeoff. 
WalMart earnings are 3.4% of investment.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: unlink

2003-12-16 Thread Lynn. Rickards
 
 Hey Listers-
 This is not homework.  I am teaching myself perl.
 Question:
 Does the unlink command not work on windows?  The book I am 
 using has some
 code examples using it but I am wondering if it might be UNIX 
 specific.  I
 hope my code isn't that bad.
 Thanks!
 Eric
 
Unlink works even on windoze. What isn't working for you?

- Lynn.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: unlink

2003-12-16 Thread Randy W. Sims
On 12/16/2003 10:14 PM, Eric Edwards wrote:

Hey Listers-
This is not homework.  I am teaching myself perl.
Question:
Does the unlink command not work on windows?  The book I am using has some
code examples using it but I am wondering if it might be UNIX specific.  I
hope my code isn't that bad.
Thanks!
Eric
unlink works fine on Windows. What code is failing?

unlink 'filename' or die $!;

Randy.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: seek parameters

2003-12-16 Thread Arms, Mike
Well, I could see a possibility here, but this is total
speculation as I do not know the underlying implentation
of the sysseek function.

Think of the case of function prototypes:

  sub f (\@) { print 'foo'; }
  my @a = qw(b c d e f z);
  f( @a[-2,-3,-1] );

I get this error:

  Type of arg 1 to main::f must be array (not array slice)

The prototype specifies that this function expects an actual array
to be passed in (and it addresses it via a ref). The fact that it
knows the difference between an array slice and an array I think
means that that info concerning the type of args being passed to
a subroutine can be known to the subroutine.

So, maybe the code author for sysseek, since it is a pretty
low level (as in close to the OS) function, made an assumption
that the parameters being passed in were 3 individual scalars.
It could then misbehave if an array slice is passed in instead.
Maybe a direct interface to a C-function call.

Again - pure thought conjecture here on my part as I do not
know the Perl guts nor the specifics of sysseek. 

 And curiously,  the error from the first is about the 
 number of parameters.

This statement adds strength to my conjecture as an array slice
could be a single parameter (rather than three).

--
Mike Arms


 -Original Message-
 From: Sisyphus [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 16, 2003 4:27 PM
 Cc: Win32 perl
 Subject: Re: seek parameters
 
 
 Glenn Linderman wrote:
  Here's a strangeness:
  
  my $res = sysseek( @stk[ -2, -3, -1 ] );
  
  fails to compile, but
  
  my $res = sysseek( $stk[ -2 ], $stk[ -3 ], $stk[ -1 ] );
  
  compiles fine.  As far as I can tell, they have the same effect.
  
  And curiously,  the error from the first is about the 
 number of parameters.
  
 
 That would mean that '@stk[-2,-3,-1]' is being seen as other than 3 
 arguments. But that's impossible, isn't it ?
 
 ('parameters' mean 'arguments' doesn't it ?)
 
 I certainly can't explain it.
 
 Cheers,
 Rob
 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: unlink

2003-12-16 Thread Randy W. Sims
On 12/16/2003 11:04 PM, Eric Edwards wrote:

- Original Message - 
From: Randy W. Sims [EMAIL PROTECTED]
To: Eric Edwards [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 9:35 PM
Subject: Re: unlink



On 12/16/2003 10:14 PM, Eric Edwards wrote:


Hey Listers-
This is not homework.  I am teaching myself perl.
Question:
Does the unlink command not work on windows?  The book I am using has
some

code examples using it but I am wondering if it might be UNIX specific.
I

hope my code isn't that bad.
Thanks!
Eric
unlink works fine on Windows. What code is failing?

unlink 'filename' or die $!;

Randy.


 I tried both of these:
 foreach (@ARGV) {
unlink $_ or warn Can't unlink '$_': $! \n;
 }
 also:
 foreach my $file qw(slate bedrock lava)) {
unlink $file of warn failed on $file: $!\n;
 }
 i entered these file names in my directory.
 Thanks,
 Eric
What is the output?

-8-
#!/usr/bin/perl
use strict;
use warnings;
use Cwd;

print 'In directory ' . cwd() . \n;
foreach (@ARGV) {
  print unlinking $_\n;
  unlink or warn;
}
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: unlink

2003-12-16 Thread Randy W. Sims
[To respond select the Reply-All option in your mail client to respond 
to the mailing-list, and please post your response at the end of the 
message your responding to. Thanks.]

On 12/16/2003 11:33 PM, Eric Edwards wrote:

- Original Message - 
From: Randy W. Sims [EMAIL PROTECTED]
To: Eric Edwards [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 10:12 PM
Subject: Re: unlink



On 12/16/2003 11:04 PM, Eric Edwards wrote:


- Original Message - 
From: Randy W. Sims [EMAIL PROTECTED]
To: Eric Edwards [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 9:35 PM
Subject: Re: unlink




On 12/16/2003 10:14 PM, Eric Edwards wrote:



Hey Listers-
This is not homework.  I am teaching myself perl.
Question:
Does the unlink command not work on windows?  The book I am using has
some


code examples using it but I am wondering if it might be UNIX specific.
I


hope my code isn't that bad.
Thanks!
Eric
unlink works fine on Windows. What code is failing?

unlink 'filename' or die $!;

Randy.


 I tried both of these:
 foreach (@ARGV) {
unlink $_ or warn Can't unlink '$_': $! \n;
 }
 also:
 foreach my $file qw(slate bedrock lava)) {
unlink $file of warn failed on $file: $!\n;
 }
 i entered these file names in my directory.
 Thanks,
 Eric
What is the output?

-8-
#!/usr/bin/perl
use strict;
use warnings;
use Cwd;

print 'In directory ' . cwd() . \n;
foreach (@ARGV) {
  print unlinking $_\n;
  unlink or warn;
}
 The output is failed on 'filename' or can't unlink 'filename'.
 Eric
Does the script I posted (above) print out the directory name and file 
names that you expect?

Randy.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: seek parameters

2003-12-16 Thread Sisyphus
Arms, Mike wrote:
Well, I could see a possibility here, but this is total
speculation as I do not know the underlying implentation
of the sysseek function.
Think of the case of function prototypes:

  sub f (\@) { print 'foo'; }
  my @a = qw(b c d e f z);
  f( @a[-2,-3,-1] );
I get this error:

  Type of arg 1 to main::f must be array (not array slice)
That's probably close to what's happening. Consider this:

   sub f ($$$) { print 'foo'; }
   my @a = qw(b c d e f z);
   f( @a[-2,-3,-1] );
Then replace the last line with: f($a[-2], $a[-3], $a[-1]);

Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: unlink

2003-12-16 Thread Eric Edwards
It gives me the correct directory and filename but it does not delete the
file.
Eric
- Original Message - 
From: Randy W. Sims [EMAIL PROTECTED]
To: Eric Edwards [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 10:47 PM
Subject: Re: unlink


 [To respond select the Reply-All option in your mail client to respond
 to the mailing-list, and please post your response at the end of the
 message your responding to. Thanks.]

 On 12/16/2003 11:33 PM, Eric Edwards wrote:

  - Original Message - 
  From: Randy W. Sims [EMAIL PROTECTED]
  To: Eric Edwards [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Tuesday, December 16, 2003 10:12 PM
  Subject: Re: unlink
 
 
 
 On 12/16/2003 11:04 PM, Eric Edwards wrote:
 
 
 - Original Message - 
 From: Randy W. Sims [EMAIL PROTECTED]
 To: Eric Edwards [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Tuesday, December 16, 2003 9:35 PM
 Subject: Re: unlink
 
 
 
 
 On 12/16/2003 10:14 PM, Eric Edwards wrote:
 
 
 
 Hey Listers-
 This is not homework.  I am teaching myself perl.
 Question:
 Does the unlink command not work on windows?  The book I am using has
 
 some
 
 
 code examples using it but I am wondering if it might be UNIX
specific.
 
 I
 
 
 hope my code isn't that bad.
 Thanks!
 Eric
 
 
 unlink works fine on Windows. What code is failing?
 
 unlink 'filename' or die $!;
 
 Randy.
 
 
   I tried both of these:
   foreach (@ARGV) {
  unlink $_ or warn Can't unlink '$_': $! \n;
   }
   also:
   foreach my $file qw(slate bedrock lava)) {
  unlink $file of warn failed on $file: $!\n;
   }
   i entered these file names in my directory.
   Thanks,
   Eric
 
 What is the output?
 
 -8-
 #!/usr/bin/perl
 use strict;
 use warnings;
 
 use Cwd;
 
 print 'In directory ' . cwd() . \n;
 foreach (@ARGV) {
print unlinking $_\n;
unlink or warn;
 }
 
   The output is failed on 'filename' or can't unlink 'filename'.
   Eric

 Does the script I posted (above) print out the directory name and file
 names that you expect?

 Randy.

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: unlink

2003-12-16 Thread Sisyphus
Eric Edwards wrote:
It gives me the correct directory and filename but it does not delete the
file.
Eric
The filename you give it needs to be in the directory that is printed 
out. If you want it to delete a file in some other directory you need to 
provide the path to that file as well:

perl the_script.pl C:/my_stuff/for_deletion/delete_me.txt

Now ... if the actual path to the actual file you want to unlink happens 
to have one or more spaces in it (eg 'My Documents') then that still 
won't work.

(Best to reply to posts by adding to the bottom, rather than the top. 
Also delete any irrelevant stuff from earlier posts before posting :-)

Cheers,
Rob
--
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs