[12983] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 393 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 23:07:20 1999

Date: Thu, 5 Aug 1999 20: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           Thu, 5 Aug 1999     Volume: 9 Number: 393

Today's topics:
    Re: AIX fork() / exec() waiting for child process (Charles DeRykus)
    Re: chroot mod_perl install programs (elephant)
    Re: Complex Extract HTML (LWP does not work) (brian d foy)
    Re: Denver Perl Mongers August Meeting (Abigail)
    Re: Expect.pm usage trouble (Charles DeRykus)
    Re: FAQ doesn't work in this case! (Martien Verbruggen)
    Re: how can I write an e-mail in an perl prg? <tchrist@mox.perl.com>
    Re: how do I count number of \n in a string? (Martien Verbruggen)
    Re: how do I count number of \n in a string? (Abigail)
    Re: How do I open another browser window using Perl? (Abigail)
    Re: how to add module? (Abigail)
    Re: Interesting database manipulation problem (Abigail)
    Re: Is there any way to get user name (Abigail)
        MATCH CASES AND PRINT TO A FILE (CLTCEvans)
    Re: Nastiness contrary to the spirit of perl? (elephant)
        NE Deprecated? <james.p.williams@usahq.unitedspacealliance.com>
    Re: NE Deprecated? <tchrist@mox.perl.com>
    Re: Need some PERL/CGI thinkers please! (Abigail)
    Re: newbie question: splitting hairs <kangas@anlon.com>
    Re: NT Apache Perl <kperrier@blkbox.com>
    Re: Perl & Win95 (Abigail)
    Re: Perl is Not Opening a file (elephant)
    Re: perl port to windows CE ? (David Cantrell)
    Re: Perl/CGI problem: Getting Web Documents from within <dnor@NOSPAMhiline.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 6 Aug 1999 01:52:17 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: AIX fork() / exec() waiting for child process
Message-Id: <FG0t75.591@news.boeing.com>

In article <jzfq3.1621$001.781441@WReNphoon3>,
Gerard Zavislak <Gerard.zavislak@prudential.com> wrote:
>I have a PERL script (parent) which kicks off other PERL scripts (children)
>using fork() / exec() on AIX 4.2.1.  There is code in the parent PERL script
>to trap the signals from the children so no zombies (defunct processes) are
>created.  The problem occuring is that sometimes the parent process is
>waiting for one child to finish before a fork() / exec of another child
>process is done (this usually occurs with a long running child process).
>The code used to trap the child signal is:
>$SIG{ CHLD } = \&REAPER;
>
>sub REAPER
>{
>   $SIG{ CHLD } = \&REAPER;
>
>   my( $child ) = 0;
>
>   $child = wait;
>}
>
>Any ideas on how to trap the child signal without having the parent process
>wait for extended periods?


The C<waitpid> docs explain how to do a non-blocking wait.
perldoc -f waitpid. 


hth,
--
Charles DeRykus




------------------------------

Date: Fri, 6 Aug 1999 11:21:29 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: chroot mod_perl install programs
Message-Id: <MPG.1214e3a059f94f1a989bee@news-server>

cahkt-netepbyr writes ..
>I'm having serious problems getting Apache to compile with mod_perl.
>
>** A test compilation with your Makefile configuration
>** failed. This is most likely because your C compiler
>** is not ANSI. Apache requires an ANSI C Compiler, such
>** as gcc. The above error message from your compiler
>** will also provide a clue.

I think the problem may lie somewhere in the above comment - whadya 
reckon

> Aborting!
  ^^^^^^^^^

another clue !!

>Checking CGI.pm VERSION..........ok
>Checking for LWP::UserAgent......failed

these are the tests .. your make was run something like this...

  make test install

instead you should do

  make

and then

  make test

and then

  make install

but it would never have got past the first step because of your non-ANSI 
C compiler

NOTHING was built .. so obviously the tests are going to fail

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: Thu, 05 Aug 1999 21:58:14 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Complex Extract HTML (LWP does not work)
Message-Id: <brian-0508992158430001@1cust161.tnt4.durham.nc.da.uu.net>

In article <7oca88$e9k$1@nnrp1.deja.com>, inlandpac@my-deja.com wrote:

>After trying HTML::Parser and after trying all long-winded scripting
>techniques I could think of to remove HTML tags, I have still come up
>short of success.

you're probably missing something in the way that you are trying to
use HTML::Parser.  however, none of your three posts on this contain
a code snippet or a good description of the problem.  it's hard to 
help under those conditions.

>Can anyone give more assistance in this?  In this case, I would like to
>avoid having to use HTML::Parser and would like to go about it the long
>way.

if you want to spin your wheels, you'll need to do it without having
to ask questions.

-- 
brian d foy


------------------------------

Date: 5 Aug 1999 20:41:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Denver Perl Mongers August Meeting
Message-Id: <slrn7qkf7v.uij.abigail@alexandra.delanet.com>

Chris Fedde (cfedde@fedde.littleton.co.us) wrote on MMCLXIV September
MCMXCIII in <URL:news:bh3q3.4964$Pt1.1849@wormhole.dimensional.com>:
~~ 
~~     This time we are meeting in south Denver (Parker?):
~~ 
~~            Monday, August 16, 6:30pm


Oh dear. I'm already sceduled to talk for the Philly Mongers that evening.

I won't think I will be able to make it.


Abigail
-- 
Is a global Usenet group really appropriate for announcing local events?


  -----------== 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: Fri, 6 Aug 1999 01:04:55 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Expect.pm usage trouble
Message-Id: <FG0r07.3Ez@news.boeing.com>

In article <37A98060.7C347F9B@somewhere.in.time>,
dannn  <dannn@somewhere.in.time> wrote:
>###################
>use Expect;
>my $REF;
>my $time = 30;
>
>$REF = Expect->spawn("passwd $login_name");
>$REF->expect($time, "New password: ");
>print($REF "$password\r");
>$REF->expect($time, "Re-enter new password: ");
>print($REF "$password\r");
>
>$REF->hard_close();
>###################


Try:  

$REF->soft_close();


hth,
--
Charles DeRykus


------------------------------

Date: Fri, 06 Aug 1999 01:24:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: FAQ doesn't work in this case!
Message-Id: <qPqq3.134$Qv2.6197@nsw.nnrp.telstra.net>

In article <7od2ra$21u$1@nnrp1.deja.com>,
	inlandpac@my-deja.com writes:
> <IMG SRC="/directory/directory.fds/image/somewhere/$somevar/file.gif"
> BORDER="0" WIDTH="47" HEIGHT="24" ALT="Search">

What's that $somevar doing there?

> The above HTML tag is not removed when using LWP's HTML::Parser and I
> cannot find a way to remove this type of tag through long-form
> scripting.

And why would it be removed? HTML::Parser doesn't remove anything.
Maybe you should show us the subclass of HTML::Parser that you wrote.

> Basically, I have a script that fetches URLs, reads in the text using
> LWP::UserAgent, removes all HTML and only displays the text (that would
> normally be visible to the viewer).

# lynx -dump URL

> I would like to challenge our Perl Gurus out there to come up with a
> pattern match to remove ALL HTML tags no matter how complex or how many
> elements/attributes there are (so only the text between the tags will
> be displayed).

No need for any perl Gurus. Perl Gurus probably aren't interested in
this problem. Perl Gurus aren't even interested in posts that have the
word 'guru' in it. 

Have you checked the FAQ?

# perldoc -q HTML
=head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq9.pod

=head2 How do I remove HTML from a string?

> I don't want to use HTML::Parser for this.

Well... You could consider using lynx then.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


------------------------------

Date: 5 Aug 1999 19:07:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how can I write an e-mail in an perl prg?
Message-Id: <37aa355d@cs.colorado.edu>

In comp.lang.perl.misc, mwang@tech.cicg.ml.com (Michael Wang) writes:
:I wonder why this often pops up in perl group, but there never a question
:"how do I send email in shell"? Thanks. 

You're not allowed to ask that question.  And God help you, if you do
ask it, no matter what you do, DON'T FRICKING ANSWER IT!  You aren't
allowed to ask why people are stupid.  You aren't allowed to ask why
people are ignorant.  You aren't allowed to ask why people are helpless.
And should you have the temerity to answer that question, the wrath of
Lord Doom the HTML Programmer shall descend upon you and your heirs unto
the seventh generation of those who fear packet storms.

--tom
-- 
Perl itself is usually pretty good about telling you what you shouldn't do. :-)
        --Larry Wall in <11091@jpl-devvax.JPL.NASA.GOV>


------------------------------

Date: Fri, 06 Aug 1999 01:47:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how do I count number of \n in a string?
Message-Id: <R8rq3.144$Qv2.6197@nsw.nnrp.telstra.net>

In article <37A9F5BD.432BE467@tellabs.com>,
	Russell Zah <russell.zah@tellabs.com> writes:
> Hi,
> 
> I have a variable that absorbed the output of a shell program. The
> output was a list of names. So
> 
> $info ="name1\n
>             name2\n
>             name3\n
>             name4\n
>             name5\n
>             name6\n
>             name7"

Ok, this becomes something with 12 newlines in it. Is that really what
came out of the program, or are you just trying to 'emulate' its
output? I will assume the latter, and will assume the string
"name1\nname2\nname3\nname4\nname5\nname6\nname7" to be the output of
your program.

> Is there a way to calculate the number of lines here?

First you need to define lines. Normally lines are terminated by a
newline, but your output seems to contain something non-standard at
the end.

If you consider The above to be 6 lines:
my $nl = $info =~ tr/\n//;

If you consider the above to be 7 lines:
my $nl = split/\n/, $info;
(to silence warnings:
my $nl = @{[split/\n/, $info]};
)

>                                                       For perl it is one
> unique line but I want it to consider this as 7 lines. I tried

For perl this is a single _string_, not a single line. They're not the
same beast.

If you get this output from the program with backticks or qx(), you
might consider doing something like:

my @info = qx/$program/;

So that your lines are split into an array. Or even use a while loop.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd.       | crops where there ain't no crops.
NSW, Australia                      | 


------------------------------

Date: 5 Aug 1999 20:58:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how do I count number of \n in a string?
Message-Id: <slrn7qkg83.uij.abigail@alexandra.delanet.com>

Russell Zah (russell.zah@tellabs.com) wrote on MMCLXV September MCMXCIII
in <URL:news:37A9F5BD.432BE467@tellabs.com>:
[] 
[] $info ="name1\n
[]             name2\n
[]             name3\n
[]             name4\n
[]             name5\n
[]             name6\n
[]             name7"
[] 
[] Is there a way to calculate the number of lines here? For perl it is one
[] unique line but I want it to consider this as 7 lines. I tried
[] 
[] while ($info =~ /\n\d+/g)
[] { $count++ }
[] 
[] and added 'm' and 's' after /g but that didn't help either.
[] They all returned 0 for $count.


Well, yes. You never have a digit following a newline, so there's no
match. Just count newlines. Except if the last line ends with a newline.
(Unless you want to count one extra). This counts the number of lines:

    $count = 1 + substr ($info, 0, -1) =~ y/\n//;


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: 5 Aug 1999 21:00:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do I open another browser window using Perl?
Message-Id: <slrn7qkgc4.uij.abigail@alexandra.delanet.com>

DC (church@NOSPAMspinn.net) wrote on MMCLXV September MCMXCIII in
<URL:news:7obcgb$iq5$1@news.gstis.net>:
"" I want to display a URL in another browser window and then be able to switch
"" back to my original browser window where my Perl/CGI script is running.  Is
"" it a simple print " line of code that ends up being HTML code after all?


Perhaps, but that's beyond the scope of this group. If you manage to
find the mystical HTML that does your trick, use print() to print it.


HTH. HAND.


Abigail
-- 
You owe me the URL of your site, so I can blacklist it.


  -----------== 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: 5 Aug 1999 21:02:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to add module?
Message-Id: <slrn7qkgfm.uij.abigail@alexandra.delanet.com>

gem (yangch@meena.cc.uregina.ca) wrote on MMCLXV September MCMXCIII in
<URL:news:7oavgv$k5t$1@sue.cc.uregina.ca>:
[] 
[] I am using a perl version 5.003. There is no IO package installed. How can I 
[] add it in my system? I am working under a UNIX system.


RTFFAQ.


Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


  -----------== 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: 5 Aug 1999 21:28:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Interesting database manipulation problem
Message-Id: <slrn7qki0s.uij.abigail@alexandra.delanet.com>

Paul Gillingwater (P.Gillingwater@iaea.org) wrote on MMCLXV September
MCMXCIII in <URL:news:37A9A50B.CBE528F6@iaea.org>:
!! 
!! The question is: given that there is some overlap, i.e., some people do
!! the same jobs as other people, create a report that lists the areas of
!! greatest overlap, i.e., a set of jobs and people in common with the
!! greatest number of jobs in common.  Now do it again, for one less job.
!! Then again, until no more than 5 jobs are in common.

Uhm, why not do it in SQL?

(And ask in an SQL group for the how)



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== 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: 5 Aug 1999 21:31:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is there any way to get user name
Message-Id: <slrn7qki6t.uij.abigail@alexandra.delanet.com>

Tanvada Jagannadha (jaganna@shell.one.net) wrote on MMCLXV September
MCMXCIII in <URL:news:37a9ada9@news1.one.net>:
[]   is there anyway we could get the user information along with the
[] environmental variables? I mean the login name. If not with env variables,
[] is there any command like unix 'w/who' so that we could get the login
[] name. Thanks in advance.


Yes. It's in the manual, under get*.


Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== 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: 06 Aug 1999 02:17:53 GMT
From: cltcevans@aol.com (CLTCEvans)
Subject: MATCH CASES AND PRINT TO A FILE
Message-Id: <19990805221753.18406.00006057@ng-cp1.aol.com>

please help, i am a beginner.  i want to use perl to match cases and print true
results in a file.  how would i do that...here is what i have now:


#!/usr/local/bin/perl -w
open(FILE "/path/file");
while(<FILE>) {
        if(/match_this_expression/) {
                what do i need here to print matched cases to another
file?;
        }
}


------------------------------

Date: Fri, 6 Aug 1999 11:51:31 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <MPG.1214eaaf78631303989bef@news-server>

why@invite.spam writes ..
>On Fri, 6 Aug 1999 09:49:38 +1000, elephant@squirrelgroup.com
>(elephant) wrote:
>
>>so who's side are you on .. you say that this group is intolerant .. but 
>>at the same time those who find it intolerant should just switch off ?
>
>I am suggesting that individuals take less offense to the constant
>presence of the "technically challenged." They are everywhere in our
>world. Most of us work with, and for, them. 

if people are taking offense to the lusers (sorry - I'm not as 
politically correct as you) when they respond with the less-than-polite 
attitude .. then you're right - they should chill out

but I don't think that's the case .. I think you'll find that at the 
other end of what appears to be frustrated indignation you'll find an 
amused old-timer just trying to make a point .. it is true of me - and I 
hope of most others - that we are NOT what we post

>                                         Flaming them only gives me
>high blood pressure, and gives the group (c.l.p.m. or Information
>Services) a bad image by association. 

if your blood pressure rises .. then certainly you should avoid flaming 
them .. for me - it makes me laugh .. both flaming them and reading other 
flames .. and usually - somewhere in there (sometimes well hidden) there 
is useful advice amongst the flames

regarding the "bad image" .. phht .. who cares .. we're not here for a 
beauty contest .. and if it discourages people from posting "how do I 
remove all space characters from a string" questions .. even discourages 
one a week .. then it's worthwhile

>                                     I found the language, and it's
>culture appealing - through the myriad of books and supporting web
>pages available.

you don't see the irony here ? .. you found the culture appealing because 
of the prepared documentation that you read .. the same documentation 
that the hostile RTFMs are directing the infants to

>But for me, and obviously others, this newsgroup actually removes some
>of the joy that can come from (re)discovering what cooperative/open
>source computing can bring - a tool supported by a community, not a
>corporation with a profit/loss ratio. Other usenet groups have brought
>me some invaluable knowledge, just like this one, but without the
>agnst.

again .. I'm astounded at the irony .. essentially you seem to be saying 
that because you don't want to ignore articles that cause you angst you'd 
like others to ignore the luser posts and therefore stop posting

with all due respect - practise what you preach and switch off .. no one 
forces you to read .. the lusers are forced to read in the hope that 
someone has fed them a bone (which inevitably - someone keen on flexing 
their new found "\s" knowledge - albeit inappropriate - will do)

>Let me restate as a concept: Let the defective users drown (nature's
>way). Help those who deserve it - those who help themselves, to a
>reasonable degree. If you can't stand to hear the cries for help, plug
>your ears.

here's how I see it - we all do whatever we want .. lusers post .. some 
flame .. some help .. those who want to ignore ignore .. those who don't 
don't .. and people like you and I stop these stupid conversations that 
are completely off topic

>I am not suggesting anyone who has ability and knowledge leave because
>of the mindless ramble of the point-and-click types. But, geeze,
>relax! If nothing else, take some pleasure in watching idiots to
>stupid things. It is like watching COPS on TV. Most of the guest stars
>are morons, and I would hate to be their neighbors. But from a
>distance, their ignorance is somewhat amusing.

hold up a mirror .. you should relax about the flames as much as you 
would like others to relax about the luser posts .. then this 
conversation can end

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: Fri, 06 Aug 1999 01:11:40 GMT
From: Jim Williams <james.p.williams@usahq.unitedspacealliance.com>
Subject: NE Deprecated?
Message-Id: <7odco8$8eh$1@nnrp1.deja.com>

Why is NE deprecated?  I'm using it with other identifiers to declare
constants representing compass points.

use constant NW => 0;
use constant NE => 1;
use constant SW => 2;
use constant SE => 4;

The NE declaration gives me the following warning.

   Use of NE is deprecated at foo.pm line 2.

This is coming from toke.c which does the same for all string comparison
operators if they appear capitalized.  Why can't I use NE as a bareword?

I'm Perl 5.004_04, but just for another week.

TIA,

Jim Williams


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 5 Aug 1999 20:25:20 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: NE Deprecated?
Message-Id: <37aa4790@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Jim Williams <james.p.williams@usahq.unitedspacealliance.com> writes:
:Why is NE deprecated?  

Don't tell anybody I told you this, but that's the FORTRAN compatibility
mode.  Witness:

    % perl -le 'print "fred" NE "barney"'
    1

    % perl -le 'print "fred" EQ "fred"'
    1

    % perl -le 'print uc "fred" EQ "FRED"'
    1

--tom
-- 
"They that can give up essential liberty to obtain a little temporary safety 
 deserve neither liberty nor safety." 
				- Benjamin Franklin (1759)


------------------------------

Date: 5 Aug 1999 21:37:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need some PERL/CGI thinkers please!
Message-Id: <slrn7qkihu.uij.abigail@alexandra.delanet.com>

Kevin Alexander (kalexa2@_NOSPAM_mindspring.com) wrote on MMCLXV
September MCMXCIII in <URL:news:7ob7ff$hvl$1@nntp2.atl.mindspring.net>:
&& 
&& For example if I called the shtml page with a "test.shtml?test123" I'll get
&& a "BAD!!" for entry (there is no $ENV('QUERY_STRING') value set) and the
&& $ENV{'REMOTE_HOST') isn't set either.

Because the environment variables you refer to have to do with the CGI
protocol, and you aren't using CGI?



But since you don't have any Perl questions, consider asking followup
questions in a more appropriate group.



Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'


  -----------== 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, 05 Aug 1999 21:34:32 -0500
From: Mike <kangas@anlon.com>
Subject: Re: newbie question: splitting hairs
Message-Id: <37AA49B8.AFE6B72C@anlon.com>

The reason that $1, $2 are not set is because you are using a split function as
apposed to a reg.ex that uses pattern memory. For a basic example that will use $1
&& $2 in you example may look like.....

while(<LIST>) {
  $_ =~ /(\w+)\s+(\w+)\s+(\w+)/;

  print "The first match is $1\n";   # this will be 1, a, d
  print "The second match is $2\n"; # this will be 2, b, e
  print "The third match is $3\n";   # and this one will match 3, c, f
}

The term deprecated is that something newer has come along to replace it. Either
way I would personally stay with your first alternative because it will be more
readable to someone else who may need to use or read your code later.


Mike Kangas

Boris Klimovitsky wrote:

>         Hi,
>
>         I have a file of three columns of values.
>
>         1       2       3
>         a       b       c
>         d       e       f
>
>         etc.
>
>         I'd like to be able to get the values of the second and third columns
> and perform some tests on them. Rather, I have a working script that
> does this, but am a little confused. The script is as follows:
>
>         #!/usr/local/bin/perl -w
>
>         $file = "list";
>         open (LIST, $file) or die "Cannot open $file: $!";
>         while (<LIST>) {
>                 @line = split;
>                 print "$line[1], $line[2]\n";
>         }
>
>         My question is: since the split uses a reg.exp to parse $_ (namely,
> split(/\s+/,$_) )
>         why are $1, $2 ... $n not set?
>
>         Also, a second question:
>
>         would it be bad to have something like the following?
>
>         while (<LIST>) {
>                 split; print "$_[1], $_[2]\n";
>         }
>
>         when I tried this, I got a message that using split to @_ is
> deprecated... though it says on the split perlfunc page that split
> without any arguments implicitly puts the values in @_. Why am I being
> warned that the use is deprecated? And what should I use instead, to not
> generate those warnings?
>
>         Couldn't find anything with this on deja.com (though I didn't check all
> 1900 results that my search came back with)... sorry if it's a FAQ.

--
Michael Kangas
Anlon Systems, Inc.
kangas@anlon.com




------------------------------

Date: 05 Aug 1999 21:40:37 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: NT Apache Perl
Message-Id: <30D4208B414F94F8.D48A9749441B544C.8F1B6CEE2CC9450F@lp.airnews.net>

backwards.saerdna@srm.hc (Andreas Fehr) writes:

> 
> Did you read the whole thread?
> Should I send you the information found in the perlwin32faq6.html?
> 

Windoze doesn't understand the shbang line.  You have to "associate" an
extension with the the perl executable.

Kent


------------------------------

Date: 5 Aug 1999 21:42:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl & Win95
Message-Id: <slrn7qkisc.uij.abigail@alexandra.delanet.com>

Thomas Fvrtsch (thomas@dreamsister.de) wrote on MMCLXV September MCMXCIII
in <URL:news:ulaq3.13318$J5.148188@c01read02-admin.service.talkway.com>:
## What do I have to write exactly?


To write `exactly', you need to have one `a', one `c', one `e', one `l',
one `t', one `x' and one `y'.

I heard y's are on sale this week.


Abigail
-- 
$" = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%_ = (Just => another => Perl => Hacker); &{%_};


  -----------== 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: Fri, 6 Aug 1999 11:11:17 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Perl is Not Opening a file
Message-Id: <MPG.1214e13fbd3c9852989bed@news-server>

craig_davids@my-deja.com writes ..
>can't open datafile: No such file or directory at
>C:\Inetpub\wwwroot\~Kaf\secure\com_fin\data\read.cgi line 4.
>
>open(USER_DATA,"test.txt") || die("can't open datafile: $!");
                 ^^^^^^^^

the user that your CGI scripts are executed under (usually IUSER_<machine 
name> on NT) is not able to see your datafile .. either because the file 
doesn't exist or because IUSER_ doesn't have permission to see it

assuming you're using IIS then my guess is the latter .. especially if 
that's actually your code .. because you'll usually find that there's no 
read access in the CGI directory for the IUSER_ account to cover up the 
holes in IIS security

even if you're using another web server .. the cause and reason are most 
likely the same .. check those permissions .. use the help documentation 
for your web server

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: Wed, 04 Aug 1999 12:09:23 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: perl port to windows CE ?
Message-Id: <37a828d4.9214559@news.insnet.net>

On Fri, 30 Jul 1999 18:14:10 GMT, dtbaker_dejanews@my-deja.com said:

>the only scripting language that I can find running on CE is "REBOL".

There is also Python (www.digicool.com/~brian/PythonCE/index.html) and
Scheme (www.angrygraycat.com/scheme/pscheme.htm) as well as a few
Forths and BASICs.  I shall now go and wash my mouth out.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


------------------------------

Date: 5 Aug 1999 21:24:00 -0500
From: "99% Energy" <dnor@NOSPAMhiline.net>
Subject: Re: Perl/CGI problem: Getting Web Documents from within my CGI!
Message-Id: <fGrq3.12252$k8.449417@newscene.newscene.com>

I also need to do something similar. It seems like the best and easiest
solution is to use the LWP::Simple library.

However this library requires a whole other set of libraries. I installed
them, all both in local perl environment and at the server where the script
is suppose run. Locally the script that uses LWP::Simple runs fine but at
the server it returns a "Document unavailable error" when running the script
from a browser.

Unfortunately I don't have Telnet access to my server since I am using a
very limited web hosting service so I am having a hard time debugging the
script remotely. I ran a script that checked all the library modules at the
server and they seem to be all there. By commenting lines out I have learned
that the problem occurs with the use LWP::Simple statement but how can I
know which problem?

Any help is appreciated.

99%

Michael R. Seringhaus <m.seringhaus@utoronto.ca> wrote in message
news:FG0Mq4.67K@campus-news-reading.utoronto.ca...
> Can anyone help me with this CGI hurdle?
>
> I haven't been programming Perl all too long, although I'm relatively
> competent with the basics... I've written some cgi scripts to handle HTML
> forms and send mail, etc, but I have a crippling problem:
>
> I can't access HTML documents from inside my script!
>
> I've looked everywhere -- CPAN, many open source developer locations, and
> all the examples I've found seem to fall into one of two categories:
>
> 1) Simply redirects browser to proper URL with print "Location:
> http://....";
>
> 2) Makes a terribly complex series of calls to modules that I don't have
> (LibWWWPerl, URI, etc; and even if I get them from CPAN, I don't think my
> webserver has them, and there's not much I can do about that!)
>
> What I want to do seems easy in principle. I want to have my perl script
(a
> CGI) take user input and query a series of web pages, then grab all the
HTML
> that these HTTP requests generated, parse it, pick out the useful bits and
> slam it all into a file or e-mail.
>
> Thus, I do not want the user's browser to jump to the page I'm querying,
and
> as I said before I want to try to avoid all those modules if possible.
>
> Anyone have any insight here? All I want to do is find a way to query
> websites (without involveing the client's browser), receive the text/html,
> so I can search it and save it. Help!
>
> Michael R. Seringhaus
> Department of Biochemistry
> University of Toronto
>
>
>




------------------------------

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 393
*************************************


home help back first fref pref prev next nref lref last post