[7965] in Perl-Users-Digest
Perl-Users Digest, Issue: 1590 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 6 17:07:38 1998
Date: Tue, 6 Jan 98 14:00:26 -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, 6 Jan 1998 Volume: 8 Number: 1590
Today's topics:
Re: "shift @array" question <rootbeer@teleport.com>
Re: Calling 'require' on an arbitrary module <rootbeer@teleport.com>
Re: file globbing <Rosie@dozyrosy.demon.co.uk>
Re: Help! "%1 is not a valid Windows NT application." <rootbeer@teleport.com>
Re: How I can sign number thousands example: 10000 to <*@qz.to>
Re: How to mimic C's #include "global.pl" <*@qz.to>
Re: HTTP::Request::Common, print, and other misc ?'s <rootbeer@teleport.com>
impure embedded perl <dhoover@textwise.com>
Re: Is there a random function (Michael Kelly)
Re: Lexical scope and embedded subroutines. <rootbeer@teleport.com>
Re: NEWBE: Triming an input string <rootbeer@teleport.com>
No "POSIX" in Win95/NT Perl? (binary) (Lynchqvctc)
Re: Performing UNIX commands in a perl script <andy.rice@virgin.net>
Re: Perl & Win95 running a dos box mstanSPAAAM@flash.net
Perl 5.004_04 Compilation errors (Waqar Hafiz)
Re: Perl pgm to provide web page date? (Phil Buckley)
Re: Perl sort( ) Argument Passing Problem <rootbeer@teleport.com>
Re: Perl sort( ) Argument Passing Problem (Earl Hood)
Re: PERL: How do I overwrite output? (Thijs Kinkhorst)
Question about installation of module <kapur@cbl.ncsu.edu>
Re: recomended Perl books ? <doug1@net-link.net>
redirection & perl <webmaster@createyourweb.com>
Re: searching many text files sequentially for strings <*@qz.to>
Re: sending email (Net::SMTP).. problem <Jacqui.Caren@ig.co.uk>
Re: sending email (Net::SMTP).. problem <*@qz.to>
Re: serious post about gmtime and year-1900 (was Re: Pe (Chris Nandor)
Something equivalent to open("|foo|")? (Quixote Digital Typography)
Re: Something equivalent to open("|foo|")? <daftary@_remove_to_send_email_.cisco.com>
Sorting on the xth position in a ascii file. <jan@skynet.be>
Re: Tech writer lifts burden from programmers scott@softbase.com
Testing for valid RegExps? <mhazen@franklin.uga.edu>
Re: This may sound like a stupid question <*@qz.to>
Re: Two-byte characters substitution ? <rootbeer@teleport.com>
Re: Using perl to validate links <*@qz.to>
Win32--Add to program to system tray or Hide while runn <deflores@bigfoot.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 6 Jan 1998 11:39:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jerry Lineberry <jerryl@connecti.com>
Subject: Re: "shift @array" question
Message-Id: <Pine.GSO.3.96.980106113904.7761S-100000@user2.teleport.com>
On Tue, 6 Jan 1998, Jerry Lineberry wrote:
> Ok, I have a script that works fine. However, I feel that it could
> have been done better. For instance, at one point I have to use the shift
> command three times in a row. Can this be done with one command?
Yes, with splice(), among other ways. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Tue, 6 Jan 1998 11:01:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Joshua J. Kugler" <jkugler@inreach.com>
Subject: Re: Calling 'require' on an arbitrary module
Message-Id: <Pine.GSO.3.96.980106105900.7761K-100000@user2.teleport.com>
On Sun, 4 Jan 1998, Joshua J. Kugler wrote:
> You could try having your subroutines after your __END__ statement in
> your Perl code. Then the routines would only be compiled if they are
> called. I think. You might have to double check that.
You may be thinking of the AutoLoader, or something like that. But Perl
doesn't do this by default. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Tue, 6 Jan 1998 20:42:14 +0000
From: Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk>
Subject: Re: file globbing
Message-Id: <N6p02DAmcps0Ewb4@dozyrosy.demon.co.uk>
In article <ebohlmanEMC9BD.KMn@netcom.com>, Eric Bohlman
<ebohlman@netcom.com> writes
>Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk> wrote:
>
>: Can I do something neater for the next two lines:
>: foreach $card (@card_list) {
>: $icon = shift(@card_icons);
>
>OUCH! You have no guarantee that your two lists are paired up;
EEK - it should be me saying OUCH for making unwarranted assumptions.
:-(
>glob() is
>not required to return filenames in any particular order, and you've just
>been lucky that your particular directory structure has the names in the
>same order. You'd better change those "push" lines to:
>
>push @card_list,sort glob("$card_prefix*.*");
Many thanks for your help, Eric.
Cringing,
Rosemary
-------------------------------------------------------------------
| Rosemary I.H.Powell EMail: Home: rosemary@dozyrosy.demon.co.uk |
| Work: r.i.h.powell@rl.ac.uk |
| http://www.netlink.co.uk/users/dozyrosy/ |
| http://www.dozyrosy.demon.co.uk/ |
-------------------------------------------------------------------
------------------------------
Date: Tue, 6 Jan 1998 11:04:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: neil@cqit.qld.edu.au
Subject: Re: Help! "%1 is not a valid Windows NT application."
Message-Id: <Pine.GSO.3.96.980106110245.7761L-100000@user2.teleport.com>
On Mon, 5 Jan 1998, Neil Barker wrote:
> I get the following error when my browser
> calls the cgi file.
> "%1 is not a valid Windows NT application. "
That's not a Perl error message. It looks as if it's coming from your
system or webserver, or possibly a browser. If you can't find the answer
you need in the relevant docs, you may need to ask in a newsgroup about
one of these. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 6 Jan 1998 19:12:39 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: How I can sign number thousands example: 10000 to 10.000
Message-Id: <qz$9801061404@qz.little-neck.ny.us>
Claudio Villa Santa <claudio@crpweb.com> wrote:
[please don't post mixed text/html]
> I have a little problem:
Don't worry, we won't tell anyone.
> How I can sign number thousands example: 10000 to 10.000
Sounds like you want to read the "How can I output my numbers with commas
added?" question in part 5 of of the perlfaq.
> Tanks
What? Like a big fish bowl? (Have you been reading RHOD?) Or like
a Sherman? (Have you been reading AFTG?)
Elijah
------
a legion of Siamese fighting fishes versus the bozos in Speed 2: who wins?
------------------------------
Date: 6 Jan 1998 20:57:21 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: How to mimic C's #include "global.pl"
Message-Id: <qz$9801061550@qz.little-neck.ny.us>
Moises G. Solis <moises@texas.net> wrote:
> I have a Perl script called global.pl that
> contains global definitions. I want to bring
> this script into another script. I'm trying to
> mimic: #include "global.pl" from C. The question
> is, which is the best way for doing this?
"require" it. There are plenty of examples in the perlfunc documentaion.
Elijah
------
the documentation should be required reading
------------------------------
Date: Tue, 6 Jan 1998 11:32:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: SasEz! Publications and Design <sase@sasezdesyn.com>
Subject: Re: HTTP::Request::Common, print, and other misc ?'s
Message-Id: <Pine.GSO.3.96.980106112803.7761Q-100000@user2.teleport.com>
On Tue, 6 Jan 1998, SasEz! Publications and Design wrote:
> open(INFO, $file);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> foreach $line {
> use HTTP::Request::Common qw(POST);
Generally, it's better to put all 'use' declarations near the beginning of
your script. Since it's a compile-time declaration, it doesn't do much
good to put it within a loop - although it doesn't hurt either.
> my $req = POST $line, [ %in ];
> } or die "No can do: $!";
Maybe you meant to put the "or die" inside the loop somehow.
> 1-> Randal said the HTTP::Request::Common method will automatically
> escape form data for me, does this mean I do not need a sub such as
> &getcgivars ?
Are the docs somehow unclear on this point?
> 2 -> How do I print responses when using this module? Should I still
> use the UserAgent for that part?
[ and lots more questions snipped ]
I think that at least some of these should be answered in the docs.
> 3 -> since $file is only being read from, do I need to worry about
> using flock?
Yes, if any other process might be writing to the file at the same time.
If you have more questions after you've read the docs, please post them.
Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Tue, 06 Jan 1998 16:31:46 -0500
From: Dean Hoover <dhoover@textwise.com>
Subject: impure embedded perl
Message-Id: <34B2A2C2.1EFD@textwise.com>
I am embedding perl in a C program and it is *very* cool. My hat is
off to the various developers. I do have a concern though...
I ran my program through 'purify' to see if I had any memory related
problems and gazillions of UMR (uninitialized memory read) warnings
came out from libperl.a. This is probably an easy thing to fix in
some future release of perl. Am I right?
Dean Hoover
------------------------------
Date: Tue, 06 Jan 1998 19:00:44 GMT
From: mkelly99@NOSPAMgate.net (Michael Kelly)
Subject: Re: Is there a random function
Message-Id: <34ba7f23.84441062@news.gate.net>
Yes, but every time I try to call it they change the name on me! :)
Mike
"Genius gives birth, talent delivers."
- Jack Kerouac
(remove NOSPAM from address, if present, to reply)
------------------------------
Date: Tue, 6 Jan 1998 11:24:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Aaron Harsh <ajh@rtk.com>
Subject: Re: Lexical scope and embedded subroutines.
Message-Id: <Pine.GSO.3.96.980106111213.7761O-100000@user2.teleport.com>
On Mon, 5 Jan 1998, Aaron Harsh wrote, concerning an inner sub which uses
a variable lexically declared within an outer sub:
> Before I read this thread (and perlsub to get the details) I would have
> assumed the original code was fine.
The original code is fine. It just doesn't do what some people would
expect, that's all. :-)
> This behavior brings up the following questions:
> o Is Perl's behavior some sort of speed optimization?
Everything in perl is some sort of speed optimization. :-) But there are
several possible behaviors that could have been chosen by the Perl
developers; this one is as reasonable as any and more so than some.
> o Did the Perl gods just decide that scheme-like behavior was less
> important than the pseduo-static variables described in perlsub?
Mystery to me. :-)
> o Does anyone else find Perl's behavior counter-intuitive?
Sure, it can be. But is there a better rule which no one would find
counter-intuitive?
> o Did programming in scheme destroy my ability to judge a decent language
> feature?
> o Have I misremembered how scheme handles these situations?
> o Do Perl programmers really care how much Perl acts like scheme?
> o Should I have stopped this message two or three questions ago?
Probably. :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Tue, 6 Jan 1998 11:08:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Theo den Brinker <theo@bangkokpost.net>
Subject: Re: NEWBE: Triming an input string
Message-Id: <Pine.GSO.3.96.980106110717.7761N-100000@user2.teleport.com>
On Tue, 6 Jan 1998, Theo den Brinker wrote:
> In article <34ad3433.11292567@news.on-net.net>, djboyd@sam.on-net.net wrote:
>
> > How does one trim a string. That is, like in VB you can issue a
> > command such as ltrim which will remove all spaces etc, on the left
> > hand of the string and same for rtrim. How does one do this in perl.
> > that is remove spaces, tabs and new line on the right hand side of a
> > string.
> Use regular expression substitution
>
> $the_string_you_want_to_trim =~ s/^\s*(.*)\s*$/$1/;
That won'd do what the poster requested. But I think the poster was really
asking a question from the FAQ, which has a perfectly suitable answer.
Don't you agree?
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 6 Jan 1998 20:49:03 GMT
From: lynchqvctc@aol.com (Lynchqvctc)
Subject: No "POSIX" in Win95/NT Perl? (binary)
Message-Id: <19980106204900.PAA03985@ladder02.news.aol.com>
Trying to learn DB access/maintenance via web interface... using perl. One perl
program I'm trying to run (modified from online source) gives me an error that
"POSIX" not found. It is not present in my perl lib etc.-- is it not included
in Win95/NT (ActiveState) version (latest?).... Where might I go (besides this
newsgroup) to find out my own answers to this question? Thanks...
------------------------------
Date: Tue, 06 Jan 1998 21:38:24 +0000
From: Andy Rice <andy.rice@virgin.net>
Subject: Re: Performing UNIX commands in a perl script
Message-Id: <34B2A450.A3AA8C65@virgin.net>
Try using the system or exec functions. exec will end your perl script
and run the program specified. system (more useful) will run the command
and carry on with your script. E.g.
system("ls -l");
exec("ls -l");
hope this helps.
Andy Rice
andy.rice@virgin.net
------------------------------
Date: Tue, 06 Jan 1998 20:36:59 GMT
From: mstanSPAAAM@flash.net
Subject: Re: Perl & Win95 running a dos box
Message-Id: <34b394eb.58258392@209.30.0.7>
On 6 Jan 1998 14:29:47 GMT, ricklim@vcn.bc.ca (Rick Lim) wrote:
>Is it possible using perl for windows to run a dos
>box in win 95 and send it keystrokes just like a=20
>human would, and then MARK, COPY, PASTE from the clipboard
>the contents of the dos box back into the running perl app ???
Yes and no. Your best bet is probably to open a pipe to the
application. See the documentation for chat2.pl for more ideas
on how to do this. If you're really masochistic, see the
Win32::API module for more ideas.
------------------------------
Date: Tue, 06 Jan 1998 20:36:33 GMT
From: waqar.hafiz@virgin.net (Waqar Hafiz)
Subject: Perl 5.004_04 Compilation errors
Message-Id: <68u4n8$sbg$1@nclient5-gui.server.virgin.net>
I'm getting the following errors while compiling Perl on a Sun SS10
running Solaris 2.5.1. gcc 2.7.2 is the compiler. Any ideas would be
greatly welcome.
/usr/ccs/bin/makee
make: Warning: Both `makefile' and `Makefile' existt
`sh cflags libperl.a miniperlmain.o` miniperlmain.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a perl.o` perl.c
CCCMD = gcc -DPERL_CORE -c -O
perl.c: In function `open_script':
perl.c:1862: warning: assignment makes pointer from integer without a
castt
`sh cflags libperl.a malloc.o` malloc.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a gv.o` gv.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a toke.o` toke.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a perly.o` perly.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a op.o` op.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a regcomp.o` regcomp.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a dump.o` dump.c
CCCMD = gcc -DPERL_CORE -c -O
`sh cflags libperl.a util.o` util.c
CCCMD = gcc -DPERL_CORE -c -O
util.c: In function `Perl_form'::
util.c:1107: number of arguments doesn't match prototypee
proto.h:125: prototype declarationn
util.c: In function `Perl_die'::
util.c:1164: number of arguments doesn't match prototypee
proto.h:70: prototype declarationn
util.c: In function `Perl_croak'::
util.c:1231: argument `pat' doesn't match prototypee
proto.h:47: prototype declarationn
util.c:1231: number of arguments doesn't match prototypee
proto.h:47: prototype declarationn
util.c: In function `Perl_warn'::
util.c:1288: number of arguments doesn't match prototypee
proto.h:529: prototype declarationn
util.c: In function `Perl_my_popen'::
util.c:1818: warning: return makes pointer from integer without a
castt
*** Error code 1
make: Fatal error: Command failed for target `util.o''
------------------------------
Date: Tue, 06 Jan 1998 18:36:55 GMT
From: !pbuckley@tiac.net (Phil Buckley)
Subject: Re: Perl pgm to provide web page date?
Message-Id: <34b27968.9669113@News.Varian.COM>
On Tue, 06 Jan 1998 08:57:34 -0500, Scott Vetter
<svetter@ameritech.net> wrote:
>Is there a Perl program that will provide the date of last update of
>the web page that is being displayed? It sure would beat haveing to
>chage the date every time the web page is updated.
I use a server side include as follows:
Last updated: <!--#echo var="LAST_MODIFIED"-->
I have to chage the page to blahblah.SHTML for it to work though
Phil Buckley
pbuckley@tiac.net
Phil Buckley
pbuckley@tiac.net
http://www.tiac.net/intstute
remove the "!" before replying via e-mail
------------------------------
Date: Tue, 6 Jan 1998 10:58:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: MICHAEL JONES <michael.jones@EBay.Sun.COM>
Subject: Re: Perl sort( ) Argument Passing Problem
Message-Id: <Pine.GSO.3.96.980106104149.7761J-100000@user2.teleport.com>
On Mon, 5 Jan 1998, MICHAEL JONES wrote:
> I would like to call the external subroutine like
>
> foreach $i ( sort External_Module->sort_subroutine ( keys %HASH ) ) {
Perhaps you want to use a double-colon instead of a small arrow there. But
be aware that you'll have to use the package variables $a and $b, as
documented in the perlfunc manpage.
> 1) When calling an external subroutine, the first argument passed to the
> subroutine is the module name (i.e. 'External_Module'). This seems
> to mess up the $a, $b arguments that sort passes to the sorting sub-
> routine.
It sounds as if you're mixing up OO calling with sort-definition
subroutine calling, which are totally different beasties. You can't do
that, and you shouldn't want to. :-)
> 2) I would like to pass a reference to the hash to the sorting
> subroutine
> so I could sort on more than just the key, but I can't find a way to
> pass this reference without messing up $a and $b.
You can't pass additional arguments to the sort definition sub. But maybe
there's another way to do what you want.
For example, you could make a routine which takes as args a hash(ref) and
possibly some other parameters, and which returns the keys of the hash
sorted in some order, perhaps something like this.
sub keys_by_value {
my $hr = shift;
return # Schwartzian trans.
map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [ $_, $$hr{$_} ] }
keys %$hr;
}
In other words, you could make a "full-service" sorting routine, rather
than just a sort definition function. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 6 Jan 1998 20:46:42 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Perl sort( ) Argument Passing Problem
Message-Id: <68u57i$39n@news.service.uci.edu>
In article <34B13804.57390ED9@EBay.Sun.COM>,
MICHAEL JONES <michael.jones@EBay.Sun.COM> wrote:
>I would like to call the external subroutine like
>
>foreach $i ( sort External_Module->sort_subroutine ( keys %HASH ) ) {
> ...
>}
>
>I have the following problems:
>
>1) When calling an external subroutine, the first argument passed to the
> subroutine is the module name (i.e. 'External_Module'). This seems
> to mess up the $a, $b arguments that sort passes to the sorting sub-
> routine.
The example you have does not behave as you expect. The
"External_Module->sort_subroutine" is actually a class method
call passing the keys of %HASH as arguments. Hence, the sort will
be applied to the return value of External_Module->sort_subroutine.
If custom comparison routine is to be supplied, it needs to be the
name of routine or a block. Example:
sort External_Module::sort_subroutine keys %HASH
A problem you will have is with package scoping since the $a and $b
will be in the scope of the sort call and not in External_Module.
You can do something like the following to get around the problem:
sort { External_Module::sort_subroutine($a, $b) } keys %HASH
and External_Module::sort_subroutine does its comparisons on the
first and second argument instead of $a and $b.
>2) I would like to pass a reference to the hash to the sorting
>subroutine
> so I could sort on more than just the key, but I can't find a way to
> pass this reference without messing up $a and $b.
Expand previous example:
sort { External_Module::sort_subroutine($a, $b, \%HASH) keys %HASH
However, I think this is bad design. If you are going to do sorting
that requires more than simple scalar comparisons, you should have
special routines that do the sorting or use OO techniques.
Subroutine example:
foreach (get_sorted_keys(\%HASH)) {
...
}
OO example:
$obj = new SomeObject;
# some operations here ...
# Call objects sort method (name of method should have more meaning)
foreach ($obj->sort) {
...
}
The OO way is probably better since the sorting will require knowledge
of the object's structure.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Tue, 06 Jan 1998 20:47:46 GMT
From: thijs@kink.xs4all.nl (Thijs Kinkhorst)
Subject: Re: PERL: How do I overwrite output?
Message-Id: <68u59i$s3$1@news2.xs4all.nl>
In article <Pine.BSI.3.96.980104184409.21690A-100000@bermuda.io.com>,
Chocolate <poohba@io.com> writes:
>Is it possible to overwrite the output with the new output? Like if I
>wanted to do a count down can I have it so that it starts with 10 and then
>the 9 replaces the ten instead of going next to it or below it. Is this
>possible?
Try this:
for($a=10;$a>-1;$a--) {
print "$a \r";
sleep(1);
}
It will count down from 10 to 0. It prints the number, and then a carriage
return (CR, "\r") putting the cursor on the start of the line where it will
print the new character over the old one. The sleep is there so you can
actually see what's happening :-).
It worked fine here under Win32, I haven't tested it under UNIX yet.
--
Thijs Kinkhorst * thijs@kinkhorst.com * http://www.kinkhorst.com/
ICQ 432406 "Omelette du Fromage" --Dexter KeyID 0x371EFCB1
--- Fight Spam on the Internet! http://spam-mirror.cetis.hvu.nl/ ---
------------------------------
Date: Tue, 06 Jan 1998 16:44:33 -0500
From: Nevin Kapur <kapur@cbl.ncsu.edu>
Subject: Question about installation of module
Message-Id: <34B2A5C1.AFD07A9C@cbl.ncsu.edu>
I downloaded the Statistics::Descriptive module from CPAN, ran
Makelfile.PL and then make all. I get the following directory structure:
\
|_ Changes
|_ Descriptive.pm
|_ MANIFEST
|_ Makefile
|_ Makefile.PL
|_ README
|_ blib
| \
| |_ arch
| | \
| | |_ auto
| | \
| | |_ Statistics
| | \
| | |_ Descriptive
| |_ lib
| | \
| | |_ Statistics
| | | \
| | | |_ Descriptive.pm
| | |_ auto
| | \
| | |_ Statistics
| | \
| | |_ Descriptive
| |_ man3
| \
| |_ Statistics::Descriptive.3
|_ pm_to_blib
I wanted to know what is the appropriate location for all these
directories. Currently I have created a directory called Statistics in
one of the directories in @INC and copied Despcriptive.pm in it. Is this
the correct way to install? What are the all the other directories that
are generated? The README file with the source does not say anything
about this.
Thanks,
Nevin
------------------------------
Date: Tue, 06 Jan 1998 14:56:39 -0500
From: Douglas Clifton <doug1@net-link.net>
Subject: Re: recomended Perl books ?
Message-Id: <34B28C77.D2C4C450@net-link.net>
Randal Schwartz wrote:
> >>>>> "jay" == jay <mocat@NOSPAM.best.com> writes:
>
> jay> So I recommend going out and purchasing Learning PERL and
> jay> Programming PERL at the same time. One is sparse in areas, the
> jay> other has lots of info and such.
>
> For some reason, I cannot disagree with you. :-)
Could that be because you wrote the former and co-wrote the later? ;-)
> jay> If you plan on doing a lot of text manipulation, should take a
> jay> look at Mastering Regular Expressions (O'reiley too) and look at
> jay> the perlre manpage.
>
> Jeffrey Friedl's MRE is a Very Good Book. I've been hacking regular
> expressions for 20 years now (using Unix since 1977), and I *still*
> learned a surprising amount of stuff from this book. Congrats, Jeffrey!
MRE is a great regexp text.We are well on our way to acquiring the entire O'Reilly
library...
--
Douglas Clifton
Programmer
===================
Web One Inc.
Website Development
Phone: 888-699-WEB1
Phone: 616-552-9999
Fax: 616-552-9920
sales@weboneinc.com
www.weboneinc.com
===================
------------------------------
Date: Tue, 06 Jan 1998 16:55:38 -0400
From: Neil Trenholm <webmaster@createyourweb.com>
Subject: redirection & perl
Message-Id: <34B29A4A.5927379A@createyourweb.com>
Hi,
I am buying web & cgi "space" on a Unix/Apache server. My Unix & perl
knowledge is basic but improving - thanks to many people.
My problem:
-----------
I am using perl to redirect users using
print "location:$url\n\n"
and get a 302-Temporarily moved.
My Questions:
-------------
What is a 302 and why do I get it ?
Does this mean redirection is not allowed on my server ?
Thanks for any help,
Neil
Creative Web Design
Web Design, Creation & Site Management, Graphics, Internet Marketing
http://www.createyourweb.com
(902) 447-3779, RR2, 2695 Hansford Road, Oxford, Cumberland Co., NS,
Canada
------------------------------
Date: 6 Jan 1998 21:04:41 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: searching many text files sequentially for strings and replacing
Message-Id: <qz$9801061556@qz.little-neck.ny.us>
Erik <erik@peak.mrc.montana.edu> wrote:
> I am trying to search through a directory full of text files, replacing
> text with other text, and writing a new version of the file in a
> different directory. Does someone have a template for the array
> operations and 'while' structure needed to do this?
Yes, someone does.
(Oh, you wanted a copy? Have you looked at -i in the perlrun documentation?)
Elijah
------
-i itself is not quite what you want
------------------------------
Date: Tue, 6 Jan 1998 18:45:52 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <EMDLGK.3Dn@ig.co.uk>
In article comp.mail.misc:<34B19ED9.34F052A9@spam.spam>,
catty <spam@spam.spam> writes:
>Graham Barr wrote:
>
>> The I would suggest you read up a bit more on mail, before
>> you start flaming people.
>
>Good advice ... you should take it.
Having worked with mailsystems for over six years I know a
reasonable amount about email - Graham is one of those
people I look up to...
His postings wrt SMTP NNTP etc indicate a significant knowledge
of the relevant standards and his perl modules are well written
unlike some I have seen.
So, catty - unless your can explain just what you mean, please
take your flame bait and ...
A happy new year to all - except catty and other spam artists :-)
Jacqui
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: 6 Jan 1998 21:44:13 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <qz$9801061633@qz.little-neck.ny.us>
Jacqui Caren <Jacqui.Caren@ig.co.uk> wrote:
> catty <spam@spam.spam> writes:
> >Graham Barr wrote:
> >> The I would suggest you read up a bit more on mail, before
> >> you start flaming people.
> >Good advice ... you should take it.
> Having worked with mailsystems for over six years I know a
> reasonable amount about email - Graham is one of those
> people I look up to...
>
> His postings wrt SMTP NNTP etc indicate a significant knowledge
> of the relevant standards and his perl modules are well written
> unlike some I have seen.
Graham, in this thread, has recommended that people *not* use his
own SMTP module to send him mail because it does not add headers
he wants to see when filtering. catty's comment is misplaced, but
it is easy to find Graham's advice disingenuous.
Elijah
------
just got Graham's mailtools and libnet modules to examine them today
------------------------------
Date: Tue, 06 Jan 1998 15:20:02 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
Message-Id: <pudge-0601981520030001@ppp-10.ts-1.kin.idt.net>
In article <19980106.114424.0G1.rnr.w164w@locutus.ofB.ORG>, Russell Schulz
<Russell_Schulz@locutus.ofB.ORG> wrote:
# pudge@pobox.com (Chris Nandor) writes:
#
# >> personally, I'd guess that it's not just misreading, but also mistrust.
# >> it's HEALTHY to mistrust anything that returns `98'. why not `1998'?
# >
# > Fine, mistrust it. But you can always check it out for yourself,
# > can't you?
# > $year = 60 * 60 * 24 * 365;
# > @time = localtime(time() + $year * 3);
# > print $time[5];
#
# this might be a good thing to put in the documentation, instead of a
# `trust me it will work' style claim.
Can't you figure that code out for yourself? Simply add a few years to
the date value, and put it through the routine. I don't see what the
difficulty is.
Programming is an empirical science. I've been saying that too much today.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: 6 Jan 1998 12:52:34 -0800
From: quixote@shell2.bayarea.net (Quixote Digital Typography)
Subject: Something equivalent to open("|foo|")?
Message-Id: <68u5ii$oea@shell2.bayarea.net>
I would find it helpful to be able to do have a perl program send data
to a program's stdin and get its stdout back. I have a vague
recollection that this may have been discussed in the past, but alas,
I forgot to make a note of what the answer was. I guess I'm looking at
something along the lines of named pipes perhaps? Or is there
something simpler & more direct?
-dh
--
Don Hosek dhosek@quixote.com Quixote Digital Typography
312/953-3679 fax: 312/803-0698 orders: 800-810-3311
For information about SERIF: THE MAGAZINE OF TYPE & TYPOGRAPHY,
http://www.quixote.com/serif/ or mail serif-info@quixote.com
------------------------------
Date: Tue, 06 Jan 1998 13:37:32 -0800
From: Kuntal Daftary <daftary@_remove_to_send_email_.cisco.com>
Subject: Re: Something equivalent to open("|foo|")?
Message-Id: <34B2A41C.4EFAFAE3@_remove_to_send_email_.cisco.com>
Quixote Digital Typography wrote:
> I would find it helpful to be able to do have a perl program send data
> to a program's stdin and get its stdout back. I have a vague
> recollection that this may have been discussed in the past, but alas,
> I forgot to make a note of what the answer was. I guess I'm looking at
> something along the lines of named pipes perhaps? Or is there
> something simpler & more direct?
as i understand, you cannot use open for two-ended pipes. you need to
either go
for named pipes or use the pipe command in perl.
one more suggestion (of which i m not 100% sure). i had heard
somewhere about a
"open2" command which serves the purpose. since i cannot recollect
where i heard
of it, maybe i was dreaming ;-)
--
#!/usr/local/bin/perl5
$d=12;for($b=$c=10;$a=substr "ASDDFGSFDHGAads \
??DBSDBSEBDCDDzFBDCECBADDDCBDDCBDGDIFBECEDDAACBABDADAABDADAACAACBAFFBFBFBDACD
\
DBCDDBCDCACDGFBFBFBCBDBEBDBEBDBCBDBHFBFBFBCBDBEBDBEBDBCBDBHFBFBFBCBDBEBDBEBDB
\
CBDBHFBFBFADBDBEBDBEBDBCBDBHGGAGEBDBEBDBEBDBCBDBHHECEGEABDCCCDCCCCEABG]CCBDCC
\
CDCCCCCCBF??IAwCLGByCKGBzBKGBzBKGBYDNCBDFBKGBADGCIAACBADCEDADAACBKGCACBACAACG
\
ACDDAACEBCDDBKGBCDCACCEBDBDACCDBKBKGBDBCBDCDBDBCBDCCBKBKGBDBCHEBDBCHDBKBKGBDB
\
CGFBDBCGEBKBKGBDBCBKBDBCBJBKBKGBDBCDDADGDDDACCJBKHEFGEFFGECICAAHICHEFBKESCI_B
\
o_Bo`Bn??GA_AhEB^BiEB^BiEB^BiEB^BSCBDMEBBCFDGDDBBCGCEDADAAJEBAAACDAACBACAACBA
\
ABAAACEAACEBCDKECCCBACDCACDBCCAEACCDBREBEBABDBCBIBCAEBDCCBREBEBABDBCBIBBAFHDB
\
REBEBABDBCBIBABFGEBREBEBABDBCBIFEBJBREBEBABDBCCEABBBCDDDACCQEBEBBEABCGCBCCAAB
\
GECPFBDBCCCBCEEBCCDEYLAfKA?JA?IA???",$b+++6,1;++$d){for($a=ord
$a;$a-->64;){
printf "%c",++$c==ord Z?$d=$c=$c/9:32^$d&1;}}
------------------------------
Date: Tue, 6 Jan 1998 21:38:46 +0100
From: "Jan Van den heuvel" <jan@skynet.be>
Subject: Sorting on the xth position in a ascii file.
Message-Id: <68u400$ucn$1@news0.skynet.be>
I need to sort a large file starting with the 15 th position.
What do I use ?
Jan
------------------------------
Date: 6 Jan 1998 20:38:05 GMT
From: scott@softbase.com
Subject: Re: Tech writer lifts burden from programmers
Message-Id: <68u4nd$7k$1@mainsrv.main.nc.us>
Eric D. Friedman (friedman@uci.edu) wrote:
> I'd be pretty reluctant to engage a writer who can't differentiate
> between "that" and "who."
> One style guide I've got lying around says, "who refers to people, and
> that and which refer to animals and things. That may also be used to
> refer to an anonymous group of people."
This issue, like the command not to ever split infinitives, is mostly
something invented by style guide writers that wanted more stuff to pad
out their books. There's no particular reason for it. "That" can
apply to people as well, and often sounds more natural.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Tue, 6 Jan 1998 16:31:53 -0500
From: Mark Hazen <mhazen@franklin.uga.edu>
Subject: Testing for valid RegExps?
Message-Id: <Pine.WNT.3.95.980106160346.-133905c-100000@fcsg1.franklin.uga.edu>
Hi folks... please respond both via email and this group, if possible.
This should have a decently quick and dirty answer....
I'm looking for a way, in Perl, to test the validity of a regexp given by
the user. I didn't find any such module on CPAN, but I'd really love to
know if there's a way within Perl to do this without having to load
another module (or with loading one of the standard modules).
In longer words, I'm writing a program which reads a config file, which
can pass the Perl program a list of patterns to match. To avoid nasty
error messages, I'd like to make sure that if this config file does indeed
include a regexp as part of a pattern to match (which I'd like to allow
for) it's a regular expression which can be parsed properly... in order to
avoid bad regexps like "*.txt" (which results in a runtime crash of the
Perl program).
Got any ideas? Thanks in advance for any recommendations you could make.
-mh.
----
. _+m"m+_"+_ Mark Hazen Network Administrator, Dean's Office
d' Jp qh qh The Franklin College of Arts & Sciences
Jp O O O The University of Georgia (706)542-1546
Yb Yb dY dY
O "Y5m2Y" " even the mightiest wave starts out as a ripple.
"Y_ why make waves when it's easier to nurture ripples?
------------------------------
Date: 6 Jan 1998 19:02:34 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: This may sound like a stupid question
Message-Id: <qz$9801061352@qz.little-neck.ny.us>
Myles Lawrence <myleslawrence@email.msn.com> wrote:
> but not to me.
Sure sounds like a stupid subject. Maybe you should read:
<URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>.
> When you use the <input type="file"... upload statement. Where does the file
> go?
This has nothing to do with perl. Perhaps you were looking for a
different newsgroup?
Elijah
------
can answer many perl questions but few CGI/HTML3.x/HTTP1.1 questions
------------------------------
Date: Tue, 6 Jan 1998 11:26:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Wu <weihan@ziyou.math.ncu.edu.tw>
Subject: Re: Two-byte characters substitution ?
Message-Id: <Pine.GSO.3.96.980106112506.7761P-100000@user2.teleport.com>
On 6 Jan 1998, Wu wrote:
> I have a Chinese character with rear part of its two-byte is "[" ,
> which has special meaning in regexps and will certainly get compilation
> error. How am I supposed to do ?
When a character is special in a regular expression, you may make it
non-special by preceeding it with a backslash: \[ . But that probably
won't solve all of the problems with matching two-byte characters, which
is more serious. You may want to purchase a back issue of The Perl
Journal, which had an article about doing this. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 6 Jan 1998 19:14:54 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Using perl to validate links
Message-Id: <qz$9801061409@qz.little-neck.ny.us>
<nikkim@senate.leg.state.mn.us> wrote:
> Is it possible to use Perl to check if HTML links on a page are active?
> I would like to add this capability to our website so users will not get
> a standard error message when a link is no longer valid and I can redirect
> them elsewhere.
Get LWP from CPAN (<URL:http://www.perl.com/CPAN/>) and use HEAD (with a
fallback to GET).
Elijah
------
or look for 'checkbot' on search engines
------------------------------
Date: Tue, 06 Jan 1998 14:50:20 -0500
From: Deflores <deflores@bigfoot.com>
Subject: Win32--Add to program to system tray or Hide while running/minimized
Message-Id: <34B28AFC.604D@bigfoot.com>
How can I hide a running perl program from the Windows NT taskbar or
alternatively minimize it into the system tray?
Thanks in advance,
deflores
------------------------------
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 1590
**************************************