[12512] in Perl-Users-Digest
Perl-Users Digest, Issue: 6112 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 23 21:07:12 1999
Date: Wed, 23 Jun 99 18:00:22 -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 Wed, 23 Jun 1999 Volume: 8 Number: 6112
Today's topics:
Re: A month behind using localtime(time) ? <dhenders@cpsgroup.com>
Re: About perl books <jason.holland@dial.pipex.com>
Re: About perl books <jbc@shell2.la.best.com>
Re: accessing a character in a string <fake@nospam.edu>
Re: accessing a character in a string <cassell@mail.cor.epa.gov>
adding whitespaces <arm@home.net>
Re: Capturing a Stop event from the Browser <rootbeer@redcat.com>
Chat2.pl...HELP <jbaird@idirect.com>
Continuing fun with Hash or Lists... (Mitch)
Re: DBI/DBD mSQL: mSQL.so (Alastair)
Re: Diff tools? <tchrist@mox.perl.com>
Re: Diff tools? <cassell@mail.cor.epa.gov>
Re: dynaloader <rootbeer@redcat.com>
global vars <fake@nospam.edu>
Re: global vars <cassell@mail.cor.epa.gov>
Help with PPM <duraip@extendsys.com>
Re: Modem control in perl? ()
Re: multidimensional arrays with functions push and pop <d-edwards@uchicago.edu>
Need Random Generator HELP!! <jrhamilt@golay.csl.uiuc.edu>
Re: Need Random Generator HELP!! <rootbeer@redcat.com>
Re: newbie: Grab URL into PERL? <kazuma@my-deja.com>
Re: Perl in Win32 roberthp@my-deja.com
Perl mailing lists? <mharris@ican.net>
Re: Perl mailing lists? <cassell@mail.cor.epa.gov>
Referencing question, was: "Re: use strict question" <fishers@lister.acm.wwu.edu>
Re: simple <tgregory@semaphore.com>
suid problem with perl <orionmt@cam.org>
Re: Upload multiple files by broswer (Alastair)
Re: use strict question (more on symbolic references) (Tramm Hudson)
What in my concatenated string? <aef@pangea.ca>
Writing to a terminal from a perl script <fishers@lister.acm.wwu.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Jun 1999 15:45:36 -0500
From: Dale Henderson <dhenders@cpsgroup.com>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <87n1xq3atr.fsf@camel.cpsgroup.com>
>>>>> "Mark" == Mark Conlin <Mark.Conlin@bridge.bellsouth.com> writes:
>> Sigh - why not read the docs to see why this is so? It uses
>> the underlying C library which does the same thing - also
>> documented.
Mark> Becuase I do not have a good book with me right now and in
Mark> addition my connection is so slow that it is almost
Mark> impossible to search through faqs online.
Well how did you know anything at all about the localtime
function? Did you randomly type in localtime and pray? Or did
you steal it from someone elses code?
When i first used localtime, I noticed this rather odd behavior
but I had Prgramming Perl 1st ed in my lap (That's how I found
out there WAS a localtime). And read what it had to say.
I really am curious how you discovered what the return values of
localtime (ie mon, day, year, etc. ) are without ANY
documentation.
If you have a book that just told you the order of the return
values but not which ones are zero-based and especially about the
return value for year being off by 1900 then BURN IT. For it
truly is a BAD book.
------------------------------
Date: Wed, 23 Jun 1999 22:05:27 +0000
From: Jason Holland <jason.holland@dial.pipex.com>
Subject: Re: About perl books
Message-Id: <37715A27.E03CCA9E@dial.pipex.com>
I think I'm addicted to O'Reilly books...
I certainly find them useful, both as a reference, the Cookbook for
instance, and as intersting bedtime reading, such as Advanced Perl.
Bye!
--
Jason Holland - < "I could probably write a script for that..." >
email: jason.holland@dial.pipex.com
web: http://dspace.dial.pipex.com/jason.holland/
can do: Perl 5, html, JavaScript, Linux, Mac, Photoshop, everything
else...
------------------------------
Date: 23 Jun 1999 21:01:12 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: About perl books
Message-Id: <37714b18$0$226@nntp1.ba.best.com>
brian d foy <brian@pm.org> wrote:
> In article <7kq09m$7tc$1@usenet01.srv.cis.pitt.edu>, fmgst+@pitt.edu (Filip M. Gieszczykiewicz) posted:
>> Does purchase of the O'Reilly series of books on perl (ie. camel books)
>> help in the development of perl?
> certainly. almost any O'Reilly technical book is helpful.
I suspect you may have missed his point. As I read it, he's wondering
if buying the books from O'Reilly advances the larger cause of free
software development, at least as it plays out in the ongoing
development of Perl.
Or something like that.
As I interpret your response, you're telling him that buying the ORA
books will help *him* in developing his own software with Perl.
Or maybe not. Whatever.
Buying books with Larry's (or TomC's, or Randal's, or Nathan's, or any
of the other people active in furthering the language's) name on the
title page helps those people financially, thus allowing them to spend
more of their time on language development than they otherwise would.
(This assumes that these folks will take the free time they get by
virtue of their book royalties and use at least some of it to work on
improvements to Perl. This seems like a fairly safe bet to me.) Also,
Larry (at least) is employed by O'Reilly at this time, with a job
description (as I understand it) of making Perl more useful for more
people. So supporting O'Reilly in general, such that they can go on
supporting Larry, would seem to be a positive thing.
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: Wed, 23 Jun 1999 15:15:08 -0700
From: "Ariel" <fake@nospam.edu>
Subject: Re: accessing a character in a string
Message-Id: <7krm8j$7fi@news.or.intel.com>
Tom Christiansen wrote in message <>...
>In comp.lang.perl.misc, "Ariel" <fake@nospam.edu> writes:
>:hi. you know how in C you can say
>:
>:char mystring[ ] = "hello";
>:char myletter = mystring[1]; #myletter is the character 'e'
>:
>:is there a way to do a similar thing in Perl? how do you access certain
>:characters in strings?
>
>Yes. And when you stop screwing up your address, I'll
>tell you how.
>
I have a fake email address to keep from getting spammed (just yesterday I
had to close one of my email accounts due to the incredible amount of spam I
was getting.) Apologies to anyone who had problems trying to send me email.
anita
arielle7@uclink4.berkeley.edu
>--tom
>--
> "You can't have filenames longer than 14 chars.
> You can't even think about them!"
> --Larry Wall in Configure from the perl distribution
------------------------------
Date: Wed, 23 Jun 1999 17:08:42 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: accessing a character in a string
Message-Id: <3771770A.41320E78@mail.cor.epa.gov>
Ariel wrote:
> [snip]
> I have a fake email address to keep from getting spammed (just yesterday I
> had to close one of my email accounts due to the incredible amount of spam I
> was getting.) Apologies to anyone who had problems trying to send me email.
Tom's point of view is that one should stand fast and fight
spam instead of hiding from it. But then you may be posting
in places where spammers lurk.
[Insert your own joke about why spammers don't bother with
alpha-geek newsgroups.]
Besides, it's more fun to sleuth out the spammers and report
them to their ISP's so they can be evicted and humiliated.
And you just missed the Spam Cookoff at the Manly Man Festival
in Roslyn WA. Perhaps someday they'll grill Stanford Wallace.
:-)
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 00:34:43 GMT
From: Matt Melton <arm@home.net>
Subject: adding whitespaces
Message-Id: <37717CCA.B54E1565@home.net>
The books on Perl and I have 5 of them refer to deleting
whitespaces from the beginning of a line s/^ *//; or from
the end of the line but if I have a line that reads,
how are you today, after it goes through a perl search
routine, that line comes back howareyoutoday. With the
exception of adding dashes ~s/\s+\-/g; how can I add a whitespace
to get the output to read how are you today.
Matt
------------------------------
Date: Wed, 23 Jun 1999 17:40:14 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Capturing a Stop event from the Browser
Message-Id: <Pine.GSO.4.02A.9906231739230.1698-100000@user2.teleport.com>
On Wed, 23 Jun 1999 mattm@sunbelt.nawcad.navy.mil wrote:
> Is there any way for my cgi (Perl) script to capture when the user
> clicks the stop button?
If there is a way, it's the same way that a non-Perl CGI script would do
it. Do you know where to find the docs, FAQs, and newsgroups about CGI
programming? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jun 1999 21:02:39 -0400
From: John Baird <jbaird@idirect.com>
Subject: Chat2.pl...HELP
Message-Id: <377183AF.78D23675@idirect.com>
Hello,
First of I am not a programmer... so to some these questions may seem
trivial....anyway here we go...
background:
writing a script which will automate a telnet login session on
various network devices (ie switches and routers) and execute command
line parameters...
problem:
I am trying to take advantage of the 'chat2.pl' script so that I
don't have to do any socket stuff... as it is already taken care of in
that package... anyway all textbook examples show similar to the
following:
#!/usr/bin/perl -w
require 'chat2.pl';
$handle = chat::open_port("router.domain.ca", 23);
chat::expect($handle, 8, '(.+)', 'print "$1\n" ');
That code will produce an error saying that it can not find certain *.ph
(perl header files) that the chat2.pl are referencing... the version of
PERL that I am using is 5.02 /5.04 and both versions produce that
error... one version is on an AIX box (v.4.3) and the other version is
on a LINUX box kernal 2.0.34( yah i know it is an old kernal)....what do
I need to do to take advantage of the chat2.pl script....
thanks in advance,
John Baird
P.s. Please email any responses to jbaird@idirect.com and DO NOT post
on the newsgroup as I am unable to access the newgroups at work....
------------------------------
Date: Wed, 23 Jun 1999 23:10:46 GMT
From: portboy@home.com (Mitch)
Subject: Continuing fun with Hash or Lists...
Message-Id: <3770f941.422780566@24.0.3.71>
If I have a hash of lists that contains something like:
coke sucks rules bites, where coke is the hash, and the rest is the
list. How can I remove "rules" from the list?
.mitch
------------------------------
Date: Wed, 23 Jun 1999 21:51:42 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: DBI/DBD mSQL: mSQL.so
Message-Id: <slrn7n2pc0.5i.alastair@calliope.demon.co.uk>
bobnospam@khusro.math.umn.edu <bobnospam@khusro.math.umn.edu> wrote:
>
>If the subject heading got your interest, then you probably know how
>to solve my little problem.
>
>Towit, some output:
>
>>csctest.pl
>perl: can't resolve symbol 'msqlErrMsg'
>install_driver(mSQL) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/
>i686-linux/auto/DBD/mSQL/mSQL.so' for module DBD::mSQL:
>Unable to resolve symbol at /usr/local/lib/perl5/5.00503/i686-linux/
>DynaLoader.pm line 169.
I'm no expert, but use a similar set of modules. I'd start by checking whether
perl accepts this ;
use DBI;
If not, I'd re-install Msql-Mysql-modules-1.A (where A = the latest) from
source - I believe it includes the DBI modules (from memory). Get it on CPAN
(http://www.cpan.org).
>my $libref = dl_load_file($file, $module->dl_load_flags) or
>croak("Can't load '$file' for module $module: ".dl_error()."\n");
If this is an error in dynamic loading, make sure your Perl build supports
dynamic loading. Check by typing 'perl -V' and look for lines line (in Linux) ;
Dynamic Linking
-shared
>
>I compiled and installed
>
>DBI-1.08
>Data-ShowTable-3.3
>Msql-Mysql-modules-1.2200
I have similar.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 23 Jun 1999 15:08:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Diff tools?
Message-Id: <37714cbc@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, lemull@unx.sas.com writes:
:Does anyone know of a utility that can be used in Perl to compare two
:files and identify differences between the two (a "diff" tool) ? The
:one other requirement is that it will run in either a UNIX or NT
:environment.
Once upon a time, we used to say...
Don't you hate being cursed to exist in a tool deficient environment?
Don't you hate being forced to get blood from a stone?
Don't you hate paying for nothing?
Welcome to Microsoft Hell!
If you want Unix, you know where to find it. Otherwise, pay your
ante to Lord Bill. Surely a few thousand bucks per seat will
get your something you can't use. That's what you've done
before, isn't it?
Now, we say...
Get your
+--------------------------------------+
| +----------------------------------+ |
| | +------------------------------+ | |
| | | +--------------------------+ | | |
| | | | +----------------------+ | | | |
| | | | | | | | | |
| | | | | PERL POWER TOOLS | | | | |
| | | | | | | | | |
| | | | +----------------------+ | | | |
| | | +--------------------------+ | | |
| | +------------------------------+ | |
| +----------------------------------+ |
+--------------------------------------+
at http://language.perl.com/ppt/
Have the appropriate amount of fun.
--tom
--
I get so tired of utilities with arbitrary, undocumented,
compiled-in limits. Don't you?
------------------------------
Date: Wed, 23 Jun 1999 14:14:44 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: lemull@unx.sas.com
Subject: Re: Diff tools?
Message-Id: <37714E44.2EA1ACF2@mail.cor.epa.gov>
[courtesy cc sent to poster]
Lee Mulleady wrote:
>
> Does anyone know of a utility that can be used in Perl to compare two
> files and identify differences between the two (a "diff" tool) ? The
> one other requirement is that it will run in either a UNIX or NT
> environment.
You'll probably want to check out Algorithm::Diff as well as
Mark-Jason Dominus' diff program (written in Perl) which is
available as part of the Perl Power Tools:
http://language.perl.com/ppt/
BTW: you work for SAS? Neat.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 23 Jun 1999 17:46:33 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: dynaloader
Message-Id: <Pine.GSO.4.02A.9906231743290.1698-100000@user2.teleport.com>
On Wed, 23 Jun 1999 francesc_guasch@my-deja.com wrote that a problem
happened when building a module after:
> make test
Hmmmm... Well, I'm guessing (merely guessing...) that perhaps your perl
binary isn't properly installed. If you compiled it yourself and 'make
test' passed all tests before 'make install', then I'm wrong. But some
Linux distributions contain a broken perl - even though most things work
fine.
Even if everything did work, perhaps you should try reinstalling perl
before rebuilding your module. Unless, of course, someone has a better
suggestion.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jun 1999 15:09:12 -0700
From: "Ariel" <fake@nospam.edu>
Subject: global vars
Message-Id: <7krlso$73q@news.or.intel.com>
let's say i have a variable $a in FILE1.pl. what if i want to access and
change that variable in another file, FILE2.pl. Also, in FILE2 i want to use
subroutines defined in FILE1. how do i do this. do I just say "require
FILE1.pl" in the beginning of FILE2?
thanks.
------------------------------
Date: Wed, 23 Jun 1999 17:02:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: global vars
Message-Id: <377175A3.FE467A23@mail.cor.epa.gov>
Ariel wrote:
>
> let's say i have a variable $a in FILE1.pl. what if i want to access and
> change that variable in another file, FILE2.pl. Also, in FILE2 i want to use
> subroutines defined in FILE1. how do i do this. do I just say "require
> FILE1.pl" in the beginning of FILE2?
It sounds to me like you want to read up on the do() function.
This:
do 'FILE1.pl';
will execute the contents of the file as a Perl program. It
does other nice things which are covered in perlfunc.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Jun 1999 00:34:47 GMT
From: "pjd" <duraip@extendsys.com>
Subject: Help with PPM
Message-Id: <7kruf7$7av$0@198.102.102.248>
Whats the matter with this PPM ?
I just cant seem to get this right.
I have the latest version of perl from ActiveState installed.
Here is a sample session.
My config:
win98
Cygwin20
perl build 517
$ ppm.bat
PPM interactive shell (1.0.0) - type 'help' for available commands.
PPM> help
Commands:
genconfig - prints a valid PPM.XML file to STDOUT.
help [command] - prints this screen, or help on 'command'.
info PACKAGES - prints a summary of installed packages.
install PACKAGES - installs specified PACKAGES.
quit - leave the program.
query [options] - query information about installed packages.
remove PACKAGES - removes the specified PACKAGES from the system.
search [options] - search information about available packages.
summary [options] - prints a summary of a package or repository
set [options] - set/display current options.
verify [options] - verifies current install is up to date.
PPM> search libnet
Packages available from http://www.ActiveState.com/packages:
libnet
PPM> install libnet
Install package 'libnet?' (y/N): y
no element found at line 1, column 0, byte -1 at
C:/Perl/site/lib/XML/Parser.pm
line 153
$
Any help will be appreciated.
pj
------------------------------
Date: 23 Jun 1999 20:59:41 GMT
From: rdawes@mariska.rogan.org ()
Subject: Re: Modem control in perl?
Message-Id: <slrn7n2imh.g8.rdawes@mariska.rogan.org>
On 21 Jun 1999 20:44:31 -0700, Greg Andrews <gerg@shell.ncal.verio.com> wrote:
>rdawes@intekom.co.za writes:
>>Hi folks,
>>
>>I am trying to control a modem from a perl script. I have successfully
>>managed to talk to the modem, issue commands, receive input, etc. I am
>>pretty happy with it so far.
>>
>>However, I have one nagging problem that I do not know how to solve:
>>
>>How do I raise or lower DTR(?) to make the modem hang up?
>>
>>I have tried to use the '+ + + AT' (without the spaces) and it works on
>>one modem, but not on the next. I believe that dropping DTR (or one of
>>the lines) is the correct way to force a modem to drop the connection.
>>I think it should also be more reliable. Is this something I should be
>>trying to use an IOCTL for?
>>
>
>One of the traditional methods was to issue an ioctl call to
>set the port's speed to 0 bps, wait a second or two, and then
>set the speed back to the normal value.
>
>I don't know whether the Linux tty driver will drop DTR when
>the speed is set to 0. It may want you to make a different
>ioctl call.
>
>The other traditional method is to close the port. :-)
>
> -Greg
Great. I'll try that.
Thanks a lot
Rogan
--
Rogan Dawes rdawes@intekom.co.za
Given infinite time, 100 monkeys could type out the complete works of
Shakespeare.
Win 98 source code? Eight monkeys, five minutes. Tops.
------------------------------
Date: Wed, 23 Jun 1999 21:01:25 GMT
From: Darrin Edwards <d-edwards@uchicago.edu>
Subject: Re: multidimensional arrays with functions push and pop
Message-Id: <tgbte63a3e.fsf@noise.bsd.uchicago.edu>
David Cassell <cassell@mail.cor.epa.gov> writes:
>
> Darrin Edwards wrote:
> > How's that saying go, "Learn what you know, share
> > what you don't"? Sheesh.
>
> I thought it was:
> "Learn what you don't know to be wrong.
> Share what you didn't check to be true."
Ouch. Well, the one good thing about having put my foot in
my mouth is I can't make (coherent) wrong statements while
it's there.
Darrin
------------------------------
Date: Tue, 22 Jun 1999 21:00:45 -0500
From: "Joe Hamilton" <jrhamilt@golay.csl.uiuc.edu>
Subject: Need Random Generator HELP!!
Message-Id: <7kpfag$d1a$1@vixen.cso.uiuc.edu>
Actually, I don't need any help with TrulyRandom, rand or any of that. But
I hope
that this got the right people to look at this message.
In PERLFAQ4 there is a purported quote of John van Neumann:
"Anyone who attempts to generate random numbers by determinisic means is, of
course, living in a state of sin."
I urgently need to find a reference for that quote. Can someone help me
here?
Please respond via email since I don't have as much chance to read news
right at the moment.
thanks a bunch...
Joe H.
------------------------------
Date: Wed, 23 Jun 1999 17:51:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Need Random Generator HELP!!
Message-Id: <Pine.GSO.4.02A.9906231750570.1698-100000@user2.teleport.com>
On Tue, 22 Jun 1999, Joe Hamilton wrote:
> I urgently need to find a reference for that quote. Can someone help
> me here?
Yes, your local reference librarian should be able to help you. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 23 Jun 1999 22:10:52 GMT
From: Kazuma <kazuma@my-deja.com>
Subject: Re: newbie: Grab URL into PERL?
Message-Id: <7krm13$k1m$1@nnrp1.deja.com>
> My problem is:
> I want to grab the calling URL and parse it inside of PERL.
> [...]
> YOU ARE HERE >> BOOKS >> BN >> PERL
> [...]
> But the main part that has me stuck is getting the
> full URL into the PERL script.
This could be one possible solution...
my $url = "http://www.myurl.it/dir/page.html";
my ($protocol, $site, @infos) = split(/\/+/, $url);
# $protocol will contain "http:"
# $site will contain "www.myurl.it" (yes, I'm italian... ;-))
# @infos is a list that contain all the directories.
# The last element (in theory) should contain the "page".
print "YOU ARE >>", uc($protocol), " >> ", uc($site), " ";
print " >> ", join(" >> ", @infos) if (@infos);
The last "if" is important because you can have a url
like "http://www.myurl.it"...
> Thank you for your assistance.
> R. Moose
Best Regards,
Kazuma
--
Cos'e' il genio: fantasia, intuizione,
colpo d'occhio e velocita' d'esecuzione...
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 23 Jun 1999 22:58:00 GMT
From: roberthp@my-deja.com
Subject: Re: Perl in Win32
Message-Id: <7kropj$l0j$1@nnrp1.deja.com>
What you're seeing is the "console". "A console is a chunk of memory
that Win32 reserves (called a console buffer) that is bound to a window
that displays the contents of the buffer.... An application binds a
console buffer to the console that you see as the output text window of
the program." From Ch. 9, pg 307, Windows NT Win32 Perl Programming,
The Standard Extensions (Dave Roth, Macmillan Technical Publishing).
You can create a "process" and pass it the
parameter "DETACHED_PROCESS", which will create the process without the
window. (Ch. 8, pg 290-291, same book as above).
Robert
In article <3771442A.CA2BDA20@spiretech.com>,
Isaac <gorgonous@spiretech.com> wrote:
> Spud wrote:
> > For some reason when I try to execute my perl programs in Windows a
black
> > DOS-like screen comes up for a second and then dissappears. I'm
running
> > ActivePerl 517. Help, please!
>
> Win32 Perl is run from DOS. When you run your script, it brings up a
DOS shell
> and executes the script. When it's done, it closes the window.
>
> My suggestion is that you run scripts from a DOS window instead of
through run
> or whatever it is that you're using. That way it won't just close
immidiately.
>
> --
> "Not everything that can be counted counts,
> and not everything that counts can be counted."
> - Albert Einstein
>
> http://www.spiretech.com/~gorgonous/aboutme/
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 23 Jun 1999 19:09:32 -0400
From: "Mike A. Harris" <mharris@ican.net>
Subject: Perl mailing lists?
Message-Id: <3771692C.E06A8CC0@ican.net>
Hi, I am wondering if any of the perl newsgroups are dual gated to
any mailing lists, or if there are alternative mailing lists with
a similar purpose. I've been unable to find any.
If there are such lists, please point me to them, and give me
subscription info, or URL's, etc..
Thanks.
TTYL
------------------------------
Date: Wed, 23 Jun 1999 17:13:37 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: "Mike A. Harris" <mharris@ican.net>
Subject: Re: Perl mailing lists?
Message-Id: <37717831.F427D4A7@mail.cor.epa.gov>
[courtesy cc sent to poster]
Mike A. Harris wrote:
>
> Hi, I am wondering if any of the perl newsgroups are dual gated to
> any mailing lists, or if there are alternative mailing lists with
> a similar purpose. I've been unable to find any.
I don't know of any dual gates, but there are plenty of Perl
listservs, some of which should be left alone except by Perl
developers.
> If there are such lists, please point me to them, and give me
> subscription info, or URL's, etc..
Umm, didn't you look in the FAQ first? It's right there.
In fact, you could have found it using perldoc as well.
Just type:
perldoc -q mailing
and you'll get a URL to a list of lists, so to speak.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 23 Jun 1999 17:14:31 -0700
From: Shane Fisher <fishers@lister.acm.wwu.edu>
To: "H. Camphausen" <h.camp@creagen.de>
Subject: Referencing question, was: "Re: use strict question"
Message-Id: <Pine.BSF.4.05.9906231652360.13773-100000@lister.acm.wwu.edu>
On 23 Jun 1999, H. Camphausen wrote:
> In article <377129F1.6D36D6E5@innercite.com>, mike@innercite.com says...
> 2. If you need to use the name of your function,
> use a hash before (plus a hard reference):
>
> sub my_function {...};
> %func_refs = ('my_function' => \&my_function);
> . # here you can use anything as
> . # your 'symbolic' function-name
> . # _but_ note the backslash again
> .
> .
> $my_func = 'my_function';
> . # $my_func is a scalar _and_ contains
> . # no reference at all..
> .
> .
> # here we go again, strict won't complain, 'symbolism' is working fine:
> $result = &{$func_refs{$my_func}};
I'm doing something similar in my email script, where I have a global hash
that maps subject strings to their appropriate filter modules
(subroutines):
$filter_hash{"default"} = \&Default_Filter::def_Filter;
# a global hash which maps subject strings to function references
# (filters)
When calling the function using the hard reference in
this fashion (similar to what you have, only with an argument):
&$filter_hash{"default"}(@message);
I get the following error:
Can't use subscript on subroutine entry at ./Master_Filter line 90, near
"'default'}"
(Did you mean $ or @ instead of &?)
I got around it by using the following hack:
$code = $filter_hash{"default"};
# code gets a reference to the default filter
&$code(@message);
# de-reference the function and apply it to the msg
Is there a better way to do this? Also, for debugging purposes, I output
the contents of the the hash, which is presumably a pointer to a function:
print "I will use this function: $filter_hash{'default'}\n";
output: "I will use this function: CODE(0x154df4)"
Is there a way to have it output the name of the function instead of the
address of it? In other words, can I get back the function name from the
address?
Thanks for any insight.
Regards,
Shane
=========================================================================
Shane M. Fisher
CS Major, Western Washington University
E-Mail: fishers@acm.wwu.edu, smfisher@gte.net
Web: http://www.acm.wwu.edu/fishers
=========================================================================
------------------------------
Date: Wed, 23 Jun 1999 15:14:15 -0700
From: "Timothy A. Gregory" <tgregory@semaphore.com>
Subject: Re: simple
Message-Id: <37715c3b.0@news.semaphore.net>
You could try
`ls a*>file1`
Raj <technology@workmail.com> wrote in message
news:37710D83.D361AFA4@workmail.com...
> when i use
> system("ls a* > file1");
> in my CGI script it's listing the entire paths into the txtfile 'file1'
>
> whereas when i run the same ls command at the unix prompt, i get only
> the filename listing into 'file1' , which is what i want.
>
> What do i need to do in my system command then?
>
------------------------------
Date: Wed, 23 Jun 1999 19:54:55 -0400
From: Mike <orionmt@cam.org>
Subject: suid problem with perl
Message-Id: <377173CF.692975FF@cam.org>
I am trying to make a simple SUID script and I get some irrationnal
results. For example if I try running the following program:
opendir (CURRENT, "$cur");
while ($file = (readdir CURRENT))
{
print "$file\n" if (-d $file);
}
If $cur value is ".", the script gives me the following results:
.
..
.netscape
frame
download
(which are all directories) This is the expected result.
If $cur value is "download" for example (and that download has two
subdirectories : netscape and explorer), I get the following output:
.
..
instead of :
.
..
netscape
explorer
Why can I not see the other folders? It looks as though the "-d" option
only recognizes folders when it is used in the current directory. It
sees the folders of subdirectories just as files or I don't know what.
If someone knows why this is not working please tell me. By the way I
cannot use "chdir" because of the "tainted" property of perl and the
fact that I am doing a SUID script.
Thank you very much
Francois
------------------------------
Date: Wed, 23 Jun 1999 21:55:48 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Upload multiple files by broswer
Message-Id: <slrn7n2pjn.5i.alastair@calliope.demon.co.uk>
Tanya <tanya@i-cable.com> wrote:
>is there any possible ways to upload multiple files by a broswer instead
>of upload files one by one
Perhaps. You could try using multiple 'file upload' tags in your form - I
haven't tried this ... and this really belongs in another newsgroup e.g.
comp.infosystems.www.authoring.cgi
comp.infosystems.www.authoring.html
etc.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 23 Jun 1999 14:19:28 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: use strict question (more on symbolic references)
Message-Id: <7krfgg$h99@llama.swcp.com>
[posted and cc'd to cited author, clp.modules removed]
Mike Machado <mike@innercite.com> wrote:
> I am trying to use a scalar as a subroutine name while I have use strict
> on and I keep getting the error:
>
> Can't use string ("mysub") as a subroutine ref while "strict refs" in
> use at testing.pl line 5
Well, you -can- use the string as a subroutine reference with strict
turned on. I've brought this up several times with no responses from the
elite Perl gurus. Perhaps this falls under mjd's "How to tell if
a file is a hard link?" style of question.
So the standard answers (which have already been given) are to
either turn of strict refs for the call of the symbolic function
reference or to use a hard ref. Both of which are the correct
answers. However, you may also do:
&{\&{$func_name}}('args');
even if strict is turned on.
My comments on the issue:
http://www.deja.com/=dnc/getdoc.xp?AN=432546967&fmt=text
http://www.deja.com/=dnc/getdoc.xp?AN=439096145&fmt=text
mjd's discussion on questions (worth reading):
http://www.plover.com/~mjd/perl/Questions.html
The upshot of my complaint is this:
#!/usr/bin/perl -w
use strict;
sub foo { print "foo is called\n" }
my $ref1 = &{"foo"}; # Error: String as subroutine ref
my $ref2 = \&{"foo"}; # No error
my $ref3 = &{"no_such_func"}; # Error:
my $ref4 = \&{"no_such_func"}; # No error
print "ref4 = $ref4\n"; # A CODE reference? What?
__END__
Tramm
--
o hudson@swcp.com tbhudso@cs.sandia.gov O___|
/|\ http://www.swcp.com/~hudson/ H 505.266.59.96 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: Wed, 23 Jun 1999 17:04:33 -0500
From: "AEF" <aef@pangea.ca>
Subject: What in my concatenated string?
Message-Id: <7krln6$p52$1@pumpkin.pangea.ca>
I made an a mess of a string, concatenating then using as a value for a
hash.
$string = '';
$string .= ",$item";
#etc.
$hash{$key} = $string;
# actually it was a value for %Cookies
# I ended up with an interesting
# looking value
@topics = split (/,/,$Cookies{'topics'} );
print @topics;
#because of the mistake gave me
#,,,30,31,32 #for example
#So I thought I would play with it and remove the ","
for(@topics) {
print "topic: $_ \n";
}
#prints
topic:
topic:
topic:
topic: 30
topic: 31
topic: 32
#Fixing that isn't a problem.
#But, for my own information, I couldn't figure out what the value was
#of the empty places. It didn't seem to be "" or " ", and couldn't be
#substituted in a regex.
if ($_ =~ /\w/) {
print "$_";
}
#works fine but still doesn't help me to understand. What happened there?
Thanks.
------------------------------
Date: Wed, 23 Jun 1999 14:59:40 -0700
From: Shane Fisher <fishers@lister.acm.wwu.edu>
Subject: Writing to a terminal from a perl script
Message-Id: <Pine.BSF.4.05.9906231451060.13773-100000@lister.acm.wwu.edu>
Greets,
I am trying to figure out how to write to my terminal from a perl script
invoked by another process. For example, a biff-like "new mail" notice
when procmail pipes a message to a perl script. I understand that
whenever procmail executes a script, it invokes it with the same
environment as the intended recipient. So, I'm wondering if there is an
environment variable that the perl script can use to "find" the terminal
to write to.
Is this more of a "sockets" question, or interprocess communication? I've
read through the docs on termio and termcap, but I don't think those are
what I need to accomplish this.
Any help would be greatly appreciated.
Regards,
Shane
=========================================================================
Shane M. Fisher
CS Major, Western Washington University
E-Mail: fishers@acm.wwu.edu, smfisher@gte.net
Web: http://www.acm.wwu.edu/fishers
=========================================================================
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6112
**************************************