[10691] in Perl-Users-Digest
Perl-Users Digest, Issue: 4285 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 24 14:07:20 1998
Date: Tue, 24 Nov 98 11:03:40 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 24 Nov 1998 Volume: 8 Number: 4285
Today's topics:
Re: htpasswd source code (+ crypt) <due@murray.fordham.edu>
Re: htpasswd source code (+ crypt) <br@ndon.com>
Re: htpasswd source code (+ crypt) <due@murray.fordham.edu>
Re: in need of some help (brian d foy)
Re: in need of some help (Tad McClellan)
Re: in need of some help (Steve Morris)
Re: in need of some help (Ronald J Kimball)
Re: Installed Module List <gellyfish@btinternet.com>
Is this the same as Net::FTP? (Timothy R Lux)
Re: Is this the same as Net::FTP? <prauz@sprynet.com>
Re: Launching two subroutines at the same time (Larry Rosler)
Re: MacPerl and makefiles (Jean-Marc Piuze)
Re: MacPerl and makefiles (John Moreno)
Mailprog <alex@digi-q.com>
Re: manipulating the last few lines of file efficiently <rakesh_puthalath@hotmail.com>
Re: Mastering Regular Expressions (was Re: Recommend Pe (Ilya Zakharevich)
Re: Mastering Regular Expressions (was Re: Recommend Pe <uri@fastengines.com>
Re: mkDir Question <airman@inreach.com>
Re: mkDir Question (Mike Stok)
Re: mkDir Question (Martien Verbruggen)
Re: mkDir Question <Allan@due.net>
Re: Net::Ping--any resolution to its use? <Alex.Davies@tiuk.ti.com>
Net::Ping bobs614@my-dejanews.com
Re: Net::Ping (Matthew Bafford)
newbie simple problem bkraymond@geocities.com
Re: newbie simple problem (Tad McClellan)
Opendir and Virtuel Directory <ronny.keiser@sd.be>
Re: Opendir and Virtuel Directory (Tad McClellan)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Nov 1998 00:46:01 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: htpasswd source code (+ crypt)
Message-Id: <73cvk9$30c$0@206.165.167.210>
Brandon L. Golm wrote in message <3659F64F.ED1A2FA9@ndon.com>...
>
>Here's a diff that corrects a fatal error in your code. I don't think
anyone
>could find anything without this fix!
Always test before you post.
Hah, you fall into my trap <grin>. Did you try my code as posted? For
reasons as yet unclear to me it runs just fine. It surprised me too. Go
ahead and run it, if it doesn't work tell me what version of Perl you are
running and on what system. I have tried it under three versions of Perl,
Unix and Windows, and it works under each.
AmD
[posted with cc to author]
------------------------------
Date: Mon, 23 Nov 1998 20:15:12 -0500
From: "Brandon L. Golm" <br@ndon.com>
To: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: htpasswd source code (+ crypt)
Message-Id: <365A08A0.2C1803F5@ndon.com>
[mailed & posted]
I certainly stand corrected, and I fervently apologize for my error. Like
they say, only perl can parse Perl. Certainly I'm no exception. However,
even though this code is syntactically correct, I don't think it a good idea
to promote using it.
My theory as to why it works is (and please correct me if I'm wrong):
perl is passing the result of 'require HTML::FormatText;' as a parameter to
'use HTML::Parse'. As a result, they both get called correctly.
use vars
require HTML::FormatText;
gives this error:
'1' is not a valid variable name
at this line 6
BEGIN failed--compilation aborted at this line 6.
So, '1' is being passed back to the import method of vars, which supports my
theory.
.brandon.
The code in discussion:
#!/usr/local/bin/perl -w
use strict;
use LWP::Simple;
use HTML::Parse
require HTML::FormatText;
my $htmlinfo =
get("http://ink.yahoo.com/bin/query?p=JAVA+crypt+htpasswd+crypt.c&hc=0&hs=4"
);
my $info = parse_html($htmlinfo);
my $formatter = new HTML::FormatText;
print $formatter->format($info);
"Allan M. Due" wrote:
> Brandon L. Golm wrote in message <3659F64F.ED1A2FA9@ndon.com>...
> >
> >Here's a diff that corrects a fatal error in your code. I don't think
> anyone
> >could find anything without this fix!
>
> Always test before you post.
>
> Hah, you fall into my trap <grin>. Did you try my code as posted? For
> reasons as yet unclear to me it runs just fine. It surprised me too. Go
> ahead and run it, if it doesn't work tell me what version of Perl you are
> running and on what system. I have tried it under three versions of Perl,
> Unix and Windows, and it works under each.
>
> AmD
>
> [posted with cc to author]
------------------------------
Date: 24 Nov 1998 02:21:09 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: htpasswd source code (+ crypt)
Message-Id: <73d56l$dlv$0@206.165.167.210>
Brandon L. Golm wrote in message <365A08A0.2C1803F5@ndon.com>...
>[mailed & posted]
>
>I certainly stand corrected, and I fervently apologize for my error.
Well, let's not go that far. I thought it was a mistake when I first saw my
own post. Hey, it still is an error to my way of thinking, just not a fatal
one :-).
> Like
>they say, only perl can parse Perl. Certainly I'm no exception. However,
>even though this code is syntactically correct, I don't think it a good
idea
>to promote using it.
Well, I wasn't promoting it per se. I actually just threw the script
together in response to off topic posts. I *did* test it before I posted
though <grin>.
>
>My theory as to why it works is (and please correct me if I'm wrong):
>
>perl is passing the result of 'require HTML::FormatText;' as a parameter to
>'use HTML::Parse'. As a result, they both get called correctly.
>
I think it is something like that. I tried:
#!/usr/local/bin/perl -w
use strict;
use LWP::Simple;
use HTML::Parse
my $huh = "what is going on";
print $huh;
and got:
"what is going on" is not exported by the HTML::Parse module at E:\TEMP.PL
line 5
I will play with it more tomorrow.
AmD
[posted and mailed]
------------------------------
Date: Mon, 23 Nov 1998 22:06:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: in need of some help
Message-Id: <comdog-ya02408000R2311982206120001@news.panix.com>
In article <3659E2F9.EE6AC0A4@pacbell.net>, jiyeung@pacbell.net posted:
> opendir(engops,".") || die "Cannot open directory";
>
> foreach (readdir(engops)) {
> print "<br><A HREF=http://www.cisco.com/$_>$_</A>";
> The script works fine now; however it is also reading out the "." and
> the ".."
try something like this:
@files = grep {$_ ne '.' and $_ ne '..'} readdir (...);
see the perlfunc man page for more details. :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 23 Nov 1998 19:14:10 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: in need of some help
Message-Id: <291d37.kbg.ln@flash.net>
Jimmy Yeung (jiyeung@pacbell.net) wrote:
: I wrote this script in order to print out the contents in a directory,
: and have it posted on a website, therefore allowing the website to be
: automated . . . it would update itself each time someone adds a file to
: the directory . . .
: #!/usr/local/bin/perl
You are missing the -w there.
#!/usr/local/bin/perl -w
: print "Content-type:text/html\n\n";
: chdir("/directory/directory/directory/directoryineedtopost") || die
: "Cannot open directory";
: opendir(engops,".") || die "Cannot open directory";
: foreach (readdir(engops)) {
: print "<br><A HREF=http://www.cisco.com/$_>$_</A>";
: print "<p>";
: }
: closedir(engops);
: The script works fine now; however it is also reading out the "." and
: the ".." , i tried adding a if (/^[^.]/) but it didnt seem to work . .
: how would i go about printing only the files that do not begin with a
: dot? I have tried globbing it ( <*> ) but it didnt work . . . it kept
: getting bugs when it brought up csh .. . so can anyone help? thank you!
opendir(ENGOPS, '/directory/directory/directory/directoryineedtopost') ||
die "could not open directory $!"; # no need to chdir() first...
foreach (grep /^[^.]/, readdir(ENGOPS)) {
print "stuff\n";
}
closedir(ENGOPS);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 24 Nov 1998 03:16:42 GMT
From: morris@rahul.net (Steve Morris)
Subject: Re: in need of some help
Message-Id: <73d8eq$30p$1@samba.rahul.net>
In article <3659E2F9.EE6AC0A4@pacbell.net>,
Jimmy Yeung <jiyeung@pacbell.net> writes:
> #!/usr/local/bin/perl
>
> print "Content-type:text/html\n\n";
>
> chdir("/directory/directory/directory/directoryineedtopost") || die
> "Cannot open directory";
> opendir(engops,".") || die "Cannot open directory";
>
> foreach (readdir(engops)) {
next if /^\./; # skip all filenames beginning with a '.'
> print "<br><A HREF=http://www.cisco.com/$_>$_</A>";
> print "<p>";
> }
> closedir(engops);
>
The added line will skip over any file beginning with '.'
use "next if /^\.{1,2}$/;" if you only want to suppress '.' and '..'
HTH
Steve
------------------------------
Date: Mon, 23 Nov 1998 23:40:48 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: in need of some help
Message-Id: <1diyxt0.zfpkj4q12la6N@bos-ip-2-212.ziplink.net>
Jimmy Yeung <jiyeung@pacbell.net> wrote:
> opendir(engops,".") || die "Cannot open directory";
>
> foreach (readdir(engops)) {
> print "<br><A HREF=http://www.cisco.com/$_>$_</A>";
> print "<p>";
> }
> closedir(engops);
>
> The script works fine now; however it is also reading out the "." and
> the ".." , i tried adding a if (/^[^.]/) but it didnt seem to work . .
> how would i go about printing only the files that do not begin with a
> dot?
That if() statement should work fine, depending on how you use it...
You could do something like this:
opendir(ENGOPS,".") || die "Cannot open directory";
while (defined($_ = readdir ENGOPS)) { # read one filename
next if /^\./; # skip if begins with dot
print "<br><A HREF=http://www.cisco.com/$_>$_</A>\n",
"<p>\n";
}
closedir(ENGOPS);
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 23 Nov 1998 22:51:56 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Installed Module List
Message-Id: <73couc$is$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Parabola <parab0la@my-dejanews.com> wrote:
> Hi all!
>
> Is there any way to list out all the installed PERL modules?
> Preferably in a nice shell / interface like CPAN.
>
If you search this newsgroup on DejaNews for a thread with a subject
"How can I find out..." you will find several answers given.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 23 Nov 1998 22:42:34 PST
From: tim-usenet@pbisweb.com (Timothy R Lux)
Subject: Is this the same as Net::FTP?
Message-Id: <73dkgq$cb0@chronicle.concentric.net>
Hi:
I attempted to use the Net::FTP module and related code to transfer files from
one server to another. The error message I received indicated the module may
not have been installed on the server by the ISP. They did provide a list of
installed PERL modules, and I saw the following (among others):
/site_perl/URI/URL/ftp.pm
/site_perl/LWP/Protocol/ftp.pm
/site_perl/LWP/Socket.pm
/Getopt/Std.pm
/Getopt/Long.pm
/Net/Ping.pm
(you can see the full list at http://www.hiway.com/support/perl_modules.shtml)
Can I use the same (or any?) code for my Net::FTP by calling any of these
modules?
I will attempt to get them to install Net::FTP next.. :)
Thanks--
Tim
------------------------------
Date: Tue, 24 Nov 1998 10:00:04 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
To: tim-usenet@pbisweb.com
Subject: Re: Is this the same as Net::FTP?
Message-Id: <365A83A4.614ABDB6@sprynet.com>
Timothy R Lux wrote:
> I attempted to use the Net::FTP module and related code to transfer files from
> one server to another. The error message I received indicated the module may
> not have been installed on the server by the ISP. They did provide a list of
> installed PERL modules, and I saw the following (among others):
>
> /site_perl/URI/URL/ftp.pm
> /site_perl/LWP/Protocol/ftp.pm
> /site_perl/LWP/Socket.pm
> /Getopt/Std.pm
> /Getopt/Long.pm
> /Net/Ping.pm
>
> (you can see the full list at http://www.hiway.com/support/perl_modules.shtml)
>
> Can I use the same (or any?) code for my Net::FTP by calling any of these
> modules?
>
> I will attempt to get them to install Net::FTP next.. :)
For NET::FTP to work you'd hava to have a directory called NET in your
@INC and a file called FTP.pm in that directory. This implies two things
to me:
1. You don't have it right now.
2. You can beg Hiway to install it, which would be good as I also have
my page on Hiway, but a faster solution is just creating a mymodules
subdierctory and installing it (and all other modules) there. In this
case you start every perl program by:
BEGIN {
push( @INC, "/mymodules");
}
to modify @INC.
Hope it helped:
Balazs
------------------------------
Date: Mon, 23 Nov 1998 17:35:22 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Launching two subroutines at the same time
Message-Id: <MPG.10c3ad35950210c898988a@nntp.hpl.hp.com>
In article <911863842.219707@thrush.omix.com> on 23 Nov 1998 23:35:27
GMT, Zenin <zenin@bawdycaste.org> says...
> Jim Mamay <jim.mamay@uchsc.edu> wrote:
> : --------------36E68C84FB56DC65CF18AC5B
> : Content-Type: text/html; charset=us-ascii
> : Content-Transfer-Encoding: 7bit
>
>
> Please don't post in HTML, *ever*. Thanks.
Hmmm. My newsreader, a nifty number called MicroPlanet Gravity 2.10,
has a checkbox option that reads, "Don't show HTML source", so I never
notice these things. Of course, it runs only on PoB systems. :-)
Now if I could only get it to ignore those nasty 'vcard's, everything
would be great!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 23 Nov 1998 22:30:43 -0500
From: jmp@mlink.net (Jean-Marc Piuze)
Subject: Re: MacPerl and makefiles
Message-Id: <jmp-ya02408000R2311982230430001@nntp.mlink.net>
In article <36588EF2.268B@erols.com>, dejahvu@erols.com wrote:
>I am writing Perl code on my Mac and do most of my preliminary testing
>there. I downloaded a module from CPAN and it has this makefile.pl which
>crashes MacPerl. Someone tells me that MacPerl doesn't have that
>capability... S'okay.... so how do I use the wonderful module?
So, do you use Perl5 instead of the fourth version? After installing this 5th
version, I lost almost all encountered problems before.
>Now let's make it more difficult. My target system is Unix... it's a CGI
>script for my web site. What do I do with that module to make it work in
>both places. If it makes any difference, I am with a web host and have
>no control of the server environment etc.
I do almost the samething. I have already developped a little application (45k)
running both on Unix and my PowerMac. Just 2 littles things are
different for running on my Mac.
So, for a web site, you need to know environments variables available by the html
server on the unix server. And few others things to get started, and having your
application correctly tie up with the html server. I mean stdin and stdout correctly used to return next web page to the client side.
Now look. I'm not an expert in Perl anyway. But I wonder how to save odsr read
a file outside of the current working directory. In Unix, I use "../" to go up
for one level whitout knowing the full path. I mean how can I specified relatives
directory in my Perl script running on my Mac?..
Thanks! =-)
jmarc...
------------------------------
Date: Tue, 24 Nov 1998 09:28:05 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: MacPerl and makefiles
Message-Id: <1diz2it.111w3tz1vrvgj0N@roxboro0-044.dyn.interpath.net>
Jean-Marc Piuze <jmp@mlink.net> wrote:
(crossposted and followups set).
> In article <36588EF2.268B@erols.com>, dejahvu@erols.com wrote:
-snip-
> Now look. I'm not an expert in Perl anyway. But I wonder how to save
> odsr read a file outside of the current working directory. In Unix, I use
> "../" to go up for one level whitout knowing the full path. I mean how
> can I specified relatives directory in my Perl script running on my Mac?..
I'd suggest asking this in alt.comp.lang.applescript (despite the name
MacPerl questions are welcomed).
Also - I think you need to specify whether you want to go up or down.
But if I'm not mistaken "::name" moves you back towards the HD and
":name" is form your current base (changable by using chdir -- I'm not
sure how you get the current directory off hand, probably some where in
@INC).
--
John Moreno
------------------------------
Date: Tue, 24 Nov 1998 10:43:10 -0800
From: Alex Guberman <alex@digi-q.com>
Subject: Mailprog
Message-Id: <3659F256.2406@digi-q.com>
Hi,
Does anybody know how to make "undeliverable" messages to come back to
the reply-to address and not to the server admin, when sending e-mails
through mailprog?
Thank you.
Alex
------------------------------
Date: Tue, 24 Nov 1998 14:59:59 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: Re: manipulating the last few lines of file efficiently?
Message-Id: <365A596E.9544DB22@hotmail.com>
Since you do last 4 line processing, after producing the file , why not use
the pipe and some sed scripts?.
Else, do the modification, only for 4 lines when you produce the file.
This is just a thought, not tried out myself.
Rakesh
Chen Wang wrote:
> Hi, I have a perl script that produces a large text file (unknown in
> length).
> When I am done, I'd like to change the last 4 lines produced. An
> efficient
> solution will be traversing backward from eof with the file handle
> and modify the file accordingly. But I don't see a clean function that
> does
> that. A couple of things I've tried:
>
> 1) read the FAQ, doesn't present efficient solutions
> 2) tried buffering 4 lines, but complicates old code
>
> Anyone has suggestions?
>
> -Chen
------------------------------
Date: 24 Nov 1998 05:44:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Mastering Regular Expressions (was Re: Recommend Perl books?)
Message-Id: <73dh40$ese$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@sysarch.com>],
who wrote in article <x71zmu1gp9.fsf@sysarch.com>:
> IZ> The Hip Owl is about what is good, what is bad and what is ugly. A
> IZ> speedier REx engine will change all this. An engine without bugs will
> IZ> change this (well, I know about 3 obscure bugs with the currentn code ;-).
>
> it is also about what regex ops mean,
This level of discussion is not that Perl-specific;
> how to do stuff,
This has changed;
> pitfalls,
This has changed;
> and as you say efficiency.
This has changed;
> also the comparisons to other programs' regex engines is
> enlightening. the book isn't only about perl (tho' much of it is).
Exactly: I was explicitly discussion Perl-related part. It is
enlightening, but is not a programmer's reference any more.
Ilya
------------------------------
Date: 24 Nov 1998 12:58:00 -0500
From: Uri Guttman <uri@fastengines.com>
To: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Mastering Regular Expressions (was Re: Recommend Perl books?)
Message-Id: <sarogpx9dnb.fsf@camel.fastserv.com>
>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
IZ> This level of discussion is not that Perl-specific;
it is because people always ask why are perl's regexes better than
others. MRE covers that issue well. things have changed since then but
it is still a relevant issue to discuss here.
>> how to do stuff,
IZ> This has changed;
how (details)?
>> pitfalls,
IZ> This has changed;
how (details)?
>> and as you say efficiency.
IZ> This has changed;
how (details)?
>> also the comparisons to other programs' regex engines is
>> enlightening. the book isn't only about perl (tho' much of it is).
IZ> Exactly: I was explicitly discussion Perl-related part. It is
IZ> enlightening, but is not a programmer's reference any more.
i never said it was a reference. only the highly accurate :-) online
docs can be called that. but MRE covers enough perl regex stuff (even if
some is outdated) to be a very useful book. i even used it the other
night to check on something regarding grouping and /g. that hasn't
changed (i hope) and it was easier to use than the camel for the info i
wanted.
i think your perspective is very biased being the regex core guy. from a
pure user point of view (which i have a better angle on) MRE is still
good. i even heard from an o'reilly editor about this thread and he said
that they would like an update but freidl is too busy with work. maybe
you could take up that mantle and add your name to the masthead? you
seem to be the only regex guru who could do justice to the update. but
can you write as well as friedl? :-)
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 24 Nov 1998 00:04:31 GMT
From: "L. Birdwell" <airman@inreach.com>
Subject: Re: mkDir Question
Message-Id: <3659F8A8.3444D003@inreach.com>
So, by ignorant deduction:
If - umask 002; will yeild 775 then umask 000; must yield 777 in this case?
Tried it and it worked for me. By the way, being a total nubie at this, how do
you run the perlman thingy? I have entered perl by itself once and got stuck in
there. Didn't even know how to get out!!
Martien Verbruggen wrote:
> In article <3659E95F.EA7C9C7D@inreach.com>,
> "L. Birdwell" <airman@inreach.com> writes:
> > mkdir("$path/$dir", 0777)
> >
> > Shouldn't this make a directory with 777 permissions?
>
> # perldoc -f mkdir
> =item mkdir FILENAME,MODE
>
> Creates the directory specified by FILENAME, with permissions specified
> by MODE (as modified by umask).
> ^^^^^
> # perldoc -f umask
>
> Now, the umask is a reasonably complex thing. Basically, the bits set
> in the umask will be cleared with the permissions you hand to mkdir.
>
> umask 002;
> mkdir ("blabla", 0777);
>
> This will result in a directory with permissions 0775.
>
> Martien
> --
> Martien Verbruggen | My friend has a baby. I'm writing down
> Webmaster www.tradingpost.com.au | all the noises the baby makes so later
> Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
> NSW, Australia | Wright
------------------------------
Date: 24 Nov 1998 00:23:45 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: mkDir Question
Message-Id: <73cuah$agr@news-central.tiac.net>
In article <3659E95F.EA7C9C7D@inreach.com>,
L. Birdwell <airman@inreach.com> wrote:
>mkdir("$path/$dir", 0777)
>
>Shouldn't this make a directory with 777 permissions? If not, I would
>appreciate input on how you would do it. It seems to be creating the
>directories in 755 mode. My ISP is one of those who will not allow 777
>in the cgi-bin directory so maybe this has something to do with it.
You need to modify your umask, from the perlfunc docs:
mkdir FILENAME,MODE
Creates the directory specified by FILENAME, with
permissions specified by MODE (as modified by
umask). If it succeeds it returns TRUE, otherwise
it returns FALSE and sets $! (errno).
so if you have a umask of 022 and try and make a directory with mode 0777
you'll end up with an 0755 as the bits in umask mask out bits in the
permissions you specify.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Tue, 24 Nov 1998 01:40:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: mkDir Question
Message-Id: <n8o62.68$Jo2.233@nsw.nnrp.telstra.net>
In article <3659F8A8.3444D003@inreach.com>,
"L. Birdwell" <airman@inreach.com> writes:
> If - umask 002; will yeild 775 then umask 000; must yield 777 in
> this case?
Indeed.
> By the way, being a total nubie at this, how do you run the perlman
> thingy? I have entered perl by itself once and got stuck in there.
> Didn't even know how to get out!!
>From your command prompt (not inside of perl) type
# perldoc perldoc
# perldoc perl
# perldoc -f mkdir
(Without the #, that represents the prompt).
When you just type 'perl', you enter pel, and it expects input. All
you need to do is send it some EOF. On unix this is normally ctrl-D,
on NT I believe it's ctrl-Z.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
Date: Tue, 24 Nov 1998 09:49:25 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: mkDir Question
Message-Id: <73egon$r6r$1@camel0.mindspring.com>
Martien Verbruggen wrote in message ...
>In article <3659F8A8.3444D003@inreach.com>,
> "L. Birdwell" <airman@inreach.com> writes:
>> If - umask 002; will yeild 775 then umask 000; must yield 777 in
>
>> this case?
>
>Indeed.
>
>> By the way, being a total nubie at this, how do you run the perlman
>> thingy? I have entered perl by itself once and got stuck in there.
>> Didn't even know how to get out!!
>
>From your command prompt (not inside of perl) type
>
># perldoc perldoc
># perldoc perl
># perldoc -f mkdir
>
Quite annoyingly, this is broken (or purposively left out) on the latest
version of activestate's perl. They include perldoc.bat but no pod files so
everything is returned not found. Yuck.
AmD
------------------------------
Date: Tue, 24 Nov 1998 12:59:26 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: gches@goodnet.com
Subject: Re: Net::Ping--any resolution to its use?
Message-Id: <365AADAE.64FCAD3A@tiuk.ti.com>
Geoffrey T. Cheshire wrote:
> Hi all,
>
> Apropos the thread a while back on Net::Ping, I never did see a solution
> posted. I'm trying to use the package as documented, but get the
> following error:
>
> Use of uninitialized value at
> /usr/lib/perl5/5.00502/i586-linux/Socket.pm line 275.
> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16
> at
> /usr/lib/perl5/5.00502/i586-linux/Socket.pm line 275.
>
> The relevant code is:
>
> my $p = Net::Ping->new();
> print "$host is alive.\n" if ($p->ping($host, $timeout));
> $p->close();
>
> Any ideas?
>
> Thanks,
>
> Geoff
>
> --
> Geoffrey T. Cheshire
Running this code here on "version 5.005_02 built for sun4-solaris"
works... not
that helps you ;)
To nail the problem down, try running it under the debugger....
For what its worth here's what my copy turned up:
nperl -d deme
Loading DB routines from perl5db.pl version 1.0401
Emacs support available.
Enter h or `h h' for help.
main::(deme:6): my $p = Net::Ping->new();
DB<1> s
Net::Ping::new(/usr/local/lib/perl5.00502/share/Net/Ping.pm:59):
59: my ($this,
60: $proto, # Optional protocol to use for pinging
61: $timeout, # Optional timeout in seconds
62: $data_size # Optional additional bytes of data
63: ) = @_;
DB<1>
.
.
DB<1> s
Socket::sockaddr_in(/usr/local/lib/perl5.00502/sun4-solaris/Socket.pm:274):
274: croak "usage: (port,iaddr) = sockaddr_in(sin_sv)" unless @_ == 1;
DB<1> w
271: carp "6-ARG sockaddr_in call is deprecated" if $^W;
272: pack_sockaddr_in($port, inet_aton(join('.', @quad)));
273: } elsif (wantarray) {
274==> croak "usage: (port,iaddr) = sockaddr_in(sin_sv)" unless @_ == 1;
275: unpack_sockaddr_in(@_);
276 } else {
277: croak "usage: sin_sv = sockaddr_in(port,iaddr))" unless @_ == 2;
278: pack_sockaddr_in(@_);
279 }
280 }
DB<1> s
Socket::sockaddr_in(/usr/local/lib/perl5.00502/sun4-solaris/Socket.pm:275):
275: unpack_sockaddr_in(@_);
DB<1> x @_
0 "\c@\cD\c@\cE'ZK\c@\c@\c@\c@\c@\c@\c@\c@"
DB<2> s
Net::Ping::ping_udp(/usr/local/lib/perl5.00502/share/Net/Ping.pm:375):
375: if (($from_ip eq $ip) && # Does the packet check
out?
376: ($from_port == $self->{"port_num"}) &&
377: ($from_msg eq $msg))
378: {
alex.
------------------------------
Date: Tue, 24 Nov 1998 15:44:22 GMT
From: bobs614@my-dejanews.com
Subject: Net::Ping
Message-Id: <73ek8j$q9o$1@nnrp1.dejanews.com>
Could someone send me and example of Net::Ping, I have written a small
piece of code that every time I run it, it reports an Unsupported Function
Alarm.
Thanks in Advance
Bob S.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 24 Nov 1998 12:39:39 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Net::Ping
Message-Id: <MPG.10c4b965eb5e5b02989733@news.scescape.net>
In article <73ek8j$q9o$1@nnrp1.dejanews.com>, bobs614@my-dejanews.com
says...
=> Could someone send me and example of Net::Ping, I have written a small
=> piece of code that every time I run it, it reports an Unsupported Function
=> Alarm.
It does? Hmm, Alarm should just say:
Undefined subroutine &main::Alarm called at -e line 1.
Wait! Maybe you mean alarm? Nah, you would have said that if that's what
you meant...
AFAIK, alarm is not supported on some systems, most notably those of the
POB variety.
=> Thanks in Advance
HTH!
=> Bob S.
--Matthew
------------------------------
Date: Tue, 24 Nov 1998 07:18:46 GMT
From: bkraymond@geocities.com
Subject: newbie simple problem
Message-Id: <73dmki$4k3$1@nnrp1.dejanews.com>
What is the easiest way to output information to a file and then retrieve it
later.
Simple Example:
$x=1;
$y=2;
save x and y to a file and then later retrieve the data and display it to the
screen.
ThanQ, well in advance.
BKR
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 24 Nov 1998 11:25:34 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: newbie simple problem
Message-Id: <e6qe37.rqj.ln@flash.net>
bkraymond@geocities.com wrote:
: What is the easiest way to output information to a file and then retrieve it
: later.
perldoc -f open
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 24 Nov 1998 12:39:51 +0100
From: Keiser Ronny <ronny.keiser@sd.be>
Subject: Opendir and Virtuel Directory
Message-Id: <365A9B07.3116@sd.be>
Hello,
I am trying to build a HTML page based on files listed on another
server. With opendir() I'm able to create this HTML, and it works om
DOS.
But, if I run it via the WEB, using CGI, the program fails to read (
open ) the specified DIR.
I tried creating a virtuel directory, didn't work ( even with a mapping
on this other server, net use, no success).
Then I tried Win32 stuff, but failed again.
Does anyone have a solution for my dir-problem ?
I'm working on a WIN-NT, IIS4 environment, Perl 5.004 something.
Here's an extract from my script.
$direct = "L:\\Infotec\\Methoden&Standaarden";
opendir (DIER, "$direct");
print "Content-type: text/html
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">
<head>
<title> Standaarden</title>
</head>
<CENTER>
<BODY BACKGROUND='../gif/zenobg.gif'>
<h2> Standaarden</h2>
</CENTER>
<FORM>
<OL>
";
while ($filename = readdir(DIER))
{
if ($filename =~ /.doc$/i)
{
print "<LI><A HREF = \"L:/INFOTEC/Methoden&Standaarden/" .
$filename . "\"><H1><B>" . $filename . "</B></H1></A></LI>\n";
}
}
print"
</OL>
</FORM>
</BODY>
</HTML>
";
closedir(DIER);
------------------------------
Date: Tue, 24 Nov 1998 11:41:02 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Opendir and Virtuel Directory
Message-Id: <e3re37.ltj.ln@flash.net>
Keiser Ronny (ronny.keiser@sd.be) wrote:
: I am trying to build a HTML page based on files listed on another
: server. With opendir() I'm able to create this HTML, and it works om
: DOS.
: But, if I run it via the WEB, using CGI, the program fails to read (
: open ) the specified DIR.
: I tried creating a virtuel directory, didn't work ( even with a mapping
What is a virtual directory?
: on this other server, net use, no success).
: Then I tried Win32 stuff, but failed again.
: Does anyone have a solution for my dir-problem ?
: I'm working on a WIN-NT, IIS4 environment, Perl 5.004 something.
: Here's an extract from my script.
: $direct = "L:\\Infotec\\Methoden&Standaarden";
$direct = 'L:\Infotec\Methoden&Standaarden'; # single quotes so
# no escaping of escapes
# is needed
: opendir (DIER, "$direct");
^ ^
opendir (DIER, $direct) || die "could not open '$direct' $!";
Check the return value. The opendir() might *fail* you know...
Print the $! special variable for a clue as to why it failed.
Double quotes server no purpose there.
: print "Content-type: text/html
: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">
You need a blank line between the above two lines to mark
the end of the headers.
: <head>
: <title> Standaarden</title>
: </head>
: <CENTER>
: <BODY BACKGROUND='../gif/zenobg.gif'>
: <h2> Standaarden</h2>
: </CENTER>
: <FORM>
: <OL>
: ";
: while ($filename = readdir(DIER))
: {
: if ($filename =~ /.doc$/i)
That will match if $filename = 'ddoc'...
if ($filename =~ /\.doc$/i)
^^
^^ escape if a literal dot is wanted
You can do the filtering more clearly (IMO) thus:
foreach $filename (grep /\.doc/i, readdir(DIER)) # instead of while/if
Though that approach will use more memory...
: {
: print "<LI><A HREF = \"L:/INFOTEC/Methoden&Standaarden/" .
: $filename . "\"><H1><B>" . $filename . "</B></H1></A></LI>\n";
: }
You can use a here-doc to make it easier to read and avoid backslashes:
print<<ENDHTML;
<LI>
<A HREF = "L:/INFOTEC/Methoden&Standaarden/$filename">
<H1><B>$filename</B></H1>
</A>
</LI>
ENDHTML
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4285
**************************************