[8721] in Perl-Users-Digest
Perl-Users Digest, Issue: 2338 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 16 14:07:25 1998
Date: Thu, 16 Apr 98 11:00:42 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 16 Apr 1998 Volume: 8 Number: 2338
Today's topics:
Re: .= so why not =. ? <rootbeer@teleport.com>
Re: [Perl] How to find the Perl FAQ <Russell_Schulz@locutus.ofB.ORG>
cgi scripts to modify root-owned files and processes ? sweeting@neuronet.com.my
Re: Comma delimeted, quoted data (Mark-Jason Dominus)
Re: Comma delimeted, quoted data <rootbeer@teleport.com>
Re: contexts: is there such a thing as array? <merlyn@stonehenge.com>
Dynaloader object loader <dunlopg@bathroom.tibus.net>
Excel97 wont SaveAs() <robk-not-@reading.sgi.com>
Re: grep <cnwetzel@linguistik.uni-erlangen.de>
Re: hash/complex data structure problem (Abigail)
Re: HELP!!! Script to perform website search <mthurn@tasc.com>
how to develop/test perl-cgi in local win32 development <dtbaker_@flash.net>
Re: How to execute more than one command via System (Greg Gershowitz)
Re: How to execute more than one command via System (Greg Gershowitz)
Re: HTTP Perl Question <rootbeer@teleport.com>
Re: Info Regarding Perl 5.005 (Ilya Zakharevich)
Re: Memory Leak? Embedding into C (Gurusamy Sarathy)
Re: Memory Leak? Embedding into C <sdh1@anchor.hotmail.com>
Re: Perl 5.004_64 Slower??? (Ilya Zakharevich)
Re: Please help with bizzare error <rootbeer@teleport.com>
Re: push a non HTML document to a web browser? (Abigail)
Re: question of interest: How does perl compile? (Abigail)
Re: sleep & print in cycles (Abigail)
Re: unix commands in a perl <tturton@cowboys.anet-dfw.com>
Re: Viewing perl abstract data structures no_spam@winzig.com
Re: Viewing perl abstract data structures no_spam@winzig.com
Re: Which Win32 Perl <sowmaster@juicepigs.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 16 Apr 1998 16:00:46 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: John Adams <John.Adams@BentonvilleAR.ncr.com>
Subject: Re: .= so why not =. ?
Message-Id: <Pine.GSO.3.96.980416085501.838L-100000@user2.teleport.com>
On Thu, 16 Apr 1998, John Adams wrote:
> $string1 = "foo";
> $string2 = "bar";
> $string1 =. $string2; #$string1 is now "barfoo"
>
> Or am I missing something here?
Well, I think the syntax prevents us from easily making an '=.' operator
in Perl. (And maybe you didn't know that .= is just a variation on the .
operator - but there's no "reversed ." operator!)
There could be an operator which prepends to a string, although it's a
rare operation. But if that's what you want, here's one way.
substr($string1, 0, 0) = $string2;
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 16 Apr 1998 11:31:41 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: [Perl] How to find the Perl FAQ
Message-Id: <19980416.113141.0H1.rnr.w164w@locutus.ofB.ORG>
Tom Phoenix <rootbeer&pfaq*finding*@redcat.com> writes:
> The Perl FAQ is modified frequently; the last major
> update was in Spring of 1997.
perhaps:
The last major update of the Perl FAQ was in spring of 1997, though
minor updates are made frequently.
and does it have to be posted to c.l.p.announce weekly? it _is_ tiny,
but it doesn't have an Expires: header, and I keep c.l.p.announce a
long, long time.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Thu, 16 Apr 1998 12:28:46 -0600
From: sweeting@neuronet.com.my
Subject: cgi scripts to modify root-owned files and processes ?
Message-Id: <6h5f4c$mic$1@nnrp1.dejanews.com>
I have some CGI scripts to manage DNS ; this involves
modifying files owned by root (with 755 privileges) and
also involves restarting processes owned by root (with
kill -HUP PID).
However, since the webserver is run as Nobody, the
CGI scripts do not have the permission to do either of
the above.
Short of running the webserver's child processes as root,
is there any way of allowing the above ?
(SuExec on Apache will not allow to setuid root or system
uids)
Thanks in advance for any pearls of wisdom,
chas
ps. if you could cc to sweeting@neuronet.com.my, I would be
very grateful since I sometimes miss posts using dejanews.
thank you.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 16 Apr 1998 12:21:32 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Comma delimeted, quoted data
Message-Id: <6h5b6c$j2d$1@monet.op.net>
Keywords: colonist Eumenides quiet worm
In article <3536216F.AFB6E8F0@mdmgr.com>,
Scott Saddison <scotts@mdmgr.com> wrote:
>how can I split this data into fields ignoring the commas in quoted
>text?
Text::CSV.
This is a FAQ.
------------------------------
Date: Thu, 16 Apr 1998 16:27:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Scott Saddison <scotts@mdmgr.com>
Subject: Re: Comma delimeted, quoted data
Message-Id: <Pine.GSO.3.96.980416092505.838P-100000@user2.teleport.com>
On Thu, 16 Apr 1998, Scott Saddison wrote:
> I have a data base file that I need to grab data from. The file is
> comma delimeted and sometimes quoted. The problem is sometimes there
> are commas in the quoted text.
The faq has info about this. Look for "comma-separated". Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 16 Apr 1998 15:56:28 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
To: mjtg@cus.cam.ac.uk (M.J.T. Guy), perl5-porters@perl.org
Subject: Re: contexts: is there such a thing as array?
Message-Id: <8c4sztkbg8.fsf@gadget.cscaper.com>
[cc'ed to Perl5Porters for internal discussion]
>>>>> "M" == M J T Guy <mjtg@cus.cam.ac.uk> writes:
M> Not really a bug; just a case of being careful about how you describe the
M> behaviour. The comma isn't really behaving in any sort of context,
M> since this is syntax which is parsed specially, so the comma isn't an
M> operator at all, just another piece of line noise.
M> The fact that the semantics (and the syntax) is the same as if the comma
M> _were_ a scalar-context comma operator, but with its operands evaluated in
M> list context, just serves to keep you on your toes.
But is this any different from a normal comma construct?
$ perl
@a = (7,4);
@list = (10..19);
%hash = ( 2 => "two", 4 => "rubble" );
$scalar_comma = (1, 3, 5, @a);
$scalar_list_slice = @list[1, 3, 5, @a];
$scalar_hash_slice = @hash{1, 3, 5, @a};
print "comma = $scalar_comma, list slice = $scalar_list_slice hash slice = $scalar_hash_slice\n";
^D
comma = 2, list slice = 14 hash slice = rubble
$
Egad. It is. That just shocked me. I guess there's still some hairy
parts of Perl that I'm still learning. List slice and hash slice both
use the last element of their args interpreted one by one in a *list*
context, while scalar comma interprets its operands in a *scalar*
context. Which means that these are also different:
$n = @foo[(3,5,@a)] # last element of @a
$n = @foo[$dummy = (3,5,@a)]; # count of @a
How bizarre.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 138 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 16 Apr 1998 17:33:31 +0100
From: "Gareth Dunlop" <dunlopg@bathroom.tibus.net>
Subject: Dynaloader object loader
Message-Id: <892748018.531571@sparc.tibus.net>
When I run the following command,
perl odbc.pm
I get the following error message, despite the fact that all my .pm and .pl
files are in the correct place. Has anyone met a similar problem, or does
anyone know where the problem might lie. Thanks in advance.
Can't locate loadable object for module Win32::ODBC in @INC (@INC contains: c:\p
erl\lib\site c:\perl\lib c:\perl\lib c:\perl\lib\site c:\perl\lib\site .) at c:\
perl\lib/DynaLoader.pm line 90
DynaLoader::croak('Can\'t locate loadable object for module Win32::ODBC
in @INC (@I...') called at c:\perl\lib/DynaLoader.pm line 141
DynaLoader::bootstrap('Win32::ODBC') called at odbc.pm line 887
Gareth.
--
--------------------------
Gareth Dunlop
(Please remove "bathroom." from my email address when replying.)
------------------------------
Date: Thu, 16 Apr 1998 17:22:21 +0100
From: Rob Knight <robk-not-@reading.sgi.com>
Subject: Excel97 wont SaveAs()
Message-Id: <3536303D.2B12EE53@reading.sgi.com>
I am having some grief using Win32::OLE to open an HTML file and then
save it into Excel95/5 format with Excel97. Whilst Excel can be told to
open the HTML and then save it away to another filename, I just can't
pursuade it to use the xlExcel5 format...
use Win32::OLE ;
$tfile = 'c:\start.htm' ;
$nfile = 'c:\finish.xls' ;
$xl = new Win32::OLE 'Excel.Application' ;
$xl->{Visible} = 1 ;
$xl->Workbooks->Open($tfile) ;
$xl->ActiveWorkbook->SaveAs({
Filename => $nfile,
Fileformat => 'xlExcel5',
});
$xl->Quit() ;
Results in Excel trying to save a default format file to 0.xls and I get
the -w message:
"Use of unitialized value at C:\Perl504\lib\site/Win32/OLE.pm"
Which explains why it sets the filename to 0.xls, if nothing else.
If I use $xl->ActiveWorkbook->SaveAs($nfile) it will save to the
filename I give it, but this uses the 97 format. I have tried
...->SaveAs($nfile, 'xlExcel5') too, but this does not even save the
file. The properties just don't seem to be passed to the SaveAs method.
The Perl is Gurusamy's 5.004_02, running on NT 4-sp3 and Excel is
Enterprise SR-1.
Any light will be much appreciated!
Rob
--
________________________________________________________________________
Rob Knight, Silicon Graphics Limited e-mail: robknot-@reading.sgi.com
1530 Arlington Business Park, Theale phone: +44-(0)118-925-7936
Reading, Berkshire, RG7 4SB, England fax: +44-(0)118-925-7556
________________________________________________________________________
------------------------------
Date: Thu, 16 Apr 1998 18:21:23 +0200
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: Re: grep
Message-Id: <35363003.26E8@linguistik.uni-erlangen.de>
Chris Snyder wrote:
> I am trying to write a program where the grep command is used to search
> through all files in a directory (without knowing the file names) based
> on a user entered string, and print out the names of all files
> containing text matching the string.
Congratulations!
SCNR,
Christian
P.S.: On Unix, try the command
find <directory> -exec grep -l '<search string>' {} \;
or look at Jeffrey Friedl's sophisticated "search" Script:
<URL:http://enterprise.ic.gc.ca/~jfriedl/perl/index.html#search>
------------------------------
Date: 16 Apr 1998 16:00:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: hash/complex data structure problem
Message-Id: <6h59vf$1up$1@client2.news.psi.net>
Mika Koivisto (mika@wcug.wwu.edu) wrote on MDCLXXXIX September MCMXCIII
in <URL: news:Pine.LNX.3.96.980415222420.24530A-100000@sloth>:
++ I have this problem with a complex structure which looks like this:
++
++ Now the problem is that I need to walk trough each item on that structure
++ and crap the price, setup and other and then do something with them.
++
++ I know how to go trough them by hand
++ ($virtual{'plan1'}{'full'}{'3'}{'price'} etc.) but I ideally would like to
++ use nested foreach or what ever does the job shortest and not having to
++ modify that code if and when I add or remove items. The structure will
++ stay the same.
++
++ Could someone help me out with the traverse code.
Well, one way is:
while (($plan, $plan_hash) = each %virtual) {
while (($part, $part_hash) = each %$plan_hash) {
while (($number, $number_hash) = each %$part_hash) {
my $price = $number_hash -> {price};
my $setup = $number_hash -> {setup};
my $other = $number_hash -> {other};
do_something ($price, $setup, $other);
}
}
}
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: 16 Apr 1998 12:39:17 -0400
From: Kingpin <mthurn@tasc.com>
Subject: Re: HELP!!! Script to perform website search
Message-Id: <eulnt5bu16.fsf@aspen.irnet.rest.tasc.com>
kmyers@syneractive.com writes:
> Can anyone tell me where I can find a script which when given a keyword and
> domain (ex. usatoday.com) returns all links to pages which contain the
> keyword?
Install the WWW::Search module and do
WebSearch -e AltaVista -- '+keyword +url:usatoday.com'
--
- - Martin "Kingpin" Thurn mthurn@tasc.com
Research Software Engineer (703) 834-5000 x2926
The Information Refinery http://tir.tasc.com
TASC, Inc. http://www.tasc.com
Hang on tight, Artoo, you've got to come back. You wouldn't want my life to get boring, would you? -- C-3PO, Star Wars
------------------------------
Date: Thu, 16 Apr 1998 11:22:54 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: how to develop/test perl-cgi in local win32 development environment?
Message-Id: <35363E6E.731F@flash.net>
I'm looking for some input from the experts on the best ways to test
perl-cgi programs when developing in the win32 (windows95) environment.
it is becoming clear to me that I need to have either some form of a
local web server or Perl module/daemon emulating this sort of thing to
make perl and HTML form data interact correctly....
could people please comment on what tools they have found effective in
creating a development environment that allows local development and
testing on a windows95 machine? I'm very interested in learning about
what tools are required for effective editting (emacs, other?) testing,
and web server emulation in a standalone environment. For instance, with
editting I'm wondering what the best tool is to be able to jump to the
correct line number when an error is given by Perl.
for new perl developers like myself, please include URLs for where to
grab things if you happen to have them handy!
As a starter, lets assume that I just went and grabbed the latest
standard Perl 5.004_04 from
http://www.perl.com/CPAN-local/ports/win32/Standard/x86/ ...What else do
I need? Any particular options I need to be sure to install and read
about?
thanx a ton,
Dan
------------------------------
Date: Thu, 16 Apr 1998 16:18:25 GMT
From: gregg@charlotte.computex.com (Greg Gershowitz)
Subject: Re: How to execute more than one command via System
Message-Id: <35362327.681416935@client.news.psi.net>
On Wed, 15 Apr 1998 11:34:24 GMT, vasekk@cdi.cz (Vaclav Kulakovsky)
wrote:
>try this
>
>system("copy file1 file2 > file.tmp");
>system("del file.tmp");
>
>yuo don't se any output :-)
That's true enough, but I'd rather not have to deal with temporary
files just to simulate an 'echo off' condition.
It turns out that doing a
$junkOutput = `copy file1+file2+file3 file4`
does the trick. I just don't do anything with $junkOutput.
-Greg G
--
Greg Gershowitz mailto:gregg@charlotte.computex.com
International CompuTex, Inc. http://www.computex.com
(704)547-7383 x230 FAX: (704)548-1948
------------------------------
Date: Thu, 16 Apr 1998 16:22:11 GMT
From: gregg@charlotte.computex.com (Greg Gershowitz)
Subject: Re: How to execute more than one command via System
Message-Id: <35362fae.684623606@client.news.psi.net>
On Tue, 14 Apr 1998 12:43:47 GMT, Gellyfish@btinternet.com (Jonathan
Stowe) wrote:
>You dont need the second system() really:
>unlink("file.tmp");
>Infact possibly:
>system("copy file1 file2 >nul:");
nul: seems to work. I couldn't remember the pseudo-device for
/dev/null.
>You might alternatively consider doing away with the system()
>altogether by using File::Copy or one of the other alternatives
>advocated here a little while ago (better check DejaNews for the full
>SP on that)
The problem with the File:: that I have, is that it doesn't seem to
support concatenating files, which is what I'm trying to do.
-Greg G
--
Greg Gershowitz mailto:gregg@charlotte.computex.com
International CompuTex, Inc. http://www.computex.com
(704)547-7383 x230 FAX: (704)548-1948
------------------------------
Date: Thu, 16 Apr 1998 16:31:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Phil Mein <pmein@johnco.cc.ks.us>
Subject: Re: HTTP Perl Question
Message-Id: <Pine.GSO.3.96.980416093012.838Q-100000@user2.teleport.com>
On Thu, 16 Apr 1998, Phil Mein wrote:
> Does anyone have a simple perl script that fetches a nonlocal web page
> in a text only mode?
Not sure what you mean by a "text only mode". Maybe you mean that you want
to render the page, or to strip the HTML tags. But there are many simple
scripts which will fetch a remote web page. You can look for one in the
docs for the LWP module. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Apr 1998 17:21:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Info Regarding Perl 5.005
Message-Id: <6h5em1$hme$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Piers Cawley
<pdcawley@bofh.org.uk>],
who wrote in article <s7phg3tdhmb.fsf@olorin.elsevier.nl>:
> > *And* major optimizations.
>
> Okay, so how much of Friedl's book is going to be irrelevant once
> 5.005 hits the streets?
All positive things stay. Out of negative things only the most
important two will stay: DFA vs NFA and first-char cognizance.
These two will wait - probably until 5.006.
Ilya
------------------------------
Date: 16 Apr 1998 16:05:20 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Memory Leak? Embedding into C
Message-Id: <6h5a80$rqg@srvr1.engin.umich.edu>
[ mailed and posted ]
In article <6h3bkb$jm33@eccws1.dearborn.ford.com>,
Ken Fox <kfox@pt0204.pto.ford.com> wrote:
>BTW, I'm running 5.004_04 on SunOS 5.5.1 and if I do a tight loop
>of your original test() function it leaks like a sieve here too. My
>perl doesn't use MULTIPLICITY -- that might make a difference. Anybody
>know if the development track has this problem?
5.004_65 should fix all known embedding leaks. Remember to set
C<perl_destruct_level = 1;> if you don't build perl with
-DMULTIPLICITY.
- Sarathy.
gsar@umich.edu
------------------------------
Date: Thu, 16 Apr 1998 13:26:18 -0400
From: "Scott" <sdh1@anchor.hotmail.com>
Subject: Re: Memory Leak? Embedding into C
Message-Id: <6h5f5h$osm$1@camel29.mindspring.com>
Gurusamy Sarathy wrote in message <6h5a80$rqg@srvr1.engin.umich.edu>...
> [ mailed and posted ]
>
>In article <6h3bkb$jm33@eccws1.dearborn.ford.com>,
>Ken Fox <kfox@pt0204.pto.ford.com> wrote:
>>BTW, I'm running 5.004_04 on SunOS 5.5.1 and if I do a tight loop
>>of your original test() function it leaks like a sieve here too. My
>>perl doesn't use MULTIPLICITY -- that might make a difference. Anybody
>>know if the development track has this problem?
>
>5.004_65 should fix all known embedding leaks. Remember to set
>C<perl_destruct_level = 1;> if you don't build perl with
>-DMULTIPLICITY.
>
> - Sarathy.
> gsar@umich.edu
Sounds like a winner, but where do I get version 5.004_65? I checked on the
www.perl.com
web site and it isn't there.
Thanks for your help....
-Scott
------------------------------
Date: 16 Apr 1998 17:26:42 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <6h5f0i$i1b$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Stuart McDow
<smcdow@arlut.utexas.edu>],
who wrote in article <6h51q3$qh7$1@ns1.arlut.utexas.edu>:
> Bill 'Sneex' Jones <sneaker@earthling.net> writes:
> >
> > I think I will keep the 'without thread support' for now...
>
> If your system supports fork(), there is no need for threads
> whatsoever.
This is so riduculous, that I do not even want to rebuke... *A lot*
of thread-related-things may be done with fork. Maybe as much as 10%
of them. For the remaining 90% you *need* threads.
Say, try to do async signal processing with fork().
Ilya
P.S. Of course, a need for thread-related-things is greately
exaggerated. One of the few things one cannot easily do without
threads is most of interactive applications.
------------------------------
Date: Thu, 16 Apr 1998 16:20:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Vladimir Gabrielescu <vgabriel@lochaber.rutgers.edu>
Subject: Re: Please help with bizzare error
Message-Id: <Pine.GSO.3.96.980416091524.838O-100000@user2.teleport.com>
On 16 Apr 1998, Vladimir Gabrielescu wrote:
> I working on this perl program, using perl 5.004, and at run time
> I get a whole bunch of errors like this:
>
>
> Attempt to free unreferenced scalar.
> Attempt to free unreferenced scalar.
> Attempt to free unreferenced scalar.
>
> From the manual description of this error I am even more confused,
> because I am not _directly_ including any C code. I am however using
> a bunch of the modules that come with perl 5.004, such as most of the
> File::, FileHandle, and Getopts, and also a module from CPAN,
> Sort::Versions, though I get the same errors even with that last
> one removed.
One of those modules, or Perl itself, has a bug on your system. It may be
that one of those is miscompiled, or it may have a true bug in the source.
Unless you can debug the C code, your best bet is probably to cut down
your code to the smallest example which exhibits the bug while using the
fewest modules. If you're still using any modules which aren't part of the
standard distribution, contact their authors. Otherwise, use perlbug to
file the bug report.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Apr 1998 16:32:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: push a non HTML document to a web browser?
Message-Id: <6h5bri$dk4$1@client3.news.psi.net>
Paul (fgculp@YOUKNOWWHATTODO.vianet.net.au) wrote on MDCLXXXIX September
MCMXCIII in <URL: news:6h4tmh$a03$1@yeppa.connect.com.au>:
++
++ Is is possible to open a binary file like MSWord and send it to STDOUT?
Yes.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 16 Apr 1998 16:36:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: question of interest: How does perl compile?
Message-Id: <6h5c2i$dk4$2@client3.news.psi.net>
Frank L. Quednau (quednauf@nortel.co.uk) wrote on MDCLXXXIX September
MCMXCIII in <URL: news:3535CB15.3D69AEB@nortel.co.uk>:
++ Hi,
++ now I've heard the story that, say, you have a CGI script, it
++ gets compiled once called (Apart from teh Apache solution and the
++ day a perl compiler comes out). Basically I am just curious what
++ gets compiled when, and how can I influence it?
You can influence it with pragma's, BEGIN {}, use, eval and s///e.
++ if $action comes from a form and is set to 1, how is the script
++ compiled? The whole thing or just the code on top and the
The whole thing.
++ &format_hd subroutine? Can I influence that? Is there any FAQ?
Yes, you can influence it; use the autoloader.
++ (Haven't seen any, though admittedly I only scanned the
++ titles...)
The faq comes with your perl distribution. "man perlfaq".
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: 16 Apr 1998 16:37:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sleep & print in cycles
Message-Id: <6h5c4e$dk4$3@client3.news.psi.net>
Petr Hrbek (uph@is.pdas.cz) wrote on MDCLXXXIX September MCMXCIII in
<URL: news:6h4bv7$nnq$3@dungeon.pdas.cz>:
++
++ How can I force the script output to be written during cycle?
Flush your output. See the entry '$|' in perlvar.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Thu, 16 Apr 1998 11:32:00 -0500
From: Tom Turton <tturton@cowboys.anet-dfw.com>
To: Inge Soetens <soetensi@se.bel.alcatel.be>
Subject: Re: unix commands in a perl
Message-Id: <35363280.682F4A32@cowboys.anet-dfw.com>
Inge Soetens wrote:
> Hi,
>
> how can I execute some normal UNIX-commands from a perl script ?
>
> I tried to use "system" and "exec",
> but something seems to go wrong.
>
> $file = " find . -name '*.pr' |" ;
> open (FIND, $file );
> while ($line = <FIND>) # while notEOF
> {
> print $line;
> exec "/usr/bin/chmod -f 0755 $line" ;
> }
> close FIND ;
>
> The code is executed until it arrives the "exec" statement.
> There it stops.
I had no problems if I change your "exec" command into:
$cmd = "/usr/bin/chmod -f 0755 $line";
system($cmd);
---Tom Turton
------------------------------
Date: Thu, 16 Apr 1998 12:09:07 -0600
From: no_spam@winzig.com
Subject: Re: Viewing perl abstract data structures
Message-Id: <6h5dvi$kjf$1@nnrp1.dejanews.com>
In article <Pine.SGI.3.95.980416080620.6631B-100000@vangogh.bergen.org>,
Jeff Pinyan <jefpin@bergen.org> wrote:
>
> ># %h1 = {
> ># this => that
> ># %h2 = {
> ># 1 => 2
> ># 2 => 4
> ># 3 => 6
> ># 4 => 8
> ># };
> ># @a2 = [
> ># aa
> ># bb
> ># cc
> ># dd
> ># ee
> ># ff
> ># ];
> ># };
> ># @a1 = [
> ># jane
> ># harriet
> ># ozzy
> ># ];
> ># };
>
> I really hope this gave you errors... it should have!
> %hash = ( ... ); #NOT %hash = { ... }
> @array = ( ... }; #NOT @array = [ ... ]
I should have been clearer... the output is not real code, just
pseudo code. When I began writing it, I just wanted a quick
way to see the structure, then I added in the {} and [] stuff
so that I could pick up on which structure I was looking at.
(Would LWall be proud of me for using mnemonics? :-)
Anyway, I just found out about Data::Dumper, which would have saved me a few
hours had I found it earlier. :)
-thomas
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 16 Apr 1998 12:06:11 -0600
From: no_spam@winzig.com
Subject: Re: Viewing perl abstract data structures
Message-Id: <6h5dq1$kgv$1@nnrp1.dejanews.com>
In article <6h423e$cn3@fridge.shore.net>,
"Grinch" <grinch@whoville.com> wrote:
>
> no_spam@winzig.com wrote in message <6h4154$6ju$1@nnrp1.dejanews.com>...
>
> >I was working on a script that uses some abstract data structures (like
> hashes
> >of hashes of arrays of hashes, etc...) and I needed a way to debug the
> script
> >and view my structures.
>
> You may want to take a look at the Data::Dumper module... Using it would
> save you the effort of writing your own.
>
> -grinch
Doh! Jeez I knew there had to be something available to do this. I even
searched through CPAN, but I didn't even see the module! Thanks for the info!
-thomas
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 16 Apr 1998 12:21:55 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: Which Win32 Perl
Message-Id: <35363023.3951@juicepigs.com>
Matt Sergeant wrote:
>
> Jeff Pinyan wrote:
> >
> > >I've read the description of the differences between "Active State"
> > >and "Gurusamy Sarathy's" versions. I like the sounds of GS's, but
> > >before I blow away my "Active State" version I'd like to know if
> > >anyones had any problems with GS's. Also, anyone had problems
> > >switching between the versions?
> >
> > Far and away, Gurusamy's is the best. I had no problems/qualms about
> > switching... do yourself and favor and change as soon as you can.
> >
> Unless you want to work with IIS and CGI/PerlScript/PerlEx/PerlIS, then
> stick with AS perl.
ActiveState's perl port is old. It also doesn't include the dozens of
modules that come with Gurusamt sarathy's port of perl 5.004_02.
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
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 2338
**************************************