[8787] in Perl-Users-Digest
Perl-Users Digest, Issue: 2404 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 23 17:07:23 1998
Date: Thu, 23 Apr 98 14:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 23 Apr 1998 Volume: 8 Number: 2404
Today's topics:
Re: Any Perl Hackers created interfaces to PGP5. (brian d foy)
C from perl <siddiqi-kaleem@cs.yale.edu>
Re: Can I do this: <A HREF=laughs.pl?@laughs> <andrewf@cp.pathfinder.com>
Re: fixed width text files (Jeffrey R. Drumm)
Grabbing a webpage with Perl <munu@munu.com>
Re: Grabbing a webpage with Perl <mosey@alpha3.csd.uwm.edu>
Re: Grabbing a webpage with Perl <br@ndon.com>
Re: Grabbing a webpage with Perl <beske@worldnet.att.net>
Re: Help w/ printing file contents to screen? (Andre L.)
Help with non-text output <sgtrupia@oakland.edu>
Re: Help with non-text output (Wayne C. McCullough)
How do you ignoe characters in <read> <mosey@alpha3.csd.uwm.edu>
Re: How do you ignoe characters in <read> <br@ndon.com>
Re: How do you ignoe characters in <read> <mosey@alpha3.csd.uwm.edu>
Re: How do you ignoe characters in <read> <rra@stanford.edu>
Re: How do you ignoe characters in <read> <br@ndon.com>
Re: How do you read e-mail with Perl/MailTools? kjj@arf.eng.mcd.mot.com
Re: Perl for NT <david.x.corcoran@boeing.com>
Re: Perl for NT (Stuart McDow)
Perl V4.00 <plhostis@hol.fr>
Re: Perl V4.00 <br@ndon.com>
Re: Perl vs. Java <br@ndon.com>
Re: Perl vs. Java (Wayne C. McCullough)
Perl5 and IIS4 (on NTworkstation) <ben@umich.edu>
Perln for NT (Dizzy)
Re: spoiled noobie <andrewf@cp.pathfinder.com>
Re: spoiled noobie <lr@hpl.hp.com>
status output. <gkassyou@newbridge.com>
Re: status output. (Andrew M. Langmead)
Re: suid perl scripts yet again <rootbeer@teleport.com>
Re: techniques for tagging substitution areas in templa dtbaker@flash.net
Re: What is OFFICIAL version of Perl FAQ? lvirden@cas.org
WIN32 - create shortcut on desktop <dennis.kowalski@daytonoh.ncr.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Apr 1998 16:59:48 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Any Perl Hackers created interfaces to PGP5.
Message-Id: <comdog-ya02408000R2304981659480001@news.panix.com>
Keywords: from just another new york perl hacker
In article <353fa910.3391847@209.76.252.8>, craigs@3rdstone.net (Craig Simpson) posted:
>Any Perl Hackers created interfaces to PGP5.
>I can not quite grock how I could stuff my message's STDOUT into PGP
>as
>STDIN if I started PGP with system("pgpe -at -r me\@mail.server.com");
look at the perlipc manpage and the IPC::Open3 module (you'll have to deal
with STDERR too, most likely - at least you did in PGP2.6).
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Thu, 23 Apr 1998 15:09:35 -0400
From: Kaleem Siddiqi <siddiqi-kaleem@cs.yale.edu>
Subject: C from perl
Message-Id: <353F91EF.167EB0E7@cs.yale.edu>
I'm trying to interface C subroutines with perl using h2xs.
I've been able to do some simple things such as call
void functions, as well as functions whose arguments are
passed by value.
Can anyone point me to more interesting examples such as:
1) A pointer to an array is passed, such that the array
can be modified by the C subroutine. Also, is there some
way of declaring perl arrays such that their types
correspond with the assumed C types?
2) Structures are passed back (and returned).
Many Thanks!
-----------------------------------------------------------------------
Kaleem Siddiqi Dept. of Computer Science
siddiqi-kaleem@cs.yale.edu Yale University
Phone: (203) 432-4713 P.O. Box 208285, Yale Station
FAX: (203) 432-0593 New Haven, CT 06520-8285
http://www.cs.yale.edu/users/siddiqi-kaleem/
-----------------------------------------------------------------------
------------------------------
Date: Thu, 23 Apr 1998 15:16:13 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: Can I do this: <A HREF=laughs.pl?@laughs>
Message-Id: <Pine.GSO.3.95.980423150727.25720A-100000@cp.pathfinder.com>
On Wed, 15 Apr 1998, Anu N. Melkote wrote:
>
> How can I grab all elements of the array I passed? Thanks in advance !
$string = join ' ', @array;
then unravel it on the other end.
-------------------------------------------------------------
Andrew F. Lee | |
Software Engineer | parenttime.com |
email: andrewf@pathfinder.com | 1271 Avenue of the Americas |
Phone: (212) 522-2769 | New York, N.Y. 10020 |
-------------------------------------------------------------
When I say, "Ignore the man behind the curtain."
That is because there is no man behind the curtain.
------------------------------
Date: Thu, 23 Apr 1998 19:07:03 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: fixed width text files
Message-Id: <35418eb5.194221686@news.mmc.org>
On Thu, 23 Apr 1998 12:14:48 GMT, jeffmcc@mindspring.com (Jeff) wrote:
>Thanks, I've provided some more info below. The reply just below
>your's has the following suggestion.
>
>open(F, $filename) || die "Can't open $filename";
> while $line (<F>) {
> @data = $line =~ /(.{5})(.{6}) ... /;
> }
>
>I haven't tried it yet but it's heading the right direction.
(snip)
Both substr() and unpack() are mentioned as solutions in PerlFAQ4, section "How
do I extract selected columns from a string?".
If you've got a big file, you'll find these functions a bit faster for grabbing
fixed-width fields. Regexes are marvelous things, but they're not the ideal
solution to every problem.
Example:
open(F, $filename) or die "Can't open $filename: $!\n";
while (<F>) {
$field1 = substr($_,0,24);
$field2 = substr($_,24,8);
.
.
.
}
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Thu, 23 Apr 1998 15:13:53 -0400
From: Chris <munu@munu.com>
Subject: Grabbing a webpage with Perl
Message-Id: <353F92F1.808876D9@munu.com>
Does anyone know how to have a Perl program get a web page? I just need
for it to grab a url I give it. Thanks.
Chris
------------------------------
Date: 23 Apr 1998 19:22:14 GMT
From: John Mosey <mosey@alpha3.csd.uwm.edu>
Subject: Re: Grabbing a webpage with Perl
Message-Id: <6ho4d6$rr0$3@uwm.edu>
Chris <munu@munu.com> wrote:
: Does anyone know how to have a Perl program get a web page? I just need
: for it to grab a url I give it. Thanks.
: Chris
I know there is a program out here called wget which does that.
--
John Mosey Unoffical President
Webmaster of the Unoffical
www.mosey.com Scott Elarton Fan Club
"We do in-season too." "Scott got the shaft again!"
"He's got the best hanging-curve I've ever seen, his fastball mores more
than his curve. He wouldn't even make the rotation on this little league
team."
- EX assisstant little league Coach Mike Spearman on John Mosey's pitching
------------------------------
Date: Thu, 23 Apr 1998 15:41:36 -0400
From: Brandon Golm <br@ndon.com>
Subject: Re: Grabbing a webpage with Perl
Message-Id: <353F9970.3B059228@ndon.com>
Chris wrote:
>
> Does anyone know how to have a Perl program get a web page? I just need
> for it to grab a url I give it. Thanks.
>
> Chris
You probably want an LWP module or Net::HTTP. Why don't you try finding
one on CPAN?
http://reference.perl.com/
Or you could search the clpm newsgroup. Look for one of Abigail's
random perl-program-sig-files that grabs a webpage. it has the chars
LWP in it. try http://www.dejanews.com/
Hope you find it!
.brandon.
------------------------------
Date: Thu, 23 Apr 1998 15:48:16 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: Grabbing a webpage with Perl
Message-Id: <6ho5vb$2h2@bgtnsc02.worldnet.att.net>
Look at the LWP module. There is a call to fetch the contents
of a webpage for a given URL.
b^2
------------------------------
Date: Thu, 23 Apr 1998 14:55:34 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Help w/ printing file contents to screen?
Message-Id: <alecler-2304981455340001@dialup-89.hip.cam.org>
In article <6hmsai$uvj$1@news.netunlimited.net>, "David Joyce"
<djoyce@netunlimited.net> wrote:
> I can print to a file with <STDIN> pretty successfully, but how do I print
> file contents to screen in my scripts? <STDOUT>? If so, how?!?!
You mean...?
print <SOMEFILE>;
STDOUT being the default output file if no other has been selected.
This is a case of RTFM. :-)
A.L.
------------------------------
Date: Thu, 23 Apr 1998 13:48:12 -0400
From: Trupiano <sgtrupia@oakland.edu>
Subject: Help with non-text output
Message-Id: <353F7EDC.F9C14450@oakland.edu>
I am using Perl 5 Win32 build 316 on Win95. I am trying
to create a file, whose contents are a sequence of bytes,
each of which is the value of a string character.
For example,
$string = "0";
ASCII encoding for string is 48(base 10), or 30(base 16)
The resultant file should contain one byte, whose value is
48, or 0x30.
I know that <ord> can compute the ASCII value of the first
character in $string. However, how do I get that value to
not be represented as two bytes in the output file, each of
which is the ASCII representation of each digit of 48, that
is 0x34,0x38, and simply one byte, with value 48?
I assume this has something to do with how I <print> it, but
I cannot figure what this might be?
Any help would be greatly appreciated.
Thanks,
sgtrupia@oakland.edu
------------------------------
Date: 23 Apr 1998 20:10:26 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: Re: Help with non-text output
Message-Id: <6ho77i$hkn$1@hecate.umd.edu>
<long question not repeated>
Have you looked at the pack and unpack command?
W
------------------------------
Date: 23 Apr 1998 19:03:32 GMT
From: John Mosey <mosey@alpha3.csd.uwm.edu>
Subject: How do you ignoe characters in <read>
Message-Id: <6ho3a4$ro7$1@uwm.edu>
I'm creating a simple file manipulation and display script The problem is that
when I create @array using split and a while (<READ>) command I get stopped.
The file I'm rading is space delimited (I know, but I didn't create it).
Anyway, one of the fields is a decimal. The "." kicks the process out of the
loop and I can't finish readin the line.
Example, the line really is
Jim Jack Joe .25 truck pig man
$array[0] = Jim
$array[1] = Jack
$array[2] = Joe
$array[3] = 25 (no decimal)
$array[4] =
$array[5] =
$array[6] =
Any idea what is causing this or how I can fix it?
John Mosey
--
John Mosey Unoffical President
Webmaster of the Unoffical
www.mosey.com Scott Elarton Fan Club
"We do in-season too." "Scott got the shaft again!"
"He's got the best hanging-curve I've ever seen, his fastball mores more
than his curve. He wouldn't even make the rotation on this little league
team."
- EX assisstant little league Coach Mike Spearman on John Mosey's pitching
------------------------------
Date: Thu, 23 Apr 1998 14:58:53 -0400
From: Brandon Golm <br@ndon.com>
To: John Mosey <mosey@alpha3.csd.uwm.edu>
Subject: Re: How do you ignoe characters in <read>
Message-Id: <353F8F6D.4D736B60@ndon.com>
John Mosey wrote:
>
> I'm creating a simple file manipulation and display script The problem is that
> when I create @array using split and a while (<READ>) command I get stopped.
>
> The file I'm rading is space delimited (I know, but I didn't create it).
> Anyway, one of the fields is a decimal. The "." kicks the process out of the
> loop and I can't finish readin the line.
>
> Example, the line really is
> Jim Jack Joe .25 truck pig man
> $array[0] = Jim
> $array[1] = Jack
> $array[2] = Joe
> $array[3] = 25 (no decimal)
> $array[4] =
> $array[5] =
> $array[6] =
>
> Any idea what is causing this or how I can fix it?
Please post that part of your code!
We could all make guesses.
------------------------------
Date: 23 Apr 1998 19:19:09 GMT
From: John Mosey <mosey@alpha3.csd.uwm.edu>
Subject: Re: How do you ignoe characters in <read>
Message-Id: <6ho47d$rr0$1@uwm.edu>
Brandon Golm <br@ndon.com> wrote:
: John Mosey wrote:
:>
:> I'm creating a simple file manipulation and display script The problem is that
:> when I create @array using split and a while (<READ>) command I get stopped.
:>
:> The file I'm rading is space delimited (I know, but I didn't create it).
:> Anyway, one of the fields is a decimal. The "." kicks the process out of the
:> loop and I can't finish readin the line.
:>
:> Example, the line really is
:> Jim Jack Joe .25 truck pig man
:> $array[0] = Jim
:> $array[1] = Jack
:> $array[2] = Joe
:> $array[3] = 25 (no decimal)
:> $array[4] =
:> $array[5] =
:> $array[6] =
:>
:> Any idea what is causing this or how I can fix it?
: Please post that part of your code!
: We could all make guesses.
Sorry everyone, I guess you can't read my mind. Here is the gist of the problem
open (READ,"standing.htm") || die "Can't open file $a
for reading: $!";
$count = 1;
while(<READ>) {
@array = split(/\.+/, $_);
if ($count == 13){
@new = split(/\ +/, $array[0]);
for($i=0; $i<15; $i++){
print "cell $i = $new[$i]\n";
}
$count++
}
}
close (READ) || die "can't close $a: $!";
------------------------------
Date: 23 Apr 1998 12:55:52 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: How do you ignoe characters in <read>
Message-Id: <m3yaww48jb.fsf@windlord.Stanford.EDU>
Brandon Golm <br@ndon.com> writes:
> why don't you just split on whitespace?
> while (<READ>) {
> chomp;
> @array = split(/\w+/,$_); #\w is whitespace better than '\ '
> }
Good idea, but wrong syntax. Whitespace is \s. \w is a "word" character
(usually [a-zA-Z0-9_] but may vary depending on your locale).
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 23 Apr 1998 15:59:57 -0400
From: Brandon Golm <br@ndon.com>
To: Russ Allbery <rra@stanford.edu>
Subject: Re: How do you ignoe characters in <read>
Message-Id: <353F9DBD.33F48880@ndon.com>
Russ Allbery wrote:
>
> Brandon Golm <br@ndon.com> writes:
>
> > why don't you just split on whitespace?
>
> > while (<READ>) {
> > chomp;
> > @array = split(/\w+/,$_); #\w is whitespace better than '\ '
> > }
>
> Good idea, but wrong syntax. Whitespace is \s. \w is a "word" character
> (usually [a-zA-Z0-9_] but may vary depending on your locale).
typo: \s is what I meant. I had the wrong neumonic in my head, even
though I have the regular expression list in front of me.
I still can't figure out what he's trying to do.
BTW: impressive sig!
> --
> #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 23 Apr 1998 12:28:16 -0700
From: kjj@arf.eng.mcd.mot.com
Subject: Re: How do you read e-mail with Perl/MailTools?
Message-Id: <c0gd8e8e3sf.fsf@arf.eng.mcd.mot.com>
cwatson@nuevo.com (C. Watson) writes:
> The FAQ suggests using Internet.pm from the MailTools package to read e-mail,
> which I have installed. I am not (as yet) a perl wizard, and find that the
> documentation and examples for this package don't give me enough information
> on using it to read e-mail. I've searched DejaNews and this newsgroup for
> information on reading e-mail, and have found nothing.
>
> I am sure I could use sockets to open a connection to a pop server, but I am
> looking for an easier, softer way.
'read e-mail' is an ambiguous phrase.
MailTools is for diddling individual email messages available in
memory or on disk.
You probably want MailFolder if you have a folder of messages you want
to peruse.
You want one of the POP modules if you want to download email from a
POP server.
Net::xAP is available for doing IMAP stuff, but it's very new and
unstable.
------------------------------
Date: Thu, 23 Apr 1998 16:05:41 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
Subject: Re: Perl for NT
Message-Id: <353F66D5.4598@boeing.com>
Jason Gloudon wrote:
>
> Nathan Stanford <nathan@cyberservices.com> wrote:
> >Does Tom Phoenix have to put down everyone when they ask a question. This
>
> You are completely wrong. I wish people would stop casting stones before
> they try carrying them.
>
> --
> Jason Gloudon
One adage I've come to embrace of late:
Offense is more often taken than given.
------------------------------
Date: 23 Apr 1998 17:25:36 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Perl for NT
Message-Id: <6hntig$jsl$1@ns1.arlut.utexas.edu>
"Nathan Stanford" <nathan@cyberservices.com> writes:
>
> Perl is a leading CGI Scripting Lang.
yay.
perl's been around since 1987. When did the web come into existance?
1993? I've been using perl since about 1990, and I haven't written one
stinkin' piece o' CGI yet, thank heavens. Let's not forget that perl
is way too powerful and useful to be thrown into the CGI language
ghetto.
> Tom Phoenix wrote in message ...
> >A detailed look at the differences in Windows Perl is part of the
> >Perl-for-Win32 FAQ.
> >
> > http://cpan.perl.org/doc/FAQs/win32/Perl_for_Win32_FAQ.html
> >
> >Hope this helps!
Tom *answered* the original question (and in the best way possible),
and you still flame him? What's with you?
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: Thu, 23 Apr 1998 21:47:48 +0200
From: "philippe l'hostis" <plhostis@hol.fr>
Subject: Perl V4.00
Message-Id: <6ho5nm$sme$1@news4.isdnet.net>
Do someone know where i can find an old version of Perl (4.0036) ??
Thank you.
------------------------------
Date: Thu, 23 Apr 1998 15:48:42 -0400
From: Brandon Golm <br@ndon.com>
To: philippe l'hostis <plhostis@hol.fr>
Subject: Re: Perl V4.00
Message-Id: <353F9B1A.32A54508@ndon.com>
philippe l'hostis wrote:
>
> Do someone know where i can find an old version of Perl (4.0036) ??
I do, but I looked for it. Did you look?
CPAN, say it, spell it, love it. look first.
http://www.perl.com/CPAN-local/src/unsupported/4.036/
------------------------------
Date: Thu, 23 Apr 1998 15:19:53 -0400
From: Brandon Golm <br@ndon.com>
Subject: Re: Perl vs. Java
Message-Id: <353F9459.18F6E3FB@ndon.com>
Wayne C. McCullough wrote:
>
> Jason Taylor <jtaylor@ala.net> wrote:
> : Remember that comparing Java with Perl is like comparing Apples and
> : Coffee :)
>
> Also, Java is intended to work in such a way that you can theoreticly
> run anyone's java script and not have to worry about what damage it
> will do to your system.
But naturally you're talking about the browser inline "Applet" kind of
Java, the most limited. There are real Java programs that don't run
protected like that, and can fry your system for you.
Either compare: Java with Perl,
Java applets with Perl Penguin,
don't you think?
.brandon.
> On the other hand, Perl is used by system administrators for configuration.
>
> Would you run a strange perl program from an unknown site without
> carefully examining it first?
>
> W
------------------------------
Date: 23 Apr 1998 16:32:23 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: Re: Perl vs. Java
Message-Id: <6hnqen$f2h$1@hecate.umd.edu>
Jason Taylor <jtaylor@ala.net> wrote:
: Remember that comparing Java with Perl is like comparing Apples and
: Coffee :)
Also, Java is intended to work in such a way that you can theoreticly
run anyone's java script and not have to worry about what damage it
will do to your system.
On the other hand, Perl is used by system administrators for configuration.
Would you run a strange perl program from an unknown site without
carefully examining it first?
W
------------------------------
Date: Thu, 23 Apr 1998 19:41:48 GMT
From: "Ben Lowery" <ben@umich.edu>
Subject: Perl5 and IIS4 (on NTworkstation)
Message-Id: <0QM%.1577$p5.7339585@news.itd.umich.edu>
Hi there,
I installed the option pack for NTWKST4.0, and am having problems getting
perl scripts to run. I have Perl for Win32 installed, as well as the
ActiveState Perl for IIS, but it refuses to recognize .pl files as
executable code. I can run Perl scripts from the command line just fine,
with or without extension, but cannot figure out how to associate .pl files
with either Perl.exe or the ActiveState dll. Help me out? Thanks.. e-mail
is preferable as i don't check the newsgroups that often.. thanks. btw,
the site is:
http://hades.chaotic.net
--ben
blowery@umich.edu
------------------------------
Date: Thu, 23 Apr 1998 19:07:57 GMT
From: dizzy@texoma.net (Dizzy)
Subject: Perln for NT
Message-Id: <6ho4v4$hbc@enews2.newsguy.com>
Hello,
I was woundering if anyone had any basic perl info i could read up on.
I am looking into perl but i cant seem to find any basic info besides
bits and pieces of information. If you dont mind please send me any
information or web sites that might have info. Thank You!
Dizzy
Dizzy
dizzy@texoma.net
------------------------------
Date: Thu, 23 Apr 1998 15:38:26 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: spoiled noobie
Message-Id: <Pine.GSO.3.95.980423153654.25720B-100000@cp.pathfinder.com>
On Mon, 20 Apr 1998, Sahagian wrote:
> I grew up? with the trim() function which returns a string with the
> leading and the trailing space-chars removed.
>
> Any elegant way to do this in PERL5 ? Thanks. -dvs-
sub trim {
my $string = shift;
$string =~ m/\s*(.+)\s*/;
return $1;
}
-------------------------------------------------------------
Andrew F. Lee | |
Software Engineer | parenttime.com |
email: andrewf@pathfinder.com | 1271 Avenue of the Americas |
Phone: (212) 522-2769 | New York, N.Y. 10020 |
-------------------------------------------------------------
When I say, "Ignore the man behind the curtain."
That is because there is no man behind the curtain.
------------------------------
Date: Thu, 23 Apr 1998 13:23:34 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: spoiled noobie
Message-Id: <6ho80d$200@hplntx.hpl.hp.com>
Andrew F. Lee wrote in message ...
>On Mon, 20 Apr 1998, Sahagian wrote:
>
>> I grew up? with the trim() function which returns a string with the
>> leading and the trailing space-chars removed.
>>
>> Any elegant way to do this in PERL5 ? Thanks. -dvs-
>sub trim {
> my $string = shift;
> $string =~ m/\s*(.+)\s*/;
> return $1;
>}
That doesn't work. Try:
$string =~ m/^\s*(.+?)\s*$/;
This is discussed in perlfaq4. Also, there is a recent thread comparing
several approaches, with Benchmark results.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Thu, 23 Apr 1998 12:46:21 -0400
From: George Kassyousef <gkassyou@newbridge.com>
Subject: status output.
Message-Id: <353F705D.466FE518@newbridge.com>
I have a quick question.
I'm trying to allow my application to show a status line on the screen
for the user. Ex.
Please wait while processing.
20%
Now I want to be able to increment the percentage up to 100. I want to
do this by replacing it.
Is there a way to clear a line or go back to beginning of the line to
write over the 20 and so on.
Any help is appreciated.
Thanks.
------------------------------
Date: Thu, 23 Apr 1998 18:12:48 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: status output.
Message-Id: <Ervp9C.At2@world.std.com>
George Kassyousef <gkassyou@newbridge.com> writes:
>Now I want to be able to increment the percentage up to 100. I want to
>do this by replacing it.
>Is there a way to clear a line or go back to beginning of the line to
>write over the 20 and so on.
On most terminals, outputing a "\r" will back up to the beginning of
the current line.
If you want to do something fancier than than, then you might want to
take a look at the Term::Cap module. <URL:http://reference.perl.com/
module.cgi?Term::Cap>
--
Andrew Langmead
------------------------------
Date: Thu, 23 Apr 1998 17:10:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Norman Gaywood <norm@turing.une.edu.au>
Subject: Re: suid perl scripts yet again
Message-Id: <Pine.GSO.3.96.980423085039.6132J-100000@user2.teleport.com>
On 23 Apr 1998, Norman Gaywood wrote:
> But, depending on your file creation mask, su may or may not be able to
> get to the script to execute. So the test fails at a point that is
> not relevent to what it is testing.
It sounds as if you've found a bug in Configure. You could fix it, and
submit the patch via the perlbug program. (It may be more appropriate to
simply add to your system's hints file, though, so that Configure won't
even need to run a test.)
> But alas, the test still fails. So I assume that my kernel has no
> suid script support.
Only your hairdresser knows for sure. Oh, wait. That should be "vendor".
:-)
> The next question in Configure asks if I want suid script emulation.
> It has a default anwser of no. If I ignore the advice and say yes,
> suidperl is built. But when I try to run a suid script with a
> "#!/usr/local/bin/suidperl -Tw" line, suidperl shouts:
>
> YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
> FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!
That's a sign that your kernel does have set-id scripts, but they may be
the insecure kind. (That program was running set-id, but maybe it
shouldn't have been.) Find out from your vendor's docs whether your set-id
scripts are secure, if possible.
> I can deal with wrapper scripts but I would really like to get setuid
> scripts to run. So how do I disable suid scripts in the kernel that don't
> seem to be supported in the kernel?
You probably can't disable them in the kernel without the kernel source.
Install Linux. :-)
> Aother note. My linux systems seem to have no suid support in the
> kernel (even though /dev/fd is in place), according to the Configure
> test. Configure also wants to say no to suid script emulation, but if
> you build suidperl, it seems to work quite well.
Right. Linux (unpatched) doesn't support set-id scripts, but you can
emulate them just fine.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 23 Apr 1998 12:37:09 -0600
From: dtbaker@flash.net
Subject: Re: techniques for tagging substitution areas in templates?
Message-Id: <6hnu85$m0i$1@nnrp1.dejanews.com>
In article <Pine.GSO.3.96.980422115226.6132c-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>
> On Wed, 22 Apr 1998, Dan Baker wrote:
>
> > in cases where a small number of substitutions may be desired to an
> > existing document in KNOWN areas... i.e. inserting auto-generated
> > sections into a HTML or plain text template. What are some good
> > techniques for tagging the areas to insert/substitute?
>
> Use a module, like Text::Template. Hope this helps!
-----------------
encouraging, but I must be missing something... I checked out the Text::
module docs and source, and did not find a Text::Template module. I have the
5.004_02 GS release, and the modules listed are: Abbrev.pm, ParseWords.pm,
Soundex.pm, Tabs.pm, Wrap.pm
I am new to perl, and may be looking in the wrong place? If you could be a
little more specific about where I can find info on the module, it would
really help me out...
thanx,
Dan
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 23 Apr 1998 19:00:29 GMT
From: lvirden@cas.org
Subject: Re: What is OFFICIAL version of Perl FAQ?
Message-Id: <6ho34d$g9b$3@srv38s4u.cas.org>
According to jc22a70a0-Beyerl <db21@ih4gp756.ih.att.com>:
:find is Ver. 3, dated 03/17/97. A comparison of the dates and version
:numbers is as follows:
:
: Ver. 3 Ver. 4
: 0 - 03/17/97 0 - 04/24/97
: 1 - 1.10 1 - 1.12
: 2 - 1.13 2 - 1.16
: 3 - 1.19 3 - 1.22
: 4 - 1.15 4 - 1.19
: 5 - 1.19 5 - 1.22
: 6 - 1.14 6 - 1.17
: 7 - 1.15 7 - 1.18
: 8 - 1.15 8 - 1.21
: 9 - 1.13 9 - 1.16
:
To add to your table, here's the info in the perl 5.004_64 pod directory's
perlfaq*.pod files:
0 - April 24, 1997
1 - 1.12
2 - 1.16
3 - 1.22
4 - 1.19
5 - 1.22
6 - 1.17
7 - 1.18
8 - 1.21
9 - 1.17
It's rather a surprise to me that no new questions, or new solutions to
questions, or corrections, have been found since April 24, 1997 . I guess
all the complaints about the same questions being asked over and over are
really true - not one new question in the past year has qualified as being
'frequently asked'.
--
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Thu, 23 Apr 1998 16:47:30 -0400
From: Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com>
Subject: WIN32 - create shortcut on desktop
Message-Id: <353FA8E2.3FD1@daytonoh.ncr.com>
I want to automate the creation of shortcut icons on a NT desktop.
Is there a Perl library module that can create a shortcut that will
appear on a NT desktop ??
Or
Does anyone now the command line interface to do it ??
Thanks
------------------------------
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 2404
**************************************