[8380] in Perl-Users-Digest
Perl-Users Digest, Issue: 1997 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 1 14:15:24 1998
Date: Sun, 1 Mar 98 11:00:29 -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 Sun, 1 Mar 1998 Volume: 8 Number: 1997
Today's topics:
.htpasswd.pag & .htpasswd.dir (what's the different?) (Pls don't kill my post, thanks!)
Re: A pipe to telnet is opened for input? (Nathan V. Patwardhan)
a2p (awk to perl) translator <hansen@sharptech.win-uk.net>
Re: call URL from perl? <mindmore@mindless.com>
Conflict in this Newsgroup <shaker@netusa1.net>
Re: Cookies Too many clowns heres your answer <mindmore@mindless.com>
Re: Easy way to "clean" an array (Abigail)
Re: Easy way to "clean" an array <merlyn@stonehenge.com>
Re: Form-to-EMail - Have Some Code <webdesing@djem.net>
Getting name of script without absolute path. (sebu)
Re: Home Page Click. <mindmore@mindless.com>
Perl & MS SQL Server <sebfrey@advancedh2o.com>
Perl file mode? <dvermes@emerald.tufts.edu>
Problem installing PERL 5.004_04 on Linux Red-Hat 5.0 (root)
Re: Problem installing PERL 5.004_04 on Linux Red-Hat 5 (Mike Heins)
Re: Problem installing PERL 5.004_04 on Linux Red-Hat 5 (Michal Jaegermann)
Re: Q: splice() time complexity, want linked lists? <joseph@5sigma.com>
Question for Tom Christiansen <RobertMac@worldnet.att.net>
Re: Question for Tom Christiansen (Nathan V. Patwardhan)
Re: replace a word in file... (Michal Jaegermann)
Re: replace a word in file... (David Alan Black)
Re: Running a perl script on Windows 95 <kathleen_ramsey@email.msn.com>
Re: search engine (Abigail)
Re: The Ineffable Tom C. <merlyn@stonehenge.com>
Re: Wanted: Perl author for small project (Nathan V. Patwardhan)
Re: Wanted: Perl author for small project (Oliver Harvey)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 01 Mar 1998 16:31:53 GMT
From: plasma@hknet.com (Pls don't kill my post, thanks!)
Subject: .htpasswd.pag & .htpasswd.dir (what's the different?)
Message-Id: <34f98d0c.22521359@news.hknet.com>
.htpasswd.pag & .htpasswd.dir (what's the different?)
the DBM of perl create two file for one database,
what's there different actually, seems sometime with the same size,
but sometimes is not,
thanks!
------------------------------
Date: 1 Mar 1998 15:19:19 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: A pipe to telnet is opened for input?
Message-Id: <6dbu9n$30p@fridge.shore.net>
Robert Mac (RobertMac@worldnet.att.net) wrote:
: Dear Sir or Madam
Dear trifled @ worldnet.att.net,
: I want to send an email message using the rcpt to: in telnet.
I'm wondering what's wrong with Net::SMTP that's included with the
libnet modules.
: How do you pass the telnet command lines from a perl script once you open
: telnet for input?
If you *insist* on doing it this way, use the Net::Telnet module.
--
Nathan V. Patwardhan
------------------------------
Date: Sun, 01 Mar 1998 18:46:17 +0000
From: Kare Hansen <hansen@sharptech.win-uk.net>
Subject: a2p (awk to perl) translator
Message-Id: <34F9ACF9.1227093B@sharptech.win-uk.net>
Hi,
I've just moved from a UNIX to a NT environment, and have a number of
awk scripts which I would like to translate into Perl. The scripts are
to large/complex to be translated by hand and I saw somewhere that
there is an awk to Perl translator called a2p.
I've had a look around the net and found the c code for this utility,
but no executables and as we are a VB/Delphi shop I havet no access to a
c-compiler for NT4/Win95. Is there anyone out there who has an a2p
executable for NT or (even better) a a2p Perl script.
Why the utility has been written in c in the first place and not Perl, I
find difficult to understand.
Cheers,
Kare Hansen
------------------------------
Date: Sun, 01 Mar 1998 18:28:14 +0200
From: Fain <mindmore@mindless.com>
Subject: Re: call URL from perl?
Message-Id: <34F98C9E.D5842CE0@mindless.com>
RAYMOND CHEONG wrote:
Here is how you do it:
#!/my/perl5/path
$URL="http://www.yahoo.com";
print "Location: $URL\n\n";
The most important thing is that if you put
print "Content-type: text/plain\n\n";
it comes after
print "Location: $URL\n\n";
Like this:
#!/my/perl5/path
$URL="http://www.yahoo.com";
print "Location: $URL\n\n";
print "Content-type: text/plain\n\n";
All of the other ways just wont work. Let me know if you have any troubles.
- Nathan
mindmore@mindless.com
http://www.actcom.co.il/~fain
> On Thu, 19 Feb 1998, stevenchan wrote:
>
> > as i know, you should cancell the line
> > >print "Content-Type: text/plain\n\n";
> > to make the program to work as you want. try it.
> >
> > On Tue, 17 Feb 1998 18:00:42 -0500, Mukund Rao <mrao@nospam.com>
> > wrote:
> >
> > >Hello. I noticed an old posting and tried to repeat your advice.
> > >
> > >I did:
> > >
> > >#!/my/perl5/path
> > >
> > >$URL="http://www.yahoo.com";
> > >print "Content-Type: text/plain\n\n";
> > >print "Location: $URL\n";
> > >exit 0;
>
> I am not sure if someone else has answered your question. Anyway, I think
> what you want is the following,
>
> print "Content-type: text/plain\n\n";
> $URL="http://www.yahoo.com";
> print "Location: <A HREF=\"$URL\"> Go to Yahoo </A>";
>
> Hope it helps.
>
> Raymond
>
> > >
> > >...all this does is actually "print" Location: http://www.yahoo.com on my
> > >screen and doesn't actually "go" there. Please advise.
> > >
> > >PLEASE REPLY TO MRAO@TRINCOLL.EDU -- Thanks.
> > >
> > >On Thu, 23 May 1996, Eike Grote wrote:
> > >
> > >: Hello !
> > >:
> > >: Charles Wyatt wrote:
> > >: >
> > >: > I'm aware of how to generate HTML code within a perl script using
> > >: > print "Content-type: text/html\n\n"; # etc, etc!
> > >: >
> > >: > Is there a manner by which I can call a URL from a perl script that
> > >: > will in turn (of course) retrieve an HTML document?
> > >:
> > >: If you use
> > >:
> > >: print "Location: $URL\n\n";
> > >:
> > >: the browser will fetch and display the page specified by $URL.
> > >:
> > >:
> > >: Hope this helps, Eike
> > >:
> > >: =====================================================================
> > >: Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
> > >: email : eike.grote@theo.phy.uni-bayreuth.de
> > >: URL : http://btrzxa.fddi.uni-bayreuth.de/~btpa25/
> > >: =====================================================================
> > >:
> > >:
> > >
> > > _ _ ____
> > >| \ / | \ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > >| \/ | () / Mukund Rao | webmaster@trincoll.edu
> > >| | |\ \ "visualize whirled peas" | Trinity College 860-297-4216
> > >|_|\/|_|_| \_) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >
> >
> >
>
> "If there was any other way...
> Don't you think I've tried to find it..."
------------------------------
Date: 1 Mar 1998 17:19:40 GMT
From: "V. Chandrasekhar" <shaker@netusa1.net>
Subject: Conflict in this Newsgroup
Message-Id: <01bd4536$0f8707a0$7eaa8bcd@space.netusa1.net>
1. Most of yesterday, I have been thinking about what I am posting
in present post. However, I quite don't have the time to develop
the arguments fully, today. If there is interest, I will consider
doing it at a later time. Here, I present these in outline form.
2. Two types of interactions may be identified in people relations:
Master - Disciple (MD) (Rare in msot places)
Consumer - Producer (CP) (Very common)
Some Perl masters want this newsgroup (NG) to operate MD. Some
'disciples' are perfectly willing to do this, because of what they
are able to learn. They also feel that this is how this NG should
function. Some feel that this is how it functioned - pre 1993.
Disciple is expected to show a lot of self-discipline, not ask
anything that will anger the master, only ask things that provide
the master at least some measure of amusement, in general let the
master dictate, make sure that they don't piss him off, [walk at
least three steps behind the master, genuflect at least three times
a day :) ]etc.
At least some posters come expecting a measure of the CP
relationship. They expect not to be insulted when they ask
questions (after all, they are asking questions on Perl not Rig
Veda). Some of them are long term users in other NGs where many of
the attempted strictures of this NG (for instance, what e-mail
addresses will be tolerated, whether address munging may be used as
a form of spam control or not) are not present.
3. When the Perl masters teach courses, almost certainly a CP
relationship applies; nobody's head is bitten off when the students
ask a FAQ or a CGI question in a Perl class.
4. When the Perl masters publish books, again a CP relationship is
evident. The various animal books go to considerable trouble to
create an air of friendliness and an including / accepting
community.
5. Between a poster and his ISP, there is a CP relationship. The
ISP gives each subscriber the right to post in all groups. The ISP
takes care of the necessary infrastructure, upstream feed,
downstream feed, whatever. DejaNews provides this too as a free
service.
6. This NG is where the two cultures clash. Do the Perl masters and
their supporters have the right to allow only MD interactions,
chasing the other group away by insults, whatever ? How are they
going to do it ? By making this a moderated NG ? Otherwise, the
battle may continue. (Note, I am NOT saying I am going to fight
continue the battle; I am NOT going to.) New folks are going to be
coming in all the time and do things like other newcomers in the
past.
7. I don't see commercialism on the part of Perl masters in this NG
at all. Perhaps this is a part of the problem. Maybe this is an
interest not being served at the present time. Supporting Perl
masters, developers and implementors (by buying their products and
services) is good for Perl. Perhaps stronger promotion of these in
this NG (say a once weekly auto-posting such as the miniFAQ) could
be encouraged. The masters may feel uncomfortable that this may
lead to criticism that they are using the NG solely for their own
purposes. However, this is someone else's - me, an outsider's -
idea; not theirs. Someone else can write the promo. I will be glad
to write an initial version. If this is done, maybe the masters may
not feel as much that people are stealing their intellectual
property (taking the last shilling out of their pocket). I have
absolutely no problem if the interests of the masters are strongly
promoted here. Maybe there a netiquette deprecating this type of
promotion. However, who is going to enforce this ? What if the
majority had no problems with this type of promotion - can't this
be done ?
8. What about the interests of the newcomers to Perl ? How about
setting up another newsgroup where atmosphere is definitely not so
MD ? The masters need not respond to posts here at all, other than
promoting their products, unless they want to. Something like
'comp.lang.perl.intro'.
9. I also suggest that the mini-FAQ be beefed up describing the
ground rules better, in a polite tone. For instance, the following
may be added:
. Perl5 is the only focus of clpm (and not Perl4; sorry this has
been discussed and agreed upon)
. Posters ARE expected to have made the expected effort via books,
Dejanews, and man pages before posting
. Top 10 most commonly asked questions included in the miniFAQ
itself along with brief answers.
10. What exactly am I saying here in this whole post ? Instead of
resorting to insults and abuses (which utterly destroy the spirit
of bonhomie the cute animal books go to so much trouble to create),
TMTOWTDI - there may be more than one way to achieve the intended
results (with everybody coming off better in the bargain). Let's
make it win-win (including allowing/providing a way for win32s to
thrive).
Peace and Regards.
Venkataraman ("Shaker") Chandrasekhar
------------------------------
Date: Sun, 01 Mar 1998 18:01:34 +0200
From: Fain <mindmore@mindless.com>
To: steve <me@here.com>
Subject: Re: Cookies Too many clowns heres your answer
Message-Id: <34F9865E.260E7E03@mindless.com>
steve wrote:
> first, you need to set your cookie with an expiration date in the
> future, no expiration date = cookie lost when browser closed.
> then, script asks if the cookie exists when they next enter the
> script. cookies are set in the server headers before the text/html
> header. goto netscape.com, they have a good example/s of setting
> cookies.
>
> On Sun, 22 Feb 1998 09:46:49 GMT, dutchie@dutch.nl (Dutchie) wrote:
>
> >I'am searching how to make a cookie into a shopping programm, if the
> >visiter leaves the site (after making a order but canceled it) and
> >comes back in lets say 8 hours he/she becomes a cookie with the
> >question :
> >Would you like to continue your order yes or no.
> >
> >I'am willing to pat for it
> >With kind regards
> >Jan
Have you thought about using cookies in JavaScript instead of
CGI/perl, it will probally be faster and easer? Just a thought.
- Nathan
------------------------------
Date: 1 Mar 1998 16:03:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Easy way to "clean" an array
Message-Id: <6dc0s0$q0k$1@client2.news.psi.net>
Joe Gottman (joegottman@nospam.worldnet.att.net) wrote on 1643 September
1993 in <URL: news:6dbol6$bur@bgtnsc02.worldnet.att.net>:
++
++
++
++ This works, but it is very inefficient (Order n^2 as opposed to order n).
++ Basicly,
++ you are not using the fact that the original array is sorted already. Here is
++ an efficient algorithm:
++
++ my $prev;
++ my @new_array;
++ foreach $elt (@array)
++ {
++ if ($elt eq $prev)
++ {
++ push @new_arry, $elt;
++ $prev = $elt;
++ }
++ }
++ return @new_array;
Or in one line: @unique = grep {!$h {$_} ++} @array;
(@array doesn't have to be sorted).
It's also a FAQ.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 01 Mar 1998 09:34:24 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Easy way to "clean" an array
Message-Id: <8c90quxtdb.fsf@gadget.cscaper.com>
>>>>> "Lloyd" == Lloyd Zusman <ljz@asfast.com> writes:
Lloyd> @hash{@array1} = undef;
Lloyd> @array2 = sort keys %hash;
Ewww. What I don't like about that solution is the use of undef in a
list context. That makes a single-element list, not a zero-element
list, and will likely lead someone else down a dark tunnel with no
cheese at the end someday.
Better to use the canonical solution:
@array2 = do { my %hash; @hash{@array1} = (); keys %hash };
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 183 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 01 Mar 1998 01:04:56 -0500
From: ";8-) DjemNet" <webdesing@djem.net>
To: Troy Denkinger <troy@whadda.com>
Subject: Re: Form-to-EMail - Have Some Code
Message-Id: <6dc83n$itj$1@gte2.gte.net>
Hi!
Can this code work for posting on a NewsServer??
Because It looks like it can if setting mail server to newsserver and the
recipient to the news group.
Please let me know. Well I will try to do that .
I think this code is cool because it will contact the mail server instead of
using the perl path.
Keep up the good work, Talk 2 u later.
P.S. Do you know where I can find a logo that says Powered by Perl
att..: ;8-) DjemNet
webdesign@djem.net
http://www.djem.net/
-=-=-=-=-=-=-=-=-=-=-=-=-=
Troy Denkinger wrote:
> In article <34F86282.6565@highsierra.com>, tmaufr@highsierra.NOSPAM.com wrote:
> >For the many who are asking about email forms processing in perl
> >Form-to-EMail for Windows NT is at http://www.aufrance.com
>
> Here's some code that will take form input and email it to
> an address you've specified. I've only tested this on an
> NT server.
>
> #!/perl/bin -w
>
> # -T taint checking should be on but Win32
> # doesn't seem happy with it.
> #########################################
> # formshandler.pl
> #
> # A very simple form handling script that sends
> # form data to a specific address via email.
> #
> # Requires:
> # CGI.pm
> # Net::SMTP.pm
> #
> # Since this script sends directly to an SMTP
> # server, you'll also need access to one of those.
> #
> # Hacked up by Troy Denkinger (troy@whadda.com)
> #
> #########################################
>
> # We're going to need the CGI module for processing the form
> # fields. Net::SMTP is for attaching to our SMTP server and
>
> # actually sending the email. We also declare our global
> # variables here.
> use CGI;
> use Net::SMTP;
> use vars qw(
> $primary
> $addresserror
> $redirect
> $mailserver
> $fromaddress
> @names
> $subject);
>
> # A new CGI object. OOP-AH!
> my $query = CGI->new;
>
> # this saves all the form field names
> # into the @names array.
> my @names = $query->param;
>
> # $primary = to whom the message will be sent
> # $redirect = page that will be presented after submission
> # $mailserver = the name of my SMTP server
> # $fromaddress = from address
> #
> # The @ sign in these email addresses must be escaped
> #
> $primary = "dufus\@foobar.com";
> $redirect = 'http://www.foobar.com/';
> $mailserver = "mail.foobar.com";
> $fromaddress = "postmaster\@foobar.com";
> $subject = "Yer Stinkin Form";
>
> # Let's send the redirect first. I know we can do this
> # so it doesn't block, but I haven't added it yet.
> print $query->redirect($redirect);
>
> # Call mailit() and pass in the email address we want
> # to send to.
> mailit($primary);
>
> # This is a sub because you could loop over a list of email
> addresses
> # if you want the form information to be sent to multiple
> recipients.
> #
> # I'm still trying to figure out how to successfully
> # use cc and bcc with Net::SMTP.
> #
> # I had to feel my way through the use of the Net::SMTP
> module. I'm
> # sure this isn't the most elegant way to handle it. I'll
> refine it
> # later.
> sub mailit
> {
> my $smtp;
> my $toaddress = $_[0];
>
> # Create a new Net::SMTP object and pass it the
> # name of our mail server.
> #
> # I should be testing to see if the connection was actually
> # established. Let's leave that as an exercise for the
> # reader.
> #
> $smtp = Net::SMTP->new($mailserver);
> $smtp->mail("$fromaddress");
> $smtp->to($toaddress);
> $smtp->data();
> $smtp->datasend("From: $fromaddress\n");
> $smtp->datasend("To: $toaddress\n");
> $smtp->datasend("Subject: $subject\n");
> $smtp->datasend("\n");
>
> my $name;
> foreach $name (@names)
> {
> my $value = $query->param("$name");
>
> # This removes any underscores from the form field
> name attribute.
> # I did this so you can have underscores on the form
> that become
> # more readable in the email. Eg: First_Name
> becomes First Name.
> $name =~ s/_/ /g;
>
> # This checks to see if the form field contains any
> newlines and
> # tries to keep the formatting while also inserting
> a tab so it
> # is indented in the final email. This may or may
> not work
> # properly in your setup. If not, blow it away.
> #
> # The output in the email for a form field of
> First_Name=Troy Denkinger
> # will be, in the final email, [First Name] Troy
> Denkinger. Obviously,
> # you can fiddle with this.
> if($value =~ s/\n/\n\t/g)
> {
> # Since we have a good idea of what we want
> to see in our
> # form, let's limit the input to only a set
> group of characters.
> # Your mileage may vary on this one. Note
> that this one leaves the
> # \n & \t alone.
> $value =~ s/[^A-Za-z1-9_.&\n\t ]//g;
>
> $smtp->datasend("\[$name\]\n \t$value\n\n");
> }
> else
> {
> # Since we have a good idea of what
> we want to see in our
> # form, let's limit the input to
> only a set group of characters.
> # Your mileage may vary on this one.
>
> $value =~ s/[^A-Za-z1-9_.& ]//g;
>
> $smtp->datasend("\[$name\]
> $value\n");
> }
> }
> $smtp->dataend();
> $smtp->quit;
> }
>
------------------------------
Date: 1 Mar 1998 18:24:35 GMT
From: mclare@maudlin.org (sebu)
Subject: Getting name of script without absolute path.
Message-Id: <slrn6fja4o.64.mclare@maudlin.org>
Is there a variable (besides $0) which contains the name of the script being
executed? $0 shows the absolute pathname, and sometimes just the name is
preferred. Example:
$ cat ~/bin/try
#!/usr/bin/perl
print "$0\n";
$ try
/home/me/bin/try
$
In other words, what I'm really looking for is the Perl equivalent of C's
argv[0].
Thanks,
sebu
------------------------------
Date: Sun, 01 Mar 1998 18:05:49 +0200
From: Fain <mindmore@mindless.com>
Subject: Re: Home Page Click.
Message-Id: <34F9875D.9777982D@mindless.com>
hymie! wrote:
> In our last episode, the evil Dr. Lacto had captured our hero,
> me@here.com (steve), who said:
> >On 24 Feb 1998 18:37:33 GMT, petdance@maxx.mc.net (Andy Lester) wrote:
>
> [attributions lost]
> >>: Does anyone know how to add an element to a page so that when the user
> >>: clicks on it, it becomes their home page?
>
> >>1) You can't.
>
> >yes you can
>
> My home page is on an ISP paid for by me. It's written by me.
> It includes facts about me. It includes links that I like. I
> advertise it in my sig.
>
> How can Joe Smith (no offense to anybody named Joe Smith) create
> a web page, and have it be my home page?
>
> >>2) Your question has nothing to do with Perl.
>
> ..hymie!
> http://www.smart.net/~hymowitz * agis customers: e-mail and web service refused
> hymie@lactose.smart.net ********** pgp public key: e-mail pgp@lactose.smart.net
> ===== Unsolicited commercial e-mail spam will be forwarded to postmasters =====
it sounds like the question was:
Is there I way that I can have a list of features on my home page and when someone
comes to my site they click on each one and the ones they click on become part of
there home page.
The answer to this question would still be No. Unless, you owned the server of the
people that would use this stuff (then you could write a script that would update
their home page).
- Nathan
mindmore@mindless.com
http://www.actcom.co.il/~fain
------------------------------
Date: Fri, 27 Feb 1998 16:09:46 -0800
From: "Sebastian" <sebfrey@advancedh2o.com>
Subject: Perl & MS SQL Server
Message-Id: <6dc1bj$3hp$1@news0-alterdial.uu.net>
O' NT Perl Gurus -
I've just spent the better part of the day downloading various perl modules
and whatnot in the hopes of writing a few scripts to access data stored in a
Microsoft SQL Server 6.5 database. OK, I'll come right out and say it: I
can't even BEGIN to get it working. I've tried Win32::ODBC, MSSQL/DBLib,
and the ASP/ADO Examples that come with (I think) PerlScript. None of them
work, for a variety of reasons which I'll spare you.
What I would like to know is: is there a one-stop tutorial for just this
kind of thing? I've been going on a few snippets of HTML documentation here
and the occaisional text file there, but have yet to find any "grand
unifying tutorial" that could take me through this step-by-step. Is there
an URL that has this, or a book I can buy?
And does everyone have a preferred method for doing this? Is Win32::ODBC
the most popular?
Any advice anyone can provide will be _greatly_ appreciated!
Thanks in advance.
--Sebastian Frey
------------------------------
Date: 1 Mar 1998 17:56:37 GMT
From: Doug Vermes <dvermes@emerald.tufts.edu>
Subject: Perl file mode?
Message-Id: <6dc7gl$jiq$1@news3.tufts.edu>
When you use the stat command to get information on a file, one of the
values it returns is the file mode ($mode). I'm having a hard time making
sense of this number. It certainly isn't the normal UNIX permissions. For
example, a file with UNIX permission 600 comes back as 33152. How do I
translate from one to the other?
Thanks,
Doug
==========================================
Doug Vermes -- dvermes@emerald.tufts.edu
Tufts University
==========================================
------------------------------
Date: 1 Mar 1998 15:14:58 GMT
From: root@po10.sinica.edu.tw (root)
Subject: Problem installing PERL 5.004_04 on Linux Red-Hat 5.0
Message-Id: <6dbu1i$fdc$1@news1.sinica.edu.tw>
Hello,
While running the 'make' for the Perl 5.004_04 on Linux Red-Hat 5.0
using gcc v. 2.8.0, but getting the following errors:
--------------------------------------------------------
AutoSplitting perl library
./miniperl minimod.pl > tmp && mv tmp lib/ExtUtils/Miniperl.pm
`sh cflags libperl.so perlmain.o` -fpic perlmain.c
CCCMD = cc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -I/usr/local/include
-O2
Making DynaLoader (static)
../../miniperl: error in loading shared libraries
libperl.so: cannot open shared object file: No such file or directory
Warning: No Makefile!
make[1]: Entering directory `/project/perl5.004_04/ext/DynaLoader'
make[1]: *** No rule to make target `config'. Stop.
make[1]: Leaving directory `/project/perl5.004_04/ext/DynaLoader'
make config failed, continuing anyway...
make[1]: Entering directory `/project/perl5.004_04/ext/DynaLoader'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/project/perl5.004_04/ext/DynaLoader'
make: *** [lib/auto/DynaLoader/DynaLoader.a] Error 2
--------------------------------------------------------
Any help will be most appreciated.
Da-Wei Chiang
dawei@sinica.edu.tw
------------------------------
Date: 1 Mar 98 15:46:17 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Problem installing PERL 5.004_04 on Linux Red-Hat 5.0
Message-Id: <34f982c9.0@news.one.net>
root <root@po10.sinica.edu.tw> wrote:
> Hello,
> While running the 'make' for the Perl 5.004_04 on Linux Red-Hat 5.0
> using gcc v. 2.8.0, but getting the following errors:
Try this script:
tar xzf latest.tar.gz
cd perl5.004*
perl -pi.dist -e \
"s:/ bsd / /:/ net / /' | sed -e 's/ bsd / c g /:; \
s/^#(POSIX_cflags)/POSIX_cflags/" \
hints/linux.sh
./Configure -des && make test
That should adjust the libraries and POSIX compile flags to
build a good Perl for the glibc implementation of RedHat 5.0.
Regards,
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Just because something is 131 Willow Lane, Floor 2 | || _ \
obviously happening doesn't Oxford, OH 45056 | || |_) |
mean something obvious is <mikeh@minivend.com> |___| _ <
happening. --Larry Wall 513.523.7621 FAX 7501 |_| \_\
------------------------------
Date: 1 Mar 1998 16:54:52 GMT
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: Re: Problem installing PERL 5.004_04 on Linux Red-Hat 5.0
Message-Id: <6dc3ss$nl2$2@pulp.ucs.ualberta.ca>
Mike Heins (mikeh@minivend.com) wrote:
: root <root@po10.sinica.edu.tw> wrote:
: > While running the 'make' for the Perl 5.004_04 on Linux Red-Hat 5.0
: > using gcc v. 2.8.0, but getting the following errors:
:
: Try this script:
:
: tar xzf latest.tar.gz
: cd perl5.004*
: perl -pi.dist -e \
: "s:/ bsd / /:/ net / /' | sed -e 's/ bsd / c g /:; \
: s/^#(POSIX_cflags)/POSIX_cflags/" \
: hints/linux.sh
: ./Configure -des && make test
I think that you also uncomment one line in hints/linux.sh to avoid
problems with POSIX strftime. Don't want to mix up things right now
quoting from memory but there are obvious remarks in 'linux.sh'
which tell you what is needed.
--mj
------------------------------
Date: Sun, 01 Mar 1998 09:51:15 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Q: splice() time complexity, want linked lists?
Message-Id: <34F991F7.8FAB318A@5sigma.com>
It's nice to see someone else was awake in data structures
& algorithms class. :-)
-joseph
Abigail wrote:
>
> Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on 1643 September 1993
> in <URL: news:6db6i8$qor$1@mathserv.mps.ohio-state.edu>:
> ++ [A complimentary Cc of this posting was sent to Abigail
> ++ <abigail@fnx.com>],
> ++ who wrote in article <6db2fl$jf4$1@client3.news.psi.net>:
> ++ > The trick is that your remove the *next* element, after copying
> ++ > its data. (Perl's ref counting takes care of the actual
> ++ > removal of the node).
> ++
> ++ Now try to remove the previous elements again!
> ++
> ++ I do not think any trick will help here, there *is* a reason for
> ++ doubly-linked lists.
>
> #!/usr/local/bin/perl -w
[...]
>
> [ 10 9 8 7 6 5 4 3 2 1 ]
> [ 10 9 8 7 6 4 3 2 1 ]
> [ 10 9 8 7 4 3 2 1 ]
> [ 10 9 8 7 3 2 1 ]
>
> Your point?
>
> (Of course, if you have a reference to an element past the one you
> are deleting, that reference no longer points to sensible information)
>
> Abigail
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 1 Mar 1998 18:04:46 GMT
From: "Robert Mac" <RobertMac@worldnet.att.net>
Subject: Question for Tom Christiansen
Message-Id: <6dc7vu$674@bgtnsc03.worldnet.att.net>
Dear Tom
I'm sorry to disturb you, I hope you don't mind answering the following
question.
I'm attempting to send an email message in a perl script by a pipe to
Telnet opened for input.
I can open Telnet for input but I can't seem to pass the command lines such
as, rcpt to: , mail from: ,
data , subject: , etc....
Example code is as follows:
$sendmail = "telnet turbo\.kean\.edu 25";
$recipient = "RobertMac\@worldnet\.att\.net";
$sender = "\@www-bgt\.kean\.edu";
open (SENDMAIL, "| $sendmail");
sleep (2);
print SENDMAIL "rcpt to: $recipient";
print SENDMAIL "mail from: $sender";
Maybe I'm taking the wrong approach but I hope you can help me. We don't
have sendmail setup on our UNIX web server
because we also have WebCT on the same server and there is a security
issue.
My main purpose is to have cgi form input, on a college web site, sent to
the admissions email address for student applications.
Any help you can offer will be greatly appreciated, thank you.
Sincerely,
Robert D. Waugaman
------------------------------
Date: 1 Mar 1998 18:23:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Question for Tom Christiansen
Message-Id: <6dc93t$es4@fridge.shore.net>
Robert Mac (RobertMac@worldnet.att.net) wrote:
: I'm sorry to disturb you, I hope you don't mind answering the following
: question.
OMG! I could swear that you just asked this question earlier on.
: I'm attempting to send an email message in a perl script by a pipe to
: Telnet opened for input.
Again, I ask you why you're not using Net::Telnet or Net::SMTP
(preferred)? I dunno what Tom will tell you, but those are my
suggestions.
You can get the libnet and Net::Telnet packages from:
http://www.perl.com/CPAN/modules/by-module/Net
--
Nathan V. Patwardhan
------------------------------
Date: 1 Mar 1998 16:47:57 GMT
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: Re: replace a word in file...
Message-Id: <6dc3ft$nl2$1@pulp.ucs.ualberta.ca>
Lalit Jairath (ljairath@wright.aps.uoguelph.ca) wrote:
: is there a unix command (or possibly script) that make a change (replace/
: delete a word etc.)
perl -i.bak -pe '{s/word/replacement/og}' file1 file2 file3 ....
Keep backup files and compare results. You may be doing not what you
think you are doing - depending on your regular expressions skills. :-)
Michal
------------------------------
Date: 1 Mar 1998 12:34:27 -0500
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: replace a word in file...
Message-Id: <6dc673$ld2@pilot.njin.net>
Hello -
dmmartin@home.net (Michael Martin) writes:
>Hi,
>>is there a unix command (or possibly script) that make a change (replace/
>>delete a word etc.) and save the file on disc (off-course i don't want
>>to do it manually by going into the file and making changes there!).
>I don't know about a UNIX command (words like grep and egrep come to mind), you
>are in the wrong newsgroup for that anyway. but it would be pretty simple to
>write a Perl script that does that. Take a look at the prelre man page, and
>look at s/// (substitution).
>Here is a little snipit to get you started:
[ ... ]
>open(FILE, "+<$file");
>while(<FILE>){
>s/\b$word\b/\b$replacement\b/ig;
>}
>close(FILE);
>print "done\n";
>__END__
>well, actully that is a simple program to replace $word with $replacement in
>$file (useage: %replace foo bar /etc/passwd).
Except your program has no output, other than the string "done\n".
You give $_ a good workout, but you don't print anything to FILE.
Also, \b in your replacement string is a backspace. \b in the pattern is
a (zero-width) word boundary assertion. You can't insert such a thing
into a string. It either is, or it isn't :-)
It sounds like the original poster wants something command-line-based:
perl -pi.bak -e 's/\bold\b/new/gi' filename
or some variant thereof.
David Black
dblack@pilot.njin.net
--
use LWP::Simple;print get('ftp://orpheus.shu.edu/pub/japh.txt')
------------------------------
Date: Sun, 1 Mar 1998 13:30:35 -0500
From: "Kathleen Ramsey" <kathleen_ramsey@email.msn.com>
Subject: Re: Running a perl script on Windows 95
Message-Id: <#sToiAUR9GA.251@upnetnews04>
There is still another option, someone wrote a 16 bit pascal program that
is complied. You rename #!perl.exe to {scriptname.exe -- to match
scriptname .pl} put the script, this exe and perl exe in a directory in you
path. Then run scriptname. If I remember right it does a nice job of
file redirect which the bat jobs can't do. The problem is you end up with
loads of these file sitting around that are all the same except the name. I
haven't tried it in NT tho. I can dig up the code if you are interested.
Kathy
Thieu wrote in message <34F4BE7E.17275026@ca.ibm.com>...
>I have a Perl script that is running fine on UNIX. I now want to run it
>on Windows 95 but it is not being executed at all. I am suspecting that
>it cannot even find the Windows version Perl interpreter that I
>installed. What is the Windows equivalent of the first line used for
>UNIX (#!/usr/local/bin/perl) that tells where the Perl interpreter is?
>Any other details that I should pay attention to as well? Thanks.
>
------------------------------
Date: 1 Mar 1998 16:13:57 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: search engine
Message-Id: <6dc1g5$q0k$2@client2.news.psi.net>
Michael Harbauer (mharbauer@geocities.com) wrote on 1643 September 1993
in <URL: news:34f943cf.4507751@news.Austria.EU.net>:
++ hi
++
++ i need to write a search engine - script that searches for one
++ document on several internet servers which are running under "nt4
++ server" as well as linux - but i have no idea how to access
++ direcotries on a foreign server to search for a requested document.
I think writing a search engine is beyond your capacities.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: 01 Mar 1998 09:30:03 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: falstaff@lennon.postino.com (John)
Subject: Re: The Ineffable Tom C.
Message-Id: <8cd8g6xtkk.fsf@gadget.cscaper.com>
>>>>> "John" == John <falstaff@lennon.postino.com> writes:
John> And on this point Tom _has_ lost income. I am the Perl guru at
John> work and many people come to me with questions. I suggest different
John> books, but _always_ warn people to stay away from "Learning Perl
John> on Win32", which is co-authored by Tom C. Tom has posted slams on
John> NT and Win32, or posted his kill-file list that includes anything to
John> do with Win32. For him to try and profit from Win32 is a dictionary
John> definition of Hypocracy.
And for the record, neither Tom nor I had *anything* to do with the
win32 portions of that book. I couldn't, because I know next to
nothing about win32 (having never been forced to use the M$ attempts
to get MacOS running on an Intel platform :-). Tom didn't, for
whatever reasons.
The win32 portions were written by Erik Olson[1], whom I've never met,
or even corresponded with that I can recall, and whose name I only
knew just now by looking at a copy of the gecko sitting on my shelf.
So it's perfectly reasonable to presume that neither Tom nor I provide
any reasonable assurances that we *know* or *care to know* about
win32, and that we can safely laugh at that market all we want[2]. If
you want to use that as a basis for denying Erik Olson his income,
that's your choice, and I won't try to stop you. In some ways, I'm
even embarassed that I'm making money on the gecko, but since it is
substantially derived from my llama work, I suppose it's only fair.
[1] When the gecko first came out, I got a small flurry of mail asking
"what's new in the gecko over the llama?"... I had to reply "I don't
know... I wrote the parts that are the *same*, not the parts that are
*different*."
[2] If I am ever forced to make a choice between learning and using
win32, or leaving the computer industry, let me just say it was nice
knowing all of you. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 183 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 1 Mar 1998 15:24:15 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Wanted: Perl author for small project
Message-Id: <6dbuiv$30p@fridge.shore.net>
Brett (brett@moggy.com) wrote:
: Recently I had hired a Perl author to work on an Auction script for a site
: I'm working on. I haven't heard from him for over 3 weeks and I am assuming
: something (perhaps bad) has happened to him.
This is not intended to be a flame, but a wakeup call.
I hate to say this, but your programmer probably hit the road after
they realized that $350 was a joke. Not to say that we're all worth
$1 million, but $350 *is* insulting for a total project that would be
completed by an expert programmer.
: The money's not big, our budget is small -- that's why we were sad to
: lose a good author who would work to our budget. We can only offer $350
: US.
Hint: pay *more*. Pay people what they're worth. Altruism and free
software is one thing, but respect for someone's credentials and
taking advantage of people is something else.
Did you give the $350 all at once or in parts?
--
Nathan V. Patwardhan
------------------------------
Date: Sun, 01 Mar 1998 16:35:05 GMT
From: o.harvey@andtech.co.uk (Oliver Harvey)
Subject: Re: Wanted: Perl author for small project
Message-Id: <34f98df6.891745965@oak>
....Y'know 10 times that much wouldn't tempt most professionals in
this field matey.....
Oliver.
>Recently I had hired a Perl author to work on an Auction script for a site
>I'm working on. I haven't heard from him for over 3 weeks and I am assuming
>something (perhaps bad) has happened to him.
>
>Anyway, the show must go on and I'm looking for an experienced, reliable
>and professional script writer to write (or modify) an Auction script.
>
>The money's not big, our budget is small -- that's why we were sad to
>lose a good author who would work to our budget. We can only offer $350
>US.
>
>If you are interested more in the project (rather than money) then please
>contact me at:
>brett@moggy.com and let me know...
>
>hope you hear from you soon!
>
>
>regards,
>Brett Phillips
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1997
**************************************