[19754] in Perl-Users-Digest
Perl-Users Digest, Issue: 1949 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 17 18:10:38 2001
Date: Wed, 17 Oct 2001 15:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1003356615-v10-i1949@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Oct 2001 Volume: 10 Number: 1949
Today's topics:
Re: Perl and Win32 <websafari@armourtech.com>
Perl Win32 and ENV <llordani@qualcomm.com>
POD documentation question <warren.dodge@tektronix.com>
Re: precedence question <rtrahan@monmouth.com>
push, pop, shift, unshift, splice et al (JRoot)
Re: Running a .pl as a background. <rereidy@indra.com>
Re: Running a .pl as a background. <news@scottbell.org>
Re: Running a .pl as a background. nobull@mail.com
Re: Running a .pl as a background. <news@scottbell.org>
Re: Server Push on Apache localhost? <jimbo@soundimages.co.uk>
Re: Server Push on Apache localhost? <dshultz@cpan.org>
Re: Server Push on Apache localhost? <dshultz@cpan.org>
Sql-config access <jaywhy2@home.com>
Trying to call a Perl script from Perl <ajohnson_no_spam@purplemountain.net>
Re: Trying to call a Perl script from Perl <dlehman+USENET@redhat.com>
Re: Using a remote file with a Perl script <alan@scotlpuk.com>
Re: Using a remote file with a Perl script (Garry Williams)
Re: Using a remote file with a Perl script <alan@scotlpuk.com>
Re: Using a remote file with a Perl script (Garry Williams)
Re: Using a remote file with a Perl script <alan@scotlpuk.com>
using win32::perms module to get owner. (analyser)
Re: Win32::ODBC <webbat@btinternet.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Oct 2001 20:34:30 GMT
From: "Les Adrian" <websafari@armourtech.com>
Subject: Re: Perl and Win32
Message-Id: <qXlz7.26$9I6.6166557@news2.randori.com>
My humble suggestion is that if you insist on running perl in the WinOS then
throw away WinSite and get a true server running on the OS like
OmniHTTPdPro.
The main diffenence here is that once Activestate is set up in it's default
directory, thatdirectory is set up as a base configuration in OmniHTTPd and
will talk to scripts without change to #/usr/bin/perl because Omni tells the
script where to look.
Les
Cameron Dorey <camerond@mail.uca.edu> wrote in message
news:3BCB386D.F78A0E48@mail.uca.edu...
> Darlene Murphy wrote:
> >
> > I am trying to get perl to run under WinME. I have done web sites on
> > unix systems with perl and they work fine.
> >
> > For WinMe I am using WinSite and ActiveState Perl. It dose not
> > recognize #!g:\perl\bin\perl. What should I use? Also how do we put
> > comments in our perl scripts.
>
> This is a WinSite problem, not Perl. I don't have any problem using Perl
> under WinME, it works just the same as under Win98 (which means, despite
> some others stating to the contrary, just fine).
>
> Read your WinSite docs.
>
> Cameron
>
> --
> Cameron Dorey
> Associate Professor of Chemistry
> University of Central Arkansas
> Phone: 501-450-5938
> camerond@mail.uca.edu
------------------------------
Date: Wed, 17 Oct 2001 14:01:21 -0700
From: "Lawrence Lordanich" <llordani@qualcomm.com>
Subject: Perl Win32 and ENV
Message-Id: <9qkriq$pab$1@coset.qualcomm.com>
I am running a perl script under win32 (first time). When I spawn a perl
script using the system call I get the following error:
Error: Parse Exception
Can't find cmd.exe etc...
Any hints?
Is there an issue with ActiveState perl and say
"Program Files" vs "Progra~1"
syntax?
I have jiggled the path/perl5lib env vars with some change but not really
success.
Thanks,
Lawrence.
Please email: llordani@qualcomm.com
------------------------------
Date: Wed, 17 Oct 2001 18:03:41 GMT
From: Warren L Dodge <warren.dodge@tektronix.com>
Subject: POD documentation question
Message-Id: <3BCDC7FD.40800F09@tektronix.com>
I want to do some pod documentation for the programs I have written. It looks
as though it can do most of what I want to do.
I have many programs which actually do multiple functions depending on how the
program is called. I would like to write the POD documentation such that it can
be output into multiple files of data. One for each function of the program.
I don't see how I could do this as I read the manual.
Am I missing something? Ideas?
--
Warren Dodge warren.dodge@tektronix.com
------------------------------
Date: Wed, 17 Oct 2001 17:41:45 -0700
From: Richard Trahan <rtrahan@monmouth.com>
Subject: Re: precedence question
Message-Id: <3BCE2549.F1DBA5B3@monmouth.com>
Bernard El-Hagin wrote:
>
> I don't think parentheses would help here. You just have to
> go from right to left and keep track of $a.
>
> So starting from the right you have $value which always == 7,
> then you have $var[$a++] which initially yields $var[3] and
> increments $a to 4. Finally, you reach $var[$a++] on the left
> when $a == 4. So the whole statement is equivalent to:
>
> $var[4] = $var[3] + 7; # after this step $a is incremented again to 5
>
Thank you (and the other poster) for answering, but I'm afraid that
doesn't help. In trying to divine the order in which things are done,
it's simply not enough to say "start from the right". The fact is that
lexers receive their tokens from the left, and since Perl is lexically
a LALR language, a yacc-type parser can be built based on precedences
and at most one look-ahead token. In the example I gave, the $a++ on
the left side of the equals sign is delivered by the lexer before
getting to the equals sign, so it must (to produce the results actually
seen in the example) be "shifted" onto the parser stack until the
entire expression on the right of the equals sign is evaluated, but
there is no documentation (at least in Wall) on the precedence of
brackets. Well, on p. 89 of the cited book it says that terms include
most expressions in brackets ("most" is certainly not helpful),
and the table on p. 87 gives terms the highest precedence. But if that
were so, then the first [$a++] should be shifted off the parser
stack before the equals sign is even reached, implying that $a
should be incremented there, and not on the right. In other words, I
cannot find any set of rules that justify autoincrementing the second
$a before the first.
It is not generally true that everything on the right side of an
equals sign gets evaluated first (not, and, or, xor, comma, list
operators looking rightward), so your explanation, although
appreciated, is not sufficient.
Can anyone else add to this thread? I really need to understand this
issue.
------------------------------
Date: 17 Oct 2001 15:04:16 -0700
From: awkster@yahoo.com (JRoot)
Subject: push, pop, shift, unshift, splice et al
Message-Id: <9efa6216.0110171404.72550265@posting.google.com>
I need to loop through an array, identifying each element
then discarding the element thus leaving an empty array when
the loop finishes.
I read the faq's and perldocs on push, pop, shift, unshift
and splice. I thought I had it figured out but when I ran this
little program as a test, it never empties the array. It stops
half way apparently because it re-indexes the array each time
it shifts ????
Is there someway I can get around this behaviour??
Please don't send me back to the faq'a ... I'm all popped out.
Thanks for the help
#!perl -w
use strict;
my($x, $y);
my @x = (1...10);
foreach $x(@x){
print "# Element $x\n";
print "# Array: @x\n";
$y = shift(@x);
print "# Element removed: $y\n";
}
# Element 1
# Array: 1 2 3 4 5 6 7 8 9 10
# Element removed: 1
# Element 3
# Array: 2 3 4 5 6 7 8 9 10
# Element removed: 2
# Element 5
# Array: 3 4 5 6 7 8 9 10
# Element removed: 3
# Element 7
# Array: 4 5 6 7 8 9 10
# Element removed: 4
# Element 9
# Array: 5 6 7 8 9 10
# Element removed: 5
------------------------------
Date: Wed, 17 Oct 2001 12:08:02 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Running a .pl as a background.
Message-Id: <3BCDC902.9C74C0C0@indra.com>
Scott Bell wrote:
>
> Is it possible to make a perl script run as a background process? If so,
> how?
>
> ~scott
Do you mean as a daemon (UNIX)? I think this is covered in the FAQ, and
I know it is in the Cookbook.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Wed, 17 Oct 2001 20:50:24 +0100
From: "Scott Bell" <news@scottbell.org>
Subject: Re: Running a .pl as a background.
Message-Id: <Bclz7.15970$T05.1846173@news2-win.server.ntlworld.com>
Yeah, a Daemon. I really need to get a book on Perl.
--
Scott Bell
Email: scott@scottbell.org
The content of this message has been certified 100% correct.
Ron Reidy <rereidy@indra.com> wrote in message
news:3BCDC902.9C74C0C0@indra.com...
> Scott Bell wrote:
> >
> > Is it possible to make a perl script run as a background process? If so,
> > how?
> >
> > ~scott
> Do you mean as a daemon (UNIX)? I think this is covered in the FAQ, and
> I know it is in the Cookbook.
> --
> Ron Reidy
> Oracle DBA
> Reidy Consulting, L.L.C.
------------------------------
Date: 17 Oct 2001 20:36:16 +0100
From: nobull@mail.com
Subject: Re: Running a .pl as a background.
Message-Id: <u9wv1uoy8f.fsf@wcl-l.bham.ac.uk>
"Scott Bell" <news@scottbell.org> writes:
> Is it possible to make a perl script run as a background process?
See FAQ: "How do I fork a daemon process?"
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 17 Oct 2001 21:53:09 +0100
From: "Scott Bell" <news@scottbell.org>
Subject: Re: Running a .pl as a background.
Message-Id: <p7mz7.16757$T05.1900068@news2-win.server.ntlworld.com>
From the Perl FAQ:
--- Snip ---
Open /dev/tty and use the TIOCNOTTY ioctl on it. See tty(4) for details. Or
better yet, you can just use the POSIX::setsid() function, so you don't have
to worry about process groups.
Change directory to /
Reopen STDIN, STDOUT, and STDERR so they're not connected to the old tty.
Background yourself like this:
fork && exit;
--- Snip ---
Well that makes lots of sense.
--
Scott Bell
Email: scott@scottbell.org
The content of this message has been certified 100% correct.
<nobull@mail.com> wrote in message news:u9wv1uoy8f.fsf@wcl-l.bham.ac.uk...
> "Scott Bell" <news@scottbell.org> writes:
>
> > Is it possible to make a perl script run as a background process?
>
> See FAQ: "How do I fork a daemon process?"
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 17 Oct 2001 20:43:08 +0100
From: "jimbo" <jimbo@soundimages.co.uk>
Subject: Re: Server Push on Apache localhost?
Message-Id: <iblz7.2888$M15.24410@NewsReader>
"Arnuga" <arnuga@yahoo.com> wrote
> you've got ALOT of work to do. I'm not sure if there is anything
> available on CPAN for this sorta thing.... but
What a load of bollocks.
Have a look at this, for starters.
CGI::Push - Simple Interface to Server Push
> is perl the write tool for this job?
Is a brace and bit useful for boring holes?
jimbo
;-)
------------------------------
Date: Wed, 17 Oct 2001 14:40:24 -0700
From: David Shultz <dshultz@cpan.org>
Subject: Re: Server Push on Apache localhost?
Message-Id: <hlurstg3v7isnanouvrfvulml2l3c2dmp0@4ax.com>
Different kinda push... my bad :-)
David S.
On Wed, 17 Oct 2001 20:43:08 +0100, "jimbo" <jimbo@soundimages.co.uk>
wrote:
>"Arnuga" <arnuga@yahoo.com> wrote
>
>> you've got ALOT of work to do. I'm not sure if there is anything
>> available on CPAN for this sorta thing.... but
>
>What a load of bollocks.
>
>Have a look at this, for starters.
>
> CGI::Push - Simple Interface to Server Push
>
>
>> is perl the write tool for this job?
>
>Is a brace and bit useful for boring holes?
>
>jimbo
>;-)
>
------------------------------
Date: Wed, 17 Oct 2001 14:42:18 -0700
From: David Shultz <dshultz@cpan.org>
Subject: Re: Server Push on Apache localhost?
Message-Id: <nnursto1rstmelv2pljlbkfo8s37u0h963@4ax.com>
Spoke to soon,
it is the same kinda push, but this module wasn't around last
I played with this kinda stuff, though it is a bit light-weight Im
sure its fine for most. Thanks for the post jimbo
David S.
On Wed, 17 Oct 2001 20:43:08 +0100, "jimbo" <jimbo@soundimages.co.uk>
wrote:
>"Arnuga" <arnuga@yahoo.com> wrote
>
>> you've got ALOT of work to do. I'm not sure if there is anything
>> available on CPAN for this sorta thing.... but
>
>What a load of bollocks.
>
>Have a look at this, for starters.
>
> CGI::Push - Simple Interface to Server Push
>
>
>> is perl the write tool for this job?
>
>Is a brace and bit useful for boring holes?
>
>jimbo
>;-)
>
------------------------------
Date: Wed, 17 Oct 2001 21:40:46 GMT
From: jaywhy <jaywhy2@home.com>
Subject: Sql-config access
Message-Id: <B7F3727A.3383%jaywhy2@home.com>
Alright, I hope one of you perl guru's can help me.
Say you have software such as a shopping cart program. Lets say the
shopping cart is called Mifa and it saves it
configuration file in
/usr/local/mifa/config/SQL-config
Which has these permissions.
chmod 700 /usr/local/mifa/config/SQL-config
chmod nobody:nobody /usr/local/mifa/config/SQL-config
And it contain stuff like
$sqlhostname ='localhost';
$sqluser ='sql';
$sqlpass ='1234';
Now you have many customers on that same server, who you intern host their
websites. Now if you have user named Matt with the documentroot
/home/matt/html
Matt can execute cgi, so lets also say matt is a hacker. Matt won't be able
to access the SQL-config file directly, because only nobody or root can
access the file. So matt can't
cat /usr/local/mifa/config/SQL-config
But he knows apache which runs as nobody most be able to access the file.
Mifa needs that file for itself to create the database connection for Mifa.
Matt creates a script called hacksql.cgi.
#!/usr/bin/perl
#hacksql.cgi
$file = "/usr/local/mifa/config/SQL-config";
print_file_contents($file);
Now if Matt put that script in his documentroot. Matt could just goto
http://webhost.com/~matt/hacksql.cgi
User nobody would intern run and print out the configuration file. Now Matt
could simply enter the database and if it's a shopping cart program it
probably holds customers credit information.
Viola!
To get around this in apache you would include the module suexec. Suexec
allows you to only execute cgi files in your documentroot. Suexec isn't a
good solution it very hard to administrate correctly, and even apache's
website states this.
"it has been the decision of the Apache Group to NOT make suEXEC part of the
default installation of Apache. To this end, suEXEC configuration requires
of the administrator careful attention to details. After due consideration
has been given to the various settings for suEXEC, the administrator may
install suEXEC through normal installation methods"
I'm looking for a better solution hopefully in perl.
--
Jason Yates - jaywhy2@home.com
Network Administrator - RHCE
"Thoughtcrime does not entail death: thoughtcrime IS death."
------------------------------
Date: Wed, 17 Oct 2001 12:39:20 -0600
From: Amy Johnson <ajohnson_no_spam@purplemountain.net>
Subject: Trying to call a Perl script from Perl
Message-Id: <3BCDD058.70300@purplemountain.net>
This is probably a newbie question...
I have a Perl CGI script that I call from my web page. As a security
measure, I would like to be able to leave that Perl CGI script and call
another Perl CGI script when cookies aren't set correctly. But I can't
figure out how to redirect the control to another Perl CGI script.
I'm using the CGI.pm and DBI modules.
I've tried "do" and "exec" but with no luck, My code looks something like:
==============================================================
SWITCH: {
if (cookie('user') ne 'test') {do login.pl; last SWITCH;}
(more SWITCH statements)
}
===============================================================
Thanks so much for any help.
Amy
ajohnson@purplemountain.net
------------------------------
Date: Wed, 17 Oct 2001 14:09:34 -0500
From: Dave Lehman <dlehman+USENET@redhat.com>
Subject: Re: Trying to call a Perl script from Perl
Message-Id: <3BCDD76E.3050500@redhat.com>
Amy,
try system($cmd, @args). it's like exec, but does a fork() first.
hope that's what you wanted...
Dave
Amy Johnson wrote:
> This is probably a newbie question...
>
> I have a Perl CGI script that I call from my web page. As a security
> measure, I would like to be able to leave that Perl CGI script and call
> another Perl CGI script when cookies aren't set correctly. But I can't
> figure out how to redirect the control to another Perl CGI script.
>
> I'm using the CGI.pm and DBI modules.
>
> I've tried "do" and "exec" but with no luck, My code looks something like:
>
> ==============================================================
> SWITCH: {
> if (cookie('user') ne 'test') {do login.pl; last SWITCH;}
>
> (more SWITCH statements)
> }
> ===============================================================
>
> Thanks so much for any help.
> Amy
>
> ajohnson@purplemountain.net
>
------------------------------
Date: Wed, 17 Oct 2001 20:59:34 +0100
From: "Alan Fleming" <alan@scotlpuk.com>
Subject: Re: Using a remote file with a Perl script
Message-Id: <Atlz7.16242$T05.1862128@news2-win.server.ntlworld.com>
On a similar(ish) subject, how would I go about opening a file on a remote
system, via a UNC path, ie
\\server\share\path\file.txt
I have written a standard file reading sub-procedure, but it doesn't work
with UNC paths. What do I need to do?
Thanks
Alan
"Marc Bissonnette" <dragnet@internalysis.com> wrote in message
news:Xns913D88335F9AAdragnetinternalysisc@206.172.150.14...
> Hi all;
>
> Could someone point me in the right direction to learn how to use the
> contents of a file on a remote server in a perl script?
>
> Specifically, I was thinking of writing a CGI running on a client's server
> that would first check with a remote server (mine) to verify that they are
> a valid customer. While I know it's impossible to completely avoid people
> ripping off one's perl code, I was thinking that either remote user
> verification, or even putting a critical subroutine remotely may help stem
> the possibility.
>
> (Yes, I am aware that there are implications if my own server ever falls
> down)
>
> Suggestions are greatly appreciated.
>
> --
> ----------------------------
>
> Marc Bissonnette
> InternAlysis
> Intelligence in Internet Communications
> http://www.internalysis.com
------------------------------
Date: Wed, 17 Oct 2001 20:35:46 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Using a remote file with a Perl script
Message-Id: <slrn9srqt2.kr9.garry@zfw.zvolve.net>
On Wed, 17 Oct 2001 20:59:34 +0100, Alan Fleming <alan@scotlpuk.com>
wrote:
> On a similar(ish) subject, how would I go about opening a file on a remote
> system, via a UNC path, ie
> \\server\share\path\file.txt
> I have written a standard file reading sub-procedure,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I wonder what that is. No code.
> but it doesn't work
> with UNC paths.
That's helpful, too. No code. No error message. No return codes,
etc.
> What do I need to do?
How can anyone know?
--
Garry Williams
------------------------------
Date: Wed, 17 Oct 2001 21:43:23 +0100
From: "Alan Fleming" <alan@scotlpuk.com>
Subject: Re: Using a remote file with a Perl script
Message-Id: <V6mz7.16750$T05.1897932@news2-win.server.ntlworld.com>
sorry, never thought. oops. ;)
Here's the code. All my programs are CGI, so the error messages are in HTML.
There are no error codes - I only know that the open can't open the file
when I use a UNC pathname.
sub readfile
{
my ($file)=@_;
if (-e $file)
{
if (open (FILE, "<$file"))
{
flock (FILE, 2);
my (@contents) = <FILE>;
flock (FILE, 8);
close (FILE);
return (@contents);
}
else
{
print "There was an error while opening the file <b>$file<\/b> - check
file permissions.<br>\n";
}
}
else
{
print "Sorry, but the file <b>$file<\/b> does not appear to exist - try
a different file name.<br>\n";
}
}
That better? Cheers guys.
Alan
"Garry Williams" <garry@ifr.zvolve.net> wrote in message
news:slrn9srqt2.kr9.garry@zfw.zvolve.net...
> On Wed, 17 Oct 2001 20:59:34 +0100, Alan Fleming <alan@scotlpuk.com>
> wrote:
>
> > On a similar(ish) subject, how would I go about opening a file on a
remote
> > system, via a UNC path, ie
> > \\server\share\path\file.txt
> > I have written a standard file reading sub-procedure,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> I wonder what that is. No code.
>
> > but it doesn't work
> > with UNC paths.
>
> That's helpful, too. No code. No error message. No return codes,
> etc.
>
> > What do I need to do?
>
> How can anyone know?
>
> --
> Garry Williams
------------------------------
Date: Wed, 17 Oct 2001 21:25:05 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Using a remote file with a Perl script
Message-Id: <slrn9srtph.kr9.garry@zfw.zvolve.net>
On Wed, 17 Oct 2001 21:43:23 +0100, Alan Fleming <alan@scotlpuk.com>
wrote:
[ post re-ordered ]
> "Garry Williams" <garry@ifr.zvolve.net> wrote in message
> news:slrn9srqt2.kr9.garry@zfw.zvolve.net...
>> On Wed, 17 Oct 2001 20:59:34 +0100, Alan Fleming <alan@scotlpuk.com>
>> wrote:
[snip]
>> > but it doesn't work
>> > with UNC paths.
>>
>> That's helpful, too. No code. No error message. No return codes,
>> etc.
>>
>> > What do I need to do?
>>
>> How can anyone know?
>>
> sorry, never thought. oops. ;)
>
> Here's the code. All my programs are CGI, so the error messages are in HTML.
> There are no error codes
Oh, yes there are error codes. You chose not to print them, but they
are there.
> - I only know that the open can't open the file
> when I use a UNC pathname.
>
> sub readfile
[snip]
> else
>
> {
>
> print "There was an error while opening the file <b>$file<\/b> - check
> file permissions.<br>\n";
print "can't open $file: $!\n";
--
Garry Williams
------------------------------
Date: Wed, 17 Oct 2001 22:53:51 +0100
From: "Alan Fleming" <alan@scotlpuk.com>
Subject: Re: Using a remote file with a Perl script
Message-Id: <Y8nz7.17360$T05.1961777@news2-win.server.ntlworld.com>
I added the $! to my code, to give the error reason. Then, I created an
ascii text file filled with text, at the location: \\adminpc\mydocs\test.txt
When I ran a test script to read this file into an array, then display that
array, I get the following message:
Sorry, but the file \\adminpc\mydocs\test.txt does not appear to exist - try
a different file name.
Reason: No such file or directory
It's a windows 2000 box, and I have set the mydocs share to be accessible by
'system', 'network', and 'everyone', still no luck. Is this a windows
permissions problem, or is my CGI code at fault?
Thanks again.
Alan
"Garry Williams" <garry@ifr.zvolve.net> wrote in message
news:slrn9srtph.kr9.garry@zfw.zvolve.net...
> On Wed, 17 Oct 2001 21:43:23 +0100, Alan Fleming <alan@scotlpuk.com>
> wrote:
>
> [ post re-ordered ]
>
> > "Garry Williams" <garry@ifr.zvolve.net> wrote in message
> > news:slrn9srqt2.kr9.garry@zfw.zvolve.net...
> >> On Wed, 17 Oct 2001 20:59:34 +0100, Alan Fleming <alan@scotlpuk.com>
> >> wrote:
>
> [snip]
>
> >> > but it doesn't work
> >> > with UNC paths.
> >>
> >> That's helpful, too. No code. No error message. No return codes,
> >> etc.
> >>
> >> > What do I need to do?
> >>
> >> How can anyone know?
> >>
> > sorry, never thought. oops. ;)
> >
> > Here's the code. All my programs are CGI, so the error messages are in
HTML.
> > There are no error codes
>
> Oh, yes there are error codes. You chose not to print them, but they
> are there.
>
> > - I only know that the open can't open the file
> > when I use a UNC pathname.
> >
> > sub readfile
>
> [snip]
>
> > else
> >
> > {
> >
> > print "There was an error while opening the file <b>$file<\/b> -
check
> > file permissions.<br>\n";
>
> print "can't open $file: $!\n";
>
> --
> Garry Williams
------------------------------
Date: 17 Oct 2001 14:09:09 -0700
From: analysergreat@hotmail.com (analyser)
Subject: using win32::perms module to get owner.
Message-Id: <72216665.0110171309.549a1108@posting.google.com>
does anybody know how to get owner using the win32::perms module by
roth. they have examples on the website.. but none for getting the
owner..
specifically i am getting stuck in the code provided below. i have no
clue how to print out the ownership for the files i am searching for.
########## Beginning of Code ---------
use File::Find;
use FileHandle;
use Win32::Perms;
print ("Enter No.of days :");
$diff =<STDIN>;
get_time();
print ("$dir there\n");
open(FD, ">C:\\fire.txt") || "Cannot open file\n";
printf FD ("Here is an output line.\n");
find(\&wanted, 'C:\');
close FD;
sub wanted{
return if ( /^\.{2}/ );
my @MyStat = stat($_);
return if ( $MyStat[8] > $DateDiff );
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($MyStat[8]);
$mon++;
my $MyAccessDate = sprintf "%02d/%02d/%02d-%02d:%02d:%02d", $mday,
$mon,($year % 100),$hour,
$min, $sec;
$Own = GetNtfsOwner"$File::Find::name";
printf FD ("$File::Find::name @ $MyAccessDate @ $Own\n");
print "$File::Find::name @ $MyAccessDate\n";
}
sub get_time {
$diff = 86400 * $diff;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time - $diff);
$mon++;
$DateDiff = time;
$DateDiff -= $diff;
$diff = 0;
} # end of get_time
########## End of Code ----------
------------------------------
Date: Wed, 17 Oct 2001 22:31:22 +0100
From: "WebBat" <webbat@btinternet.com>
Subject: Re: Win32::ODBC
Message-Id: <9qkt5b$6gn$1@neptunium.btinternet.com>
> > I am having some problems running the Win32:ODBC extension on my
> > server (NT 4).
> >
> > Everything works fine on Win2000 but when I transfer it to the server
> > this is the error I get:
> >
> > Can't call method "Sql" on an undefined value at
> > C:\Inetpub\wwwroot\test\test.pl line 94.
>
> It sounds like you didn't make a connection. Check that
> Win32::ODBC->new returns a connection object:
>
> $Data = new Win32::ODBC("MyDSN")
> or die "Error connecting to database";
cheers Simon,
The DB connection was failing and some further investigation resulted in a
corrupt odbc.pm
everything works like a charm now
cheers
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1949
***************************************