[12870] in Perl-Users-Digest
Perl-Users Digest, Issue: 280 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 28 04:07:37 1999
Date: Wed, 28 Jul 1999 01:05:12 -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 Wed, 28 Jul 1999 Volume: 9 Number: 280
Today's topics:
_Don't_ loose the connection <kar@webline.dk>
Re: Beginner-friendly group as cultural adaptation? <nospam.newton@gmx.net>
Re: beginner-redirect and download <hiller@email.com>
Re: Conversion Question?? (elephant)
Re: Conversion Question?? (Larry Rosler)
Re: converting net address... (Bart Lateur)
Re: ebcdic packed numbers (Anno Siegel)
Re: Getting Height and Width of GIF/JPEG in PERL? <nospam.newton@gmx.net>
Re: Help or possibly stupid syntax suggestion re: forea (Larry Rosler)
Re: How I can read to a script output frome an other on (Tad McClellan)
Re: Korn Shell or Perl? (Ken Pizzini)
Re: Korn Shell or Perl? (brian d foy)
Re: newby rename problem (help) (Tad McClellan)
Re: Orwant book status? (was Re: stopping email) (Larry Rosler)
Re: Pass by value or pass by reference? (Andrew Johnson)
Re: Pass by value or pass by reference? (Neko)
Re: Pass by value or pass by reference? <uri@sysarch.com>
Problem with spam in this group <thomas@bibsyst.no>
Re: Problem with spam in this group <uri@sysarch.com>
R: How I can read to a script output frome an other one <claudio@elettrodata.it>
Re: reg expression (Anno Siegel)
Re: Selecting files by permisions (Abigail)
splitting an array - well not really but ... (Eric Smith)
Re: stopping email overflow on failure <gellyfish@gellyfish.com>
Using perl with another language? <hart@rohan.sdsu.edu>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Jul 1999 07:52:18 +0200
From: Kaare Rasmussen <kar@webline.dk>
Subject: _Don't_ loose the connection
Message-Id: <379E9A92.61F01D9C@webline.dk>
The problem: I'm planning a program that is supposed to use a browser as
the client. This means it will run through a web server of course. It
a) uses a database. I don't want to open and close the database all the
time
b) builds a lot of objects. I don't want to rebuild them all the time
An example: First screen asks for a customer number. Program finds all
the customer data and displays the relevant portions. The user enters
new information and corrections and then the program updates the
database. This is all normal stuff except that I want to do it through a
web server (I'm not sure if I'll use CGI or maybe some embedded Perl or
maybe both).
To solve this I can only think of letting the program run as a server
and then let a CGI call it for every screen.
Am I right, or does another and better way exist?
If I'm right, has anybody some clues to solve some of the problems:
1. How do I inteface; will I use sockets or another technology?
2. How can the server talk with several CGI scripts at the same time?
3. More questions I didn't even think of yet...
PS I think this is the correct group for these questions. If I'm wrong,
please tell me a more appropriate group.
-----------== 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: Wed, 28 Jul 1999 08:13:04 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <379E9F70.BB0E0AD6@gmx.net>
Dennis M. Parrott wrote:
>
> rather than creating a specific 'newbies' group, maybe the way to
> cut down the volume is to create a group dedicated to "web programming
> and/or CGI using Perl...". It seems that the naive posters who get
> the hardest noggin thumps are the ones who come draggin' their poor
> bedraggled attempts at reasonable Perl CGI scripts.
German Perl Usenetters, for want of a better term, did just that:
someone proposed a de.comp.lang.perl.cgi newsgroup. There was much
discussion on de.admin.news.groups (IIRC) about the merits of this
suggestion, and whether it should instead go under
de.comm.infosystems.www.authoring.cgi, but finally (again, IIRC) the
consensus was reached that it was desirable to set up such a "Perl/CGI"
group. de.comp.lang.perl turned into de.comp.lang.perl.misc and
de.comp.lang.perl.cgi was set up. Nothing stops anyone from posting an
RfD here. (Although the discussion will likely be as long as for the
German group -- it took quite a few week to settle on an answer.)
This is all from memory. German-speaking people can have a look at the
archives of de.admin.news.groups on DejaNews round about May or so.
Cheers,
Philip
------------------------------
Date: Wed, 28 Jul 1999 05:18:48 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: beginner-redirect and download
Message-Id: <379E92C1.E02EC4DF@email.com>
Paul Huckstepp wrote:
>
> Is it possible to tell a browser to download a file and redirect the browser
> to another URL, or in failing that, open a new window that prompts the
> download and send the original window to a new URL?
Probably. Try JavaScript (news://comp.lang.javascript); I don't think
Perl is what you're looking for.
HTH
Jordan
------------------------------
Date: Wed, 28 Jul 1999 16:55:27 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Conversion Question??
Message-Id: <MPG.1209546cbdb9e09b989b98@news-server>
Ivan Berg writes ..
>Looks like I am probably making simple mistake(read: dumbass) since I am new
>to perl.
ok .. sarcasm toned down ever so slightly for this post (although you do
make that difficult)
>I don't see how these examples work? The sub bintodec is not a
>function(e.g. it doesn't return a value).
you MUST be new to perl .. try the following code and then read perlsub -
especially the line that says "The return value of the subroutine is the
value of the last expression evaluated."
sub blah { 5; }
print blah(), "\n";
> Where would you include number who
>would want to convert? In other words, example with syntax is needed.
this question is really 'legs-in-air-scratch-my-belly-please' now isn't
it .. did you try the almost too obvious to mention ??
bintodec( '0110101');
when you're reeling at what can be discovered by such simple
experimentation you may want to look at the 'shift' function in perlfunc
for how bintodec gets your argument
--
jason - remove all hyphens for email reply -
------------------------------
Date: Wed, 28 Jul 1999 00:40:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Conversion Question??
Message-Id: <MPG.120853c4b5b9a43e989d5e@nntp.hpl.hp.com>
In article <7nm1dv$pch$1@news.campuscwix.net> on Tue, 27 Jul 1999
22:36:22 -0600, Ivan Berg <iberg@montana.edu> says...
> Thanks for the sarcastic reply :)
Judging by this letter, perhaps more courteous than necessary.
> Looks like I am probably making simple mistake(read: dumbass) since I am new
> to perl.
One big mistake is quoting the entire post you are responding to *after*
your response. This is both dumb and lazy, because that is the way your
dumb so-called 'newsreader'
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
sets it up, and you didn't do anything about it.
> I don't see how these examples work? The sub bintodec is not a
> function(e.g. it doesn't return a value). Where would you include number who
> would want to convert? In other words, example with syntax is needed.
You should look at perlsub to understand how Perl subroutines work. In
this case (quoted WAY DOWN BELOW HERE), 'shift' retrieves the argument,
and the return value is the value of the last expression evaluated.
> And this peice of code from the faq doesn't seem to work:
> $decimal = pack('B8', '10110110'); -doesn't return
> correct decimal
The scalar is one byte, whose value is the decimal value as a character.
Use the ord() function to retrieve the numerical value. I think the FAQ
is less than clear on this.
> $binary_string = join('', unpack('B*', "\x29")); -where does
> integer go??
Once again, it is the ord() value of "\x29". Or chr(0x29).
> I am using a standard 'print $variable' to view the results, is there
> something with the print command?? Needs some options??
No. No. But s?printf might be useful. That has all the options you
want.
> ----- Original Message -----
<LONG SNIP>
Oh, here it is, finally:
> > sub bintodec {
> > unpack("N", pack("B32", substr("0" x 32 . shift, -32)));
> > }
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 28 Jul 1999 07:39:33 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: converting net address...
Message-Id: <37a4b364.4440411@news.skynet.be>
Abigail wrote:
>?? Possible links in the text above would be:
>?? www.gemal.dk
>
>Really? If that's a possible link (using what scheme?) then anything
>containing letters, digits, periods and hyphens would be a link, right?
If it starts with "www.", and for the rest is formatted like an URL,
yes. A heuristic rule, rather than a formal one.
Bart.
------------------------------
Date: 28 Jul 1999 07:43:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: ebcdic packed numbers
Message-Id: <7nmcai$ae7$1@lublin.zrz.tu-berlin.de>
John G Dobnick <jgd@alpha3.csd.uwm.edu> wrote in comp.lang.perl.misc:
>From article <7nkp7t$9jm$1@lublin.zrz.tu-berlin.de>, by anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
>> Norman Frech <frech@primary.net> wrote in comp.lang.perl.misc:
>>>I have a ebcdic to ascii converter that works well on everything but packed
>>>numbers (signed and unsigned). Does anyone have a tip or code that converts
>>>this field type?
>>
>> I don't think ebcdic specifies anything like "packed numbers". It's
>> a byte to character encoding, much like ascii, only sillier. Explain
>> the data you want to convert a bit more.
>
>
> "Packed" numbers (which I presume really means "packed decimal" numbers)
> are not EBCDIC, ASCII, or any other character code. They are
> binary coded decimal digits arranged in a specific manner.
Yup. That's what I guessed he meant. No wonder ebcdic -> ascii
didn't work on those.
Anno
[snip explanation of BCD data]
------------------------------
Date: Wed, 28 Jul 1999 08:05:09 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <379E9D95.89313F07@gmx.net>
Eric The Read wrote:
>
> lr@hpl.hp.com (Larry Rosler) writes:
> > Does C have an Image::Size module?
>
> You can link against libMagick from the ImageMagick distribution; that
> amounts to the same thing, I'd say.
Except for the fact that, for C, there's no such well-known "central
repository" as CPAN for Perl. There's probably libraries for just about
everything known to man (and of all sorts of qualities), but no
semi-official resting place of Useful Tools.
Cheers,
Philip
------------------------------
Date: Wed, 28 Jul 1999 00:09:34 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help or possibly stupid syntax suggestion re: foreach
Message-Id: <MPG.12084c79a41b3f6989d5d@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <x7aeshtofx.fsf@home.sysarch.com> on 27 Jul 1999 23:58:58 -
0400, Uri Guttman <uri@sysarch.com> says...
+ >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
+
+ LR> If you want to avoid copying the original array, then:
+
+ LR> for (my $i = 0; $i < @list; $i += 2) {
+ LR> my ($a, $b) = @list[$i, $i + 1];
+ LR> ...
+ LR> }
+
+ hey, i like that one even though i despise using index variables in
+ perl.
+
+ LR> I'll let you worry about an array with an odd number of
+ elements.
+
+ i have to worry about it too!
+
+ either fail it or push undef or '' onto it could work.
As written the code will return undef for $b, so why bother pushing
that?
+ LR> Or, relying on order of evaluation (as I was brought up *not*
+ to):
+
+ LR> for (my $i = 0; $i < @list; ) {
+ LR> my ($a, $b) = @list[$i++, $i++];
+ LR> ...
+ LR> }
+
+ yechhh!!! double side effects which depends on evaluation ordering.
+ and perl doesn't define evaluation ordering in all places.
Well, list evaluation happens to be one of them. (But, as we discovered
a while ago, the evaluation may be down to a ref to the value, which can
cause surprises when that then gets passed to a subroutine.)
NB: I said I was brought up (in C) not to do this sort of thing anyhow.
But it works.
+ LR> 'Elegance' is in the eye of the beholder.
+
+ then you must be blind in your other eye.
+
+ :-)
Neither of the eyes was mine.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 27 Jul 1999 21:19:31 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How I can read to a script output frome an other one ?
Message-Id: <3rlln7.hqm.ln@magna.metronet.com>
Claudio Villa Santa (claudio@ed-it.net) wrote:
: I need to run a script (named A) that call an other one script (named B),
: and I need to read with A script B output.
: Some one can tell me an little example ?
If the output from B is not too large, you can put it all
into memory:
my $B_output = qx/B/;
Or, you might what to process it line-by-line:
open(B, 'B |') || die "could not fork $!";
while (<B>) {
# do something with the line in $_
}
close(B) || die "problem running B program $!";
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 28 Jul 1999 05:05:19 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: Korn Shell or Perl?
Message-Id: <slrn7pt25f.66q.ken@pulsar.halcyon.com>
On 27 Jul 1999 19:28:47 GMT, Donn Cave <donn@u.washington.edu> wrote:
>|> push( @yp_data, keys %::beeper_byname ) && next
>|> if $source eq 'local'
...
> What's with the "if $source eq 'local'"? Does it go with something?
It goes with the expression preceeding it. It could also have
been written as:
if ($source eq 'local') {
push( @yp_data, keys %::beeper_byname ) && next;
}
--Ken Pizzini
------------------------------
Date: Wed, 28 Jul 1999 03:41:26 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Korn Shell or Perl?
Message-Id: <brian-ya02408000R2807990341260001@news.panix.com>
In article <7nlcq8$g33$1@news.ml.com>, mwang@tech.cicg.ml.com (Michael Wang) posted:
> what I did and Randal did are different. I would think if
> keys(%::beeper_byname) or `ypcat -k beeper.byname` are large enough
> and exceed the system memory, my "awkard" code will survive, and Randal's
> better code will break.
why do you think that? you use both of those constructs in your code,
so you run out of memory as well. if you expect that hash to be large,
you probably want it in a DBM file, but then you need to iterate through
with something like each() perhaps.
> Is the following Randal's code awkard?
> select((slect(SOCK),$|=1)[0])
> Well it is,
why do you think that is awkward? it's not as if there are any acrobatics
going on there. don't confuse your lack of experience with what you
call "awkward".
you don't have to use Perl if you don't like it, but if you do use
Perl, you should at least try to program in Perl rather than make
Perl fit into your ideas about some other language.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Tue, 27 Jul 1999 21:15:42 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: newby rename problem (help)
Message-Id: <ujlln7.hqm.ln@magna.metronet.com>
David Cassell (cassell@mail.cor.epa.gov) wrote:
: [2] if you want to keep the old name, you *have* it - it's
: %cgi_cfn{'upload'} and you can save it somewhere
^^^^^^^^^^^^^^^^^^
$cgi_cfn{'upload'} # typo, I'm sure.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 27 Jul 1999 23:42:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Orwant book status? (was Re: stopping email)
Message-Id: <MPG.12084613d24e2947989d5c@nntp.hpl.hp.com>
In article <x7iu75tqe8.fsf@home.sysarch.com> on 27 Jul 1999 23:16:47 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
...
> LR> The Bighorn Sheep sold out handily last year.
>
> actually they gave that away as the freebie book. extras probably sold
> out at their store. but i bet they print up many more and it should be
> available in the usual outlets in sept. i hope this is the freebie we
> get this year!
Heck, no. The freebie last year was that little, nominally $5, Perl
reference guide. I paid solid (HP) cash for the Ram, when they dragged
a second batch in late in the week.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 28 Jul 1999 06:03:24 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Pass by value or pass by reference?
Message-Id: <M2xn3.395$K%6.19848@news1.rdc2.on.home.com>
In article <x76735tnim.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
[snip]
! it. remember in calling a perl sub, the arguments are passed as one long
! list and all arrays and hashes are unraveled thereby making them call by
! value. whereas scalar args are aliased in @_ so they are passed by
! reference.
Am I reading you wrong? Because it sounds like you are trying to say
that the elements of an array (say, @list) passed to a sub are not
aliased in @_ ?
#!/usr/bin/perl -w
use strict;
sub blah { $_[2] = 42 }
my @list = (1,2,3,4);
blah(@list);
print "@list\n"; # 1 2 42 4
regards
andrew
------------------------------
Date: 28 Jul 1999 06:11:38 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Pass by value or pass by reference?
Message-Id: <7nm6uq$lhv$0@216.39.141.200>
On 28 Jul 1999 00:18:57 -0400, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "CY" == Carfield Yim <c8133594@comp.polyu.edu.hk> writes:
>
> CY> I get it, in perl it is similar to java, object and array (something
> CY> large in memory) is pass by reference, and varible is pass by value?
>
>no. in fact it is usually the reverse. read perlsub some more to get
>it. remember in calling a perl sub, the arguments are passed as one long
>list and all arrays and hashes are unraveled thereby making them call by
>value.
Array and hash elements are still aliased though. Neither aggregates nor
elements are passed by value.
@array = qw[moogle+stuffy chocolate+fudge milk+cookies];
sub { tr/+/ / for @_ }->(@array);
print join ', ', @array;
moogle stuffy, chocolate fudge, milk cookies
>whereas scalar args are aliased in @_ so they are passed by
>reference. and most subs assign @_ to my vars which makes it call by
>value again.
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: 28 Jul 1999 03:14:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Pass by value or pass by reference?
Message-Id: <x73dy9tfdc.fsf@home.sysarch.com>
>>>>> "N" == Neko <tgy@chocobo.org> writes:
N> Array and hash elements are still aliased though. Neither aggregates nor
N> elements are passed by value.
i seem to be wrong about arrays but hashes are passed by value as that
makes no sense otherwise.
perl -le '@a=(1,2);@b=(3,4);sub{ $_++ for @_}->(@a,@b);print @a,@b'
2345
perl -le '%a=(1,2);@b=(3,4);sub{ $_++ for @_}->(%a,@b);print %a,@b'
1245
somewhere i recall there was something about arrays not being aliased
in some circumstances. my memory needs jogging.
in any case, passing in an array and processing its elements by
reference to modify them is usually not clear code and is probably
better done by passing in a ref to the array and then modifying the
elements.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Wed, 28 Jul 1999 09:08:56 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: Problem with spam in this group
Message-Id: <379EAC88.8292659D@bibsyst.no>
hi,
Are anybody else being bombed with spam-mail? The group itself seem to
have a problem with people advertizing adult-sites, but I now get up to
ten-fifteen emails aday ranging from sleazy porn-adds to
"how-to-fix-anything-in-your-life-for-just-a-little-bit-of-money" etc.
It`s very annoying. I know this isn`t exactly perl, but I only
participate daily in this group and was wondering if anybody else is
having the same problems? Is somebody using email-addresses from this
group to spam us?
If so, is there anything we could do to stop this?
Thomas Weholt
------------------------------
Date: 28 Jul 1999 03:22:23 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Problem with spam in this group
Message-Id: <x7zp0hs0gg.fsf@home.sysarch.com>
>>>>> "TW" == Thomas Weholt <thomas@bibsyst.no> writes:
TW> Are anybody else being bombed with spam-mail? The group itself
TW> seem to have a problem with people advertizing adult-sites, but I
TW> now get up to ten-fifteen emails aday ranging from sleazy
TW> porn-adds to
TW> "how-to-fix-anything-in-your-life-for-just-a-little-bit-of-money"
TW> etc. It`s very annoying. I know this isn`t exactly perl, but I
TW> only participate daily in this group and was wondering if anybody
TW> else is having the same problems? Is somebody using
TW> email-addresses from this group to spam us?
have i got a web site for you!!
http://www.perlporn.com/newbies/breastfeeding.html
:-)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Wed, 28 Jul 1999 09:50:38 +0200
From: "Claudio Villa Santa" <claudio@elettrodata.it>
Subject: R: How I can read to a script output frome an other one ?
Message-Id: <7nmcnl$bvb$1@ffx2nh5.news.uu.net>
Thank You
I tried but script A recived nothing.
Part of Script A:
open(PIPPO, "categorie.cgi |");
while (<PIPPO>) {
$riga=$riga . $_;
}
close (PIPPO);
SciptB:
#!/usr/bin/perl
push(@INC, "/cgi-bin");
require("cgi-lib.pl");
&ReadParse(*input);
print &PrintHeader;
print <<"print_tag";
<HTML>
<HEAD>
<TITLE>Prova</TITLE>
</HEAD>
<BODY bgcolor=#ffffff link=#000000 text=#000000 vlink=#000000 alink=#000000>
<center>
Start:<br>
End.<br>
</center>
</BODY>
</HTML>
print_tag
Thank's
Claudio
Tad McClellan <tadmc@metronet.com> wrote in message
3rlln7.hqm.ln@magna.metronet.com...
> Claudio Villa Santa (claudio@ed-it.net) wrote:
>
> : I need to run a script (named A) that call an other one script (named
B),
> : and I need to read with A script B output.
>
> : Some one can tell me an little example ?
>
>
> If the output from B is not too large, you can put it all
> into memory:
>
> my $B_output = qx/B/;
>
>
> Or, you might what to process it line-by-line:
>
> open(B, 'B |') || die "could not fork $!";
> while (<B>) {
> # do something with the line in $_
> }
> close(B) || die "problem running B program $!";
>
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: 28 Jul 1999 07:37:18 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: reg expression
Message-Id: <7nmbve$acm$1@lublin.zrz.tu-berlin.de>
llornkcor <llornkcor@llornkcor.com> wrote in comp.lang.perl.misc:
>My point is this:
>If she is tired of answering stupid questions that may be answered in
>the FAQ's, than why does she even bother to post any kind of message
>at ALL, especially when it is degrading the poster. Just adding more
>useless drivel to the group like this thread is doing.
It's been explained more than once these last days: If we let
inappropriate questions go by unchallenged, newbies will not learn
what is appropriate and what is not, so we'll get more of them.
Simple? Simple.
Anno
------------------------------
Date: 28 Jul 1999 00:15:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Selecting files by permisions
Message-Id: <slrn7pt4f1.3hu.abigail@alexandra.delanet.com>
Uri Guttman (uri@sysarch.com) wrote on MMCLVII September MCMXCIII in
<URL:news:x7g129tpl3.fsf@home.sysarch.com>:
'' >>>>> "A" == Abigail <abigail@delanet.com> writes:
''
''
'' A> This won't work because (stat $file) [2] returns more than the permission
'' A> bits - just as the manual say. Do something like:
''
'' A> unless (((stat $file) [2] & 07644) == 00644) { ... }
''
'' A> Or, if you don't care about suid, gid and sticky bits:
''
'' A> unless (((stat $file) [2] & 0644) == 0644) { ... }
''
'' A> Personally, I would just do a 'chmod 644 *' in the directory.
''
'' for all you abigail hate club members, note the polite and accurate
'' followup to a posting with a obvious newbie mistake
Actually, I just realize my answer was wrong. It should be:
unless (((stat $file) [2] & 07777) == 00644) { ... }
And leave off one 7 if you don't care about suid, gid or sticky bits.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== 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: 28 Jul 1999 07:35:07 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: splitting an array - well not really but ...
Message-Id: <slrn7ptclq.28u.eric@plum.fruitcom.com>
Hi
I would like to take an array like say @ARGV and instead of having each
token (if the arguments) as an array element, I would like to have each
group of tokens a an element in the top level array. After that I wish to
take the group and split that on white space to form an array of arrays
thusly.
command.pl john m smi, pete MBchB school, mike west high
@first= qw(john m smi)
@second= qw(pete MBchB school)
@third= qw(mike west high)
@top=(@first, @second, @third)
How do I best process the @ARGV to return the above?
It seems you cannot use `split' on the comma for an array.
--
Eric Smith
eric@fruitcom.com
www.fruitcom.com
The three Rs of Microsoft support: Retry, Reboot, Reinstall.
------------------------------
Date: 28 Jul 1999 09:02:40 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: stopping email overflow on failure
Message-Id: <379eb920@newsread3.dircon.co.uk>
I R A Darth Aggie <fl_aggie@thepentagon.com> wrote:
> On 27 Jul 1999 11:39:46 -0400, Jason Reed <jcreed@cyclone.jprc.com>, in
> <a1pv1ep0e5.fsf@cyclone.jprc.com> wrote:
> + fl_aggie@thepentagon.com (I R A Darth Aggie) writes:
> +
> + > + perhaps the Schrodinger::Fish module would be more
> + > + instructive as it seems the original poster is intent
> + > + on not opening the box.
> + >
> + > Good point, but wouldn't that conflict with the Schrodinger::Cat
> + > module?
> +
> + Oh, is that project still being worked on? I thought it died.
>
> Until you open up the box, you won't know.
>
But you're not supposed to open up the box you're supposed to use th interface
described in the documentation for the Module.
/J\
--
"While they're pumping, you're soaking them" - Speed Loader TV Advert
------------------------------
Date: Tue, 27 Jul 1999 23:23:25 -0700
From: George hart <hart@rohan.sdsu.edu>
Subject: Using perl with another language?
Message-Id: <379EA1DD.522247E4@rohan.sdsu.edu>
Hi
I am a beginning programmer who would like some advice using perl
combined with other languages. Right now I have a project in C that
deals with some heavy text manipulation which is easy in Perl but a
disaster in C. I am tempted to do a few system calls to Perl in my C
program but I cannot help to wonder: (1) is this considered good
programming? (2) Are there serious perfomance issues? (3) Is there a
standard way to intermix programming languages?
Any advice would be great.
Thanks,
George Hart
hart@rohan.sdsu.edu
San Diego
------------------------------
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". 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 V9 Issue 280
*************************************