[13069] in Perl-Users-Digest
Perl-Users Digest, Issue: 479 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 12 11:07:12 1999
Date: Thu, 12 Aug 1999 08:05:14 -0700 (PDT)
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, 12 Aug 1999 Volume: 9 Number: 479
Today's topics:
Re: 'use strict' - what will I lose if I forgo the prag <ltl@rgsun5.viasystems.com>
Active state perl and IIS3 mixed asp/perl environment (Maurice Walshe)
Re: Active state perl and IIS3 mixed asp/perl environme <jerrad@networkengines.com>
Re: Active state perl and IIS3 mixed asp/perl environme (Maurice Walshe)
Re: Active state perl and IIS3 mixed asp/perl environme <jpeterson@office.colt.net>
Re: alphabetical listing <jerrad@networkengines.com>
Re: Announcement: "CRAP" (Greg Bacon)
Re: CGI timeout problem <shalabh@pspl.co.in>
Re: CGI timeout problem <diggem@cat.com>
Re: Comma seperated numbers (Bill Moseley)
Re: Copy a hash of hashes of hashes (Andrew Johnson)
Re: Copy a hash of hashes of hashes (Steve Linberg)
Corrupted STDOUT <green@argonet.co.uk>
Re: Dereferencing anon hash (Donovan Rebbechi)
Re: Dereferencing anon hash (Greg Bacon)
Re: Dereferencing anon hash (Abigail)
Re: dot is too precious to be only for string concatena (Abigail)
Re: Help with system() (Steve Linberg)
Re: info on CGI client (Steve Linberg)
IO-Tty-0.02 and Tty.pm problems (expect.pm) <jlong@sgi.com>
Re: is our reese the author of mysql book? <elaine@chaos.wustl.edu>
Re: is our reese the author of mysql book? (Abigail)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Aug 1999 13:45:36 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: 'use strict' - what will I lose if I forgo the pragma?
Message-Id: <7ouj60$h6u$1@rguxd.viasystems.com>
Larry Rosler <lr@hpl.hp.com> wrote:
:>In article <7otbgs$873$1@rguxd.viasystems.com> on 12 Aug 1999 02:28:44
:>GMT, lt lindley <ltl@rgsun40.viasystems.com> says...
:><SNIP of insightful post, until the last sentence>
:>...
:>> Also, "perldoc script" for how to adjust the restrictions to
:>> suit your needs.
:>I think your brain slipped here. You meant to say `perldoc strict`.
Yep. Since I had just typed 'perldoc strict' in another window to
verify that it brought up the documentation I wanted, I should have
done copy and paste.
Keep after me Larry. I'm almost clpm trained. :-)
--
// Lee.Lindley /// Programmer shortage? What programmer shortage?
// @bigfoot.com /// Only *cheap* programmers are in short supply.
//////////////////// 50 cent beers are in short supply too.
------------------------------
Date: Thu, 12 Aug 99 14:06:55 GMT
From: maurice.walshe@bt.com (Maurice Walshe)
Subject: Active state perl and IIS3 mixed asp/perl environment
Message-Id: <7oukm4$8og$1@pheidippides.axion.bt.co.uk>
Hi
I "Look" after an NT IIs 3 server that uses a mixture of asp and perl (active
state build 316) and VB screen scralping programs.
I am trying to improve performance as the server is slow - due to NDA
I can't say what the server is but its one that takes a lot of hits 4M/Month.
the asp part sets up a transaction but when the perl cgi program is
called there seems to be an immense delay in the perl program running.
Obviously this causes asp re quest to stackup in the queue causing problems.
Has any one any suggestions as to why the asp -> Perl interface seems to be
a bottle neck?
Oh and I have tried the obvious i.e. ASP memory leaks and tuning the webserver.
I cant just go to IIs4 or later SP (my mSoft had to bundle the webserver upgrade
with the OS I Dont' know) I would even be worried about a new version of perl as
the system has almost NO documentation and is some what heath robinson
and prone to falling over.
OBTW down time is not an option
would PerlEx help?
Rgds Maurice
ps we didn't write the system
------------------------------------------------------------------------------
|Maurice Walshe You'll Never Get to heaven with an Ak47, |
|Software Engineer But A Zu 30's excelent for low flying Cherubim |
|Digita Media Services |
|maurice.walshe@bt.com <http://www.dms.bt.com> |
| Not an official Statement of BT's or DMS's Views unless explicity stated |
|-----------------------------------------------------------------------------
------------------------------
Date: Thu, 12 Aug 1999 10:18:49 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: Active state perl and IIS3 mixed asp/perl environment
Message-Id: <37B2D7C9.386657FD@networkengines.com>
You should upgrade to ActiveState 515 at the very least. Previous versions had many security holes.
Do you need sessions? If not disable them in IIS.
without more info, not much else can be said.
Maurice Walshe wrote:
>
> Hi
>
> I "Look" after an NT IIs 3 server that uses a mixture of asp and perl (active
> state build 316) and VB screen scralping programs.
>
> I am trying to improve performance as the server is slow - due to NDA
> I can't say what the server is but its one that takes a lot of hits 4M/Month.
>
> the asp part sets up a transaction but when the perl cgi program is
> called there seems to be an immense delay in the perl program running.
> Obviously this causes asp re quest to stackup in the queue causing problems.
>
> Has any one any suggestions as to why the asp -> Perl interface seems to be
> a bottle neck?
>
> Oh and I have tried the obvious i.e. ASP memory leaks and tuning the webserver.
>
> I cant just go to IIs4 or later SP (my mSoft had to bundle the webserver upgrade
> with the OS I Dont' know) I would even be worried about a new version of perl as
> the system has almost NO documentation and is some what heath robinson
> and prone to falling over.
>
> OBTW down time is not an option
>
> would PerlEx help?
>
> Rgds Maurice
>
> ps we didn't write the system
>
> ------------------------------------------------------------------------------
> |Maurice Walshe You'll Never Get to heaven with an Ak47, |
> |Software Engineer But A Zu 30's excelent for low flying Cherubim |
> |Digita Media Services |
> |maurice.walshe@bt.com <http://www.dms.bt.com> |
> | Not an official Statement of BT's or DMS's Views unless explicity stated |
> |-----------------------------------------------------------------------------
------------------------------
Date: Thu, 12 Aug 99 14:33:34 GMT
From: maurice.walshe@bt.com (Maurice Walshe)
Subject: Re: Active state perl and IIS3 mixed asp/perl environment
Message-Id: <7oum83$8pf$1@pheidippides.axion.bt.co.uk>
In article <37B2D7C9.386657FD@networkengines.com>, jerrad pierce <jerrad@networkengines.com> wrote:
>You should upgrade to ActiveState 515 at the very least. Previous versions had
> many security holes.
>Do you need sessions? If not disable them in IIS.
>without more info, not much else can be said.
If you meen the use of state within IIS/ASP this
is needed to keep track of the users info. Or are
sessions an IIs4 thing?
I am not fix'ing security at the moment theres
a whole load of NT hotfixes i need to do as well.
Rgds M
------------------------------------------------------------------------------
|Maurice Walshe You'll Never Get to heaven with an Ak47, |
|Software Engineer But A Zu 30's excelent for low flying Cherubim |
|Digita Media Services |
|maurice.walshe@bt.com <http://www.dms.bt.com> |
| Not an official Statement of BT's or DMS's Views unless explicity stated |
|-----------------------------------------------------------------------------
------------------------------
Date: Thu, 12 Aug 1999 14:50:05 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Active state perl and IIS3 mixed asp/perl environment
Message-Id: <xaBs3.63$u07.632@news.colt.net>
Maurice Walshe <maurice.walshe@bt.com> wrote:
> I am trying to improve performance as the server is slow - due to NDA
> the asp part sets up a transaction but when the perl cgi program is
> called there seems to be an immense delay in the perl program running.
> Obviously this causes asp re quest to stackup in the queue causing problems.
Hi. It is quite possible that it is the CGI overhead in launching the perl
scripts that is causing the problem. If you don't want to use ActiveState's
solutions to this (they have some, but they may well require IIS4 and rather
tight integration), then Velocigen's product may help you:
www.velocigen.com
It looks like an interesting solution.
------------------------------
Date: Thu, 12 Aug 1999 09:43:15 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: alphabetical listing
Message-Id: <37B2CF73.5CF3B45A@networkengines.com>
Hmm, lwet's see you want to SORT your results you say?
How about umm I dunno, sort? Or better yet, since you're using a database
ORDER BY Name ASC in your query
Noel Flanagan wrote:
>
> Hi all
>
> I'm relatively new to perl and am looking for advice on how to retrieve
> names in alphabetical order from some form of a database when a page first
> loads.
>
> The names in the list which would act as a link to the persons web-site. Is
> there any cgi resources with the solution already available?
>
> Any advice would be graciously recieved
>
> Dec
------------------------------
Date: 12 Aug 1999 14:15:25 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Announcement: "CRAP"
Message-Id: <7ouktt$5uk$2@info2.uah.edu>
In article <7otnie$ov4$1@shell1.ncal.verio.com>,
gerg@shell.ncal.verio.com (Greg Andrews) writes:
: Greg Bacon <gbacon@cs.uah.edu> writes:
:
: >Ye gods, those must be fast networks! :-)
:
: It's a web proxy, not a packet filter.
Sorry, I obviously haven't perfected my mind reading skills yet.
When someone says firewall, I assume that he means firewall and not
something else. :-)
Greg
--
Let me guess: you're a Windows ``programmer'', aren't you? Do you
know why Unix programmers make more money than Windows ``programmers''?
Because we Unix people know how to read the manual -- and you don't.
-- Tom Christiansen
------------------------------
Date: Thu, 12 Aug 1999 18:46:36 +1000
From: "Shalabh Chaturvedi" <shalabh@pspl.co.in>
Subject: Re: CGI timeout problem
Message-Id: <7ovls7$kdh$1@news.vsnl.net.in>
I had a similar problem once. The options are :-
1) Fork the process : didn't work (whatever the child process printed
didn't come thru to the browser)
2) The cgi script itself keeps printing some stuff (within the
loop where it's taking time) : should work. You can keep printing
' ' if you dont want anything in the browser window.
3) (I havent tried this) The first cgi script :-
a) forks a child to do the processing.
b) gives the browser a page which causes it to reload
another cgi script (say results.cgi) after 2 secs.
results.cgi does this : check to see if 'results.txt' exists and
dumps it to the browser if it does, else it gives another
'reload'
page to the browser.
The child process finally creats a 'results.txt' and puts html into it
when done.
Note :-
If you're trying out (1) or (2), your http server should not
buffer the data from cgi sripts.
QuestionExchange <USENET@questionexchange.com> wrote in message
news:790qx@questionexchange.com...
> > info about this.
> > I have a CGI script which is used to migrate files from one
> > server to
> > another. It basically writes out a simple shell script with the
> > commands
> > needed to get the files where they are going. My problem is
> > when I have
> > a LARGE number of files, the browser wants to think the
> > connection is
> > dead and gives up. What I want to do is, while this shell
> > process is
> > running, print something to the brower every so often to keep
> > it
> > 'entertained'. What's a good way to accomplish this? Fork off a
> > process?
> > Mebbe I should read up on forking, but that just sounds a
> > little messy.
> > If I let the shell script run in the background is there a way
> > to tell
> > when it's finished, and I can quit feeding the browser 'dummy'
> > data to
> > keep the connection alive?
> > Anyway, while I read a little more, if anybody has a ready
> > answer, I
> > would appreciate some help.
> > TIA,
> > Duane
>
> So you want to do something like:
> $pid = fork();
> if($pid < 0) {
> # fork failed--
> # print error message and give up.
> exit(-1);
> }
> if($pid == 0) {
> # this is the child
> # just keep printing stuff
> # to the browser
> $| = 1;
> while(1) {
> print "still working...\n";
> sleep(5);
> }
> } else {
> # this is the parent.
> # do whatever processing you need to do...
> # then call exit so both the parent and child go away.
> exit(0);
> }
>
> --
> This answer is courtesy of QuestionExchange.com
>
http://www.questionexchange.com/servlet1/showUsenetGuest?ans_id=2621&cus_id=
USENET&qtn_id=2033
------------------------------
Date: Thu, 12 Aug 1999 09:02:38 -0500
From: "Duane G. Meyer" <diggem@cat.com>
Subject: Re: CGI timeout problem
Message-Id: <37B2D3FE.89C73694@cat.com>
Shalabh Chaturvedi wrote:
>
> I had a similar problem once. The options are :-
>
> 1) Fork the process : didn't work (whatever the child process printed
> didn't come thru to the browser)
>
> 2) The cgi script itself keeps printing some stuff (within the
> loop where it's taking time) : should work. You can keep printing
> ' ' if you dont want anything in the browser window.
>
> 3) (I havent tried this) The first cgi script :-
> a) forks a child to do the processing.
> b) gives the browser a page which causes it to reload
> another cgi script (say results.cgi) after 2 secs.
> results.cgi does this : check to see if 'results.txt' exists and
> dumps it to the browser if it does, else it gives another
> 'reload'
> page to the browser.
>
> The child process finally creats a 'results.txt' and puts html into it
> when done.
>
> Note :-
> If you're trying out (1) or (2), your http server should not
> buffer the data from cgi sripts.
Thanks everyone for all your help, I think I'm getting good ideas on how
to proceed. I've been testing the fork stuff. Option 2 won't work, it's
the shell script that gets built which takes so long to process. (FTP
files selected from a web form, from one server to another) The shell
script written by the perl script is basically this:
ftp -n -v <<host>> > $outfile <<EOF
...
ftp commands here
...
EOF
I can't do anything but normal FTP commands in that file. I'm beginning
to think something similar to option 3 will be what I eventually do.
Unless I can get the browser to show the page as it loads.. which seemed
to happen with another script similar to this one. It would spit out
some info, after the shell script was written it would print "Please
wait...." I would watch it print the first stuff, then print please wait
after, then comes the info I was waiting for.
This isn't my script to begin with, it was inherited from somebody else,
but I have to work with it since he still works here (is my supervisor)
and it's his baby.
<resume lurk mode> (i.e. I'll quit posting my garbage to the group :)
Duane
------------------------------
Date: Thu, 12 Aug 1999 07:34:45 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Comma seperated numbers
Message-Id: <MPG.121c7b65f88674bc9896ab@nntp1.ba.best.com>
So where does the this one from perlfaq5 fit in?
sub commify {
local $_ = shift;
1 while s/^(-?\d+)(\d{3})/$1,$2/;
return $_;
}
Abigail (abigail@delanet.com) remarks...
> ,, sub commify {
> ,, my $text = reverse $_[0];
> ,, $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
> ,, return scalar reverse $text;
> ,, }
>
>
> Eeck. That's very inefficient, as it's quadratic in the length of the
> string.
>
> This variation is linear, because it spends time figuring out whether
> there's a dot in the string once, instead of over and over again (ah,
> the wonders of loop-enlightment techniques):
> sub commify ($) {
> my $str = reverse shift;
> substr ($str, 1 + index ($str, ".")) =~ s/(\d\d\d)(?=\d)/$1,/g;
> scalar reverse $str;
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 12 Aug 1999 13:51:10 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Copy a hash of hashes of hashes
Message-Id: <ijAs3.1287$dr6.29180@news1.rdc2.on.home.com>
In article <7oudq7$vs4$1@nnrp1.deja.com>,
remsta@my-deja.com <remsta@my-deja.com> wrote:
! I need to copy a hash...that contains several nested (and nested and
! nested) hashes.
check out the Storable module's dclone() function, that should
give you what you want.
regards
andrew
--
Some people, when confronted with a problem, think 'I know,
I'll use regular expressions.' Now they have two problems.
-- Jamie Zawinski, on comp.lang.emacs
------------------------------
Date: Thu, 12 Aug 1999 10:32:51 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Copy a hash of hashes of hashes
Message-Id: <linberg-1208991032510001@ltl1.literacy.upenn.edu>
In article <7oudq7$vs4$1@nnrp1.deja.com>, remsta@my-deja.com wrote:
> I need to copy a hash...that contains several nested (and nested and
> nested) hashes.
Since you're posting from deja news, why not do a search right there?
Chris Nandor wrote some nice code to do exactly this around a year or so
ago, and a few others chipped in and tightened it up. In c.l.p.moderated,
as I recall. Just dig around and you'll find it.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Thu, 12 Aug 1999 15:40:04 +0100
From: Andrew Green <green@argonet.co.uk>
Subject: Corrupted STDOUT
Message-Id: <493077a6abgreen@argonet.co.uk>
Hello all,
I'm now at the point of true, whimpering despair over a problem with
corrupted output from a CGI script. I've looked through Camel and the
Perl Cookbook, read a number of FAQs and searched deja.com (and
elsewhere), with no joy. It's not so much that I can't figure out how to
do something, more that I can't for the life of me figure out why
something else is happening.
Although it's a CGI script, I'm confident it's likely to be more of a
problem with my Perl skills, which is why I've posted here. I sincerely
apologise if anyone disagrees.
The pulls records from a GDBM database and presents them to the user,
either by (crudely) searching the database, letter-by-letter by title, or
by jumping to a specific item from a drop-down list. At the end of each
page of results, it presents a box that enables the user to make further
selections from the method they've chosen.
For most results, everything works fine - but where there are more than
around 20 records displayed on a page, the output at the end of the
program gets corrupted in some frankly bizarre ways: bits of output from
higher up the page are interpolated more-or-less randomly into the end of
the page, often accompanied by a great many null control codes. Some
bits don't print at all.
I originally thought that this would be a buffer problem, did my
research, and accordingly set $|++; - but this resulted in a similar (but
worse) situation.
I also tried to run the script offline, through telnet, on exactly the
same server. It works fine in this context, every time - but as soon as
it's running in a CGI environment with more than a few records to
display, the weird outputs begin. The script barely uses CGI input, FWIW.
It's running through Apache on a BSD box, using Perl 5.004.
Because the script currently runs in a protected environment (simple
.htpasswd checking) I've uploaded a couple of static examples of what
happens to another area, together with a somewhat-annotated version of
the source code:
http://guineapig.article7.co.uk/perlness/
I'm sure I make many, many general blunders in the source code - but the
real confusion for me seems to be that this specific problem only occurs
when there's a "critical mass" of data being printed to STDOUT.
I'm hoping this is a familiar scenario to some of you (but not so
familiar to be an FAQ somewhere), and that you'll forgive any errors of
netiquette in my query, and random scum in my source.
Also, I'm really *very* grateful to anyone who can (try to) help me out.
Many thanks,
Andrew Green.
------------------------------
Date: 12 Aug 1999 09:52:53 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: Dereferencing anon hash
Message-Id: <slrn7r5kdk.afb.elflord@panix3.panix.com>
On 12 Aug 1999 03:07:14 -0500, Abigail wrote:
>Huh? The value of $database {$_} most certainly is an anon hash.
Doh ! ( slaps himself in the face )
>() ${hash_ref}->{"1"}
>
>No. You either want $hash_ref -> {1} *or* ${hash_ref} {1}.
Hmmm.
perl -e '$database->{1}="foo"; print ${database}{1},"\n";'
<blank output>
$ perl -e '$database->{1}="foo"; print ${database}->{1},"\n";'
foo
$
>Well, no, $database {$key} is a hash ref. Don't forget the program
Got it now.
I would dereference it like this:
$database{$key}->{$other_key}
>ran under -w, and Josh didn't report any other warnings. While odd,
>%{$database {"crd.9.m0"}} -> {"1"} *is* correct.
Gives me an error ( both of these do : )
perl -e '$database{1}={foo=>"bar"}; print %database{1}->{foo},"\n";'
perl -e '$database{1}={foo=>"bar"}; print %{database{1}}->{foo},"\n";'
--
Donovan
------------------------------
Date: 12 Aug 1999 14:34:09 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Dereferencing anon hash
Message-Id: <7oum11$5uk$5@info2.uah.edu>
In article <37B2C6F2.35D5C5F7@mindspring.com>,
Hector Gonzalez <hgonzalez@mindspring.com> writes:
: I am very sorry about the inconveniences that my stupid formatting
: program has caused. I didn't mean to disrupt your newsgroup in this
: way. I will stop sending any mail to this newsgroup. Please forgive me.
Who is `this newsgroup'? We're not asking you to stop sending mail;
we're asking you to quit posting garbage to comp.lang.perl.misc.
Greg
--
The manufacturers of KY Jelly have announced that their product is now fully
Year 2000 compliant. In the light of this they have now renamed it as 'Y2KY
Jelly'. Said a spokesman: "The main benefit of this revision to our product,
is that you can now insert four digits into your date instead of two".
------------------------------
Date: 12 Aug 1999 09:39:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Dereferencing anon hash
Message-Id: <slrn7r5n4b.e3e.abigail@alexandra.delanet.com>
Donovan Rebbechi (elflord@news.newsguy.com) wrote on MMCLXXII September
MCMXCIII in <URL:news:slrn7r5kdk.afb.elflord@panix3.panix.com>:
,, On 12 Aug 1999 03:07:14 -0500, Abigail wrote:
,,
,, >Huh? The value of $database {$_} most certainly is an anon hash.
,,
,, Doh ! ( slaps himself in the face )
,,
,, >() ${hash_ref}->{"1"}
,, >
,, >No. You either want $hash_ref -> {1} *or* ${hash_ref} {1}.
,,
,, Hmmm.
,,
,, perl -e '$database->{1}="foo"; print ${database}{1},"\n";'
,, <blank output>
,, $ perl -e '$database->{1}="foo"; print ${database}->{1},"\n";'
,, foo
,, $
Your point being? I think "database" is a string, not a hash_ref.
What do you think?
$ perl -e '$database -> {1} = "foo"; print ${$database}{1}, "\n"'
foo
$
,,
,, >Well, no, $database {$key} is a hash ref. Don't forget the program
,,
,, Got it now.
,,
,, I would dereference it like this:
,,
,, $database{$key}->{$other_key}
,,
,, >ran under -w, and Josh didn't report any other warnings. While odd,
,, >%{$database {"crd.9.m0"}} -> {"1"} *is* correct.
,,
,, Gives me an error ( both of these do : )
,,
,, perl -e '$database{1}={foo=>"bar"}; print %database{1}->{foo},"\n";'
,, perl -e '$database{1}={foo=>"bar"}; print %{database{1}}->{foo},"\n";'
Yeah. Learn to read. Both Josh and I wrote the equivalent of
%{$database{1}} -> {foo}. `$'s aren't just optional symbols.
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Aug 1999 09:48:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: dot is too precious to be only for string concatenation
Message-Id: <slrn7r5nln.e3e.abigail@alexandra.delanet.com>
John Lin (johnlin@chttl.com.tw) wrote on MMCLXXII September MCMXCIII in
<URL:news:7ou09n$rs3@netnews.hinet.net>:
()
() My proposal is
()
() 1. invent another operator for string cancate, say 'cat':
()
() $concated=$string1.$string2;
()
() becomes
()
() $concated=$string1 cat $string2;
()
() 2. create a new compiler directive
() which reserves '.' for hash reference. For example:
()
() use dot; # compiler directive
() $john.name='John' cat ' Smith'; # then we can use dot
()
()
() Oh, I really hope Perl programs look like that.
() What do you think about it?
I don't think it's worth breaking about 75% of the programs out there,
for something that doesn't gain us anything. . would save a few keystrokes
over -> {}, but you'd lose them on the 'cat' vs '.' issue.
Besides, -> is used for dereferencing objects, closures, and arrays as well.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 12 Aug 1999 10:30:36 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Help with system()
Message-Id: <linberg-1208991030360001@ltl1.literacy.upenn.edu>
In article <934457644.24985@www.remarq.com>, Tralyn
<anonymous@web.remarq.com> wrote:
> I would like to open a directory (like /home) and remove
> certain files from all the user directories. Command line
> I use "find . -name .sh_history -exec rm -r {} \;"
> When I put this line in my perl script I get all kinds of
> syntax errors. Is there a way to do this?
You mean, is there a way to delete files from within Perl? Certainly, and
you don't need to mess with shell commands.
Look into File::Find.
Look into unlink.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Thu, 12 Aug 1999 10:20:04 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: info on CGI client
Message-Id: <linberg-1208991020040001@ltl1.literacy.upenn.edu>
In article <827qx@questionexchange.com>, QuestionExchange
<USENET@questionexchange.com> wrote:
> print $ENV{REMOTE_ADDR};
No. This is wrong. Please don't promote misinformation.
$ENV{REMOTE_ADDR} *might* have the user's IP address in it. It might also
be a meaningless proxy server address, or it might contain bogus or faked
information, or it might contain nothing at all.
Anybody who tries to base meaningful code on it is going to have trouble.
Best to figure out another way to do whatever you're trying to do with
it. You can't count on it containing anything meaningful.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Thu, 12 Aug 1999 09:13:06 -0500
From: Jay Long <jlong@sgi.com>
Subject: IO-Tty-0.02 and Tty.pm problems (expect.pm)
Message-Id: <37B2D672.23FADEF4@sgi.com>
Hello All,
New to perl and have been assigned the task of writing a program that
will read/write
eeproms. My task includes communicating via a serial port to the
RS232 to I2C host
adapter w/ascii interface .... well, after much knashing of teeth I've
been informed
of the expect.pm module /http://www.cpan.org/module/by-module/Expect
and it
appears the best way to go. However, I'm now knashing my teeth because
expect
requires two modules, Stty.pm and Tty.pm. The IO-Tty-0.02 module
contains the
needed Tty and Pty modules but I'm running into problems beyond the
scope of this
communications format. If you've had experience with installing the
module or
communicating via serial port connections can you email me? I'm pretty
clueless.
BTW.. the program needs to run on a pc running linix and an O2 running
irix.
Jay
--
Jay Long, MTS-Manufacturing phone: 715-726-4466
Silicon Graphics, Inc. FAX: 715-726-4346
WWMO C.F. Operations Mailstop: CF-RVSYS Email: jlong@sgi.com
------------------------------
Date: Thu, 12 Aug 1999 09:59:07 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: is our reese the author of mysql book?
Message-Id: <37B2D2B7.E3A19B50@chaos.wustl.edu>
Uri Guttman wrote:
> >>>>> "A" == Abigail <abigail@delanet.com> writes:
> A> Getting your code to run such that no warnings are generated isn't the
> A> ultimate goal.
>
> true but it doesn't hurt. i even hate to see c code compile with
> warnings. i build gnu/public stuff with has warnings and i get pissed
> off. they should know better.
Warnings in C are much like warnings in Perl, non-critical, but should
be noted. C that compiles very cleanly on an AIX box may puke gloriously
on a Sparc with gcc. However, if you use Sparcworks, it compiles
beautifully without warnings.
> no warnings should not be the goal but a side effect of quality
> coding. i use it to make sure i don't assume coercion of undef. also i
> use strict to make sure i don't have typos. i like the warning about a
> var only used once. that either means a typo or i have some implied
> thing that i should make explicit.
Warnings should be an indication of possible problems which the debugger
or your brain will help tidy up. I've seen _really_ bad code generate no
warnings....as always YMMV.
e.
------------------------------
Date: 12 Aug 1999 09:41:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: is our reese the author of mysql book?
Message-Id: <slrn7r5n7c.e3e.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXXII September
MCMXCIII in <URL:news:37b28ae7@cs.colorado.edu>:
{} [courtesy cc of this posting mailed to cited author]
{}
{} In comp.lang.perl.misc,
{} abigail@delanet.com writes:
{} : my $foo;
{} : ...
{} : foreach my $fruit (qw /apple pear banana/) {
{} : $foo .= "$fruit "; # Gives a warning, but is ok.
{} : }
{}
{} Well, it certainly doesn't give a warning in current perls.
{} Perhaps you're talking about under some proposed change.
That's true. I meant to write:
$foo = "$foo $fruit";
But I wrote something else.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 V9 Issue 479
*************************************