[11581] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5180 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 19 16:07:23 1999

Date: Fri, 19 Mar 99 13:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 19 Mar 1999     Volume: 8 Number: 5180

Today's topics:
    Re: $var$i or what? <cassell@mail.cor.epa.gov>
    Re: $var$i or what? (Greg Bacon)
    Re: $var$i or what? <tsawyer@telcom.lgb.cal.boeing.com>
    Re: Algorithm to split words into "encyclopedia labels" (Ilya Zakharevich)
    Re: Any idea to generate charts under Linux ? luvisi@andru.sonoma.edu
    Re: Appending Large Files <vince@oxxfordinfo.com>
        BCD routine (Kent Kling)
        by the way... <bcornwell@mail.peds.lsumc.edu>
    Re: Complex Structure Question <anbinx@rocketmail.com>
        Date Conversion <jim_eichert@jhuapl.edu>
    Re: Executing another SCRIPT on a different SERVER <dales@enhanced-performance.com>
    Re: Executing another SCRIPT on a different SERVER <jeromeo@atrieva.com>
    Re: Executing another SCRIPT on a different SERVER (Abigail)
    Re: exporting perl.exp problem (Mitchell Morris)
    Re: Finding the size of a scalar (Greg Bacon)
    Re: GNUfind -mmin and find2perl. (Randal L. Schwartz)
    Re: Help: Conditional use of packages in Perl (M.J.T. Guy)
        miniperl help (Brent Williams)
        Net::NNTP (Joao Luis Bonina - LEI)
    Re: Perl scripts written for UNIX. Will they work on NT (Lee)
    Re: Please can we stop this PIII thread RIGHT HERE? As  (James Stevenson)
    Re: Please can we stop this PIII thread RIGHT HERE? As  <edward_hill@gec.nospam.com>
        Please Help I'm an Idiot <thurlow@clara.co.uk>
    Re: problem with scoping using strict no refs (Larry Rosler)
        Q: format and write <ruedas@geophysik.uni-frankfurt.de>
    Re: Regular Expression Help <gala@sonic.net>
    Re: script help...? <jglascoe@giss.nasa.gov>
    Re: Subset Question <gwynne@utkux.utk.edu>
    Re: Subset Question <thelma@alpha2.csd.uwm.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 19 Mar 1999 11:47:43 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: Tim Sawyer <tsawyer@telcom.lgb.cal.boeing.com>
Subject: Re: $var$i or what?
Message-Id: <36F2A9DF.9B009FE0@mail.cor.epa.gov>

Tim Sawyer wrote:
> [gracious thank-you and explanation snipped due to my laziness]
>
> Perhaps this really was a CGI.pm question but you know how this group flames those
> questions. Thanks again for you answer.

Tim, I want to introduce one little point of clarification.  It seems
so nit-picky when you have been so polite already, but...
I think it is important to make the distinction between this ng's
general reaction to totally-off-topic posts about html/webservers,
and this ng's generally *helpful* reaction when your question is
Perl-specific.  Feel free to ask questions about your Perl code
using the CGI.pm module.  As long as it is a Perl coding problem,
you can ask questions about cgi, sockets, system administration,
etc.

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 19 Mar 1999 20:06:59 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: $var$i or what?
Message-Id: <7cuap3$4pi$2@info2.uah.edu>

[long lines wrapped--please limit lines to 72 columns or so]

In article <36F28171.5AA67177@telcom.lgb.cal.boeing.com>,
	Tim Sawyer <tsawyer@telcom.lgb.cal.boeing.com> writes:
: That worked. I would rather have used an array or hash and tried that
: at first but I ran into another problem. You see $var1 and $var2 are
: actually created from a cgi program. They are values from a bunch of
: checkboxes that are generated on the fly... the user gets to add or
: remove how many checkboxes are on the form.

Then load them into a hash:

    my @var;
    for ($query->param) {
        if (/^var(\d+)$) {
            $var[$1] = $query->param($_);
        }
    }

: I couldn't figure out how to get CGI.pm to keep the state of the form
: checkboxes because unchecked boxes have no value. So if the user check
: boxes 1 and 5, when the form reloaded checkboxes 1 and 2 would be
: checked.

Don't CGI.pm's sticky values address this problem?

: Perhaps this really was a CGI.pm question but you know how this group
: flames those questions.

That's an unfair characterization.  I challenge you to provide
evidence for your claim.  CGI problems that are unrelated to Perl
(i.e., a problem at the protocol level--independent of the language
in which one is implementing the CGI application) may elicit flames,
but that's only fair because there *is* ciwac, you know.

Greg
-- 
Why do people give each other flowers? To celebrate various important
occasions, they're killing living creatures? Why restrict it to plants?
"Sweetheart, let's make up.  Have this deceased squirrel."
    -- Jerry Seinfeld


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

Date: Fri, 19 Mar 1999 12:36:23 -0800
From: Tim Sawyer <tsawyer@telcom.lgb.cal.boeing.com>
Subject: Re: $var$i or what?
Message-Id: <36F2B547.77C98CDA@telcom.lgb.cal.boeing.com>

David and all,

Thanks for straighten me out on how CGI.pm fits into this news group. I'm not sure
everyone on this list knows or agrees with the policy you stated. I have personally been
severely flamed for asking a question that I thought was of the exact nature... I wanted
some help coding nph- headers in a perl cgi program. But I'll happily stand corrected.
So let me give it a try. I'll work up another reply to this post and see how it goes.
Thanks again.

"David L. Cassell" wrote:

> Tim, I want to introduce one little point of clarification.  It seems
> so nit-picky when you have been so polite already, but...
> I think it is important to make the distinction between this ng's
> general reaction to totally-off-topic posts about html/webservers,
> and this ng's generally *helpful* reaction when your question is
> Perl-specific.  Feel free to ask questions about your Perl code
> using the CGI.pm module.  As long as it is a Perl coding problem,
> you can ask questions about cgi, sockets, system administration,
> etc.
>

Tim



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

Date: 19 Mar 1999 20:14:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Algorithm to split words into "encyclopedia labels"
Message-Id: <7cub7m$paa$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Paul J. Lucas
<pjl@be-NOSPAM-st.com>],
who wrote in article <pjl.921861793@shell3.ba.best.com>:
> 	OK, how about s simpler problem: what's an easy way in Perl to
> 	tell how much of two strings match?
> 
> 
> 		$a = 'Hello';
> 		$b = 'Helicopter';
> 
> 		$c = f( $a, $b );
> 
> 	where $c is 'Hel' without doing a lot of looling of checking
> 	character by character?

  perl -MCPAN -e shell
  cpan> i /trie/

Hope this helps,
Ilya


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

Date: 19 Mar 1999 13:26:58 -0800
From: luvisi@andru.sonoma.edu
Subject: Re: Any idea to generate charts under Linux ?
Message-Id: <m2pv65cgrh.fsf@andru.sonoma.edu>

"Y W Wong" <ywwong_hk@hotmail.com> writes:
> 
> I am writing a perl script to generate HTML file hourly and upload to a web
> server.
> It use Expect to telnet to a host to collect real time data every 15
> minutes.
> The perl script used to generate HTML file based on the captured data.
> 
> Now, I would like to generate some simple bar charts ( Prefered in jpeg
> format )
>  based on the captured data.
> 
> Any idea about what tools or language should be used ?

perl has quite a few graphics manipulation packages, so you may be
able to get something from CPAN.

I use jgraph: http://www.cs.utk.edu/~plank/plank/jgraph/jgraph.html

a guy at a local Linux user group mentioned that he uses normal HTML
with one pixel images, and makes the browser scale the images with
hight and width settings.

best of luck,
andru


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

Date: Fri, 19 Mar 1999 15:33:23 -0500
From: "Vincent P. Mautone" <vince@oxxfordinfo.com>
Subject: Re: Appending Large Files
Message-Id: <7cuce9$3u5$1@client2.news.psi.net>


Eric Bohlman <ebohlman@netcom.com> wrote in message
news:ebohlmanF8s2Ax.HCA@netcom.com...
>Vincent P. Mautone <vince@oxxfordinfo.com> wrote:
>: I wrote a perl script which is meant to append File A to File B. However,
>: once File B reaches 4.3GB(yes, gigabytes), the appends no longer work. We
>: have successfully read files larger than 4.3GB yet I do not know why I
>: cannot write-append to a file larger than 4.3GB. I am using ActiveState
Perl
>: 5.005_02 on NT Server 4.0 (SP4). I have included my script below
>
>4.3GB sounds suspiciously close to the point where a 32-bit file pointer
>runs out of steam.
>

True. However, I can write a file much larger than 4.3GB when opening the
output file with ">output.dat" as opposed to ">>output.dat" or
">+output.dat". It seems to me that there may be some limitation with
appending and read/write access which does not occur with creating for write
only.






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

Date: Fri, 19 Mar 1999 19:32:21 GMT
From: kkling@tnsi.com (Kent Kling)
Subject: BCD routine
Message-Id: <36f2a62c.362199932@proxy.reston.tnsi.com>

Does anyone have any BCD routines?

Thanks


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

Date: 19 Mar 1999 20:06:02 GMT
From: "Brent Cornwell, Pediatrics Computer Administrator" <bcornwell@mail.peds.lsumc.edu>
Subject: by the way...
Message-Id: <7cuana$8sm$1ph@199.201.191.2>

take this thread to:   comp.sys.intel
it's more relevant there..




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

Date: Thu, 18 Mar 1999 19:23:46 -0800
From: Andrew Binkley <anbinx@rocketmail.com>
Subject: Re: Complex Structure Question
Message-Id: <36F1C342.3BE7@rocketmail.com>

Larry Rosler wrote:
> 
> [Posted and a courtesy copy mailed.]
> 
> In article <x3yiuc18kt4.fsf@tigre.matrox.com> on Tue, 16 Mar 1999
> 11:24:08 -0500, Ala Qumsieh <aqumsieh@matrox.com> says...
I have some questions about a CGI:PERL script I am using on my webpage. 

It lists the contents of a directory.  I want to limit it to *.htm files

and also have it list files by title not by name how can I do this?



#!/usr/bin/perl 

######index.cgi - By Daniel Gruno#####

##this program gives the "index of.." page, when an directory wirthout a

startingpage is shown a more modern look#

##place the index.cgi in the directory you wish to have indexed, and

it'll take over, if your server is set to handle#

##index.cgi as a startingpage,,,#

##you can alter the design of the page as you wish..##



$directorylisting = `ls -s -N`;

@pairs = split(/\n/, $directorylisting); 

foreach $pair (@pairs)  {

($name, $pairfil) = split(/   /, $pair);

($nsame, $pairfile) = split(/ /, $pairfil);

$dirlisting= "$dirlisting <a href=./$pairfile>$pairfile</a><br>"; }

###we now have a overview if the files in this directory, in the

variable $dirlisting###

print "Content-type: text/html\n\n"; 

print "<title>The Cheap Gaming Zone Review List</title>



it then goes on to the rest of my webpage until it hits $dirlisting<br>,

what can I do?


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

Date: Fri, 19 Mar 1999 15:37:27 -0500
From: Jim Eichert <jim_eichert@jhuapl.edu>
Subject: Date Conversion
Message-Id: <36F2B587.B041B961@jhuapl.edu>

Does anyone know how to convert a date in YEAR, DAY-OF-YEAR format to
YEAR, MONTH, DAY-OF-MONTH format?  Thanks in advance.




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

Date: Fri, 19 Mar 1999 11:46:57 -0800
From: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: Re: Executing another SCRIPT on a different SERVER
Message-Id: <36F2A9B1.B8B16BD3@enhanced-performance.com>

> : I need to do this without doing a post or get.
>
>    That sound like the HTTP protocol.
>
>    Why must it not use that protocol?

To enhance security a bit, I don't want the user to see that a script is
being called on another server.
If a post or get can be done without the user's knowledge, great.  But, how?

Thanks.
    Dale

>
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas



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

Date: Fri, 19 Mar 1999 12:01:55 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: Re: Executing another SCRIPT on a different SERVER
Message-Id: <36F2AD33.364AF95F@atrieva.com>

> >    Why must it not use that protocol?
> 
> To enhance security a bit, I don't want the user to see that a script is
> being called on another server.
> If a post or get can be done without the user's knowledge, great.  But, how?

With LWP.  Have your script create user agents as needed. 

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: 19 Mar 1999 20:46:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Executing another SCRIPT on a different SERVER
Message-Id: <7cud2e$41c$1@client2.news.psi.net>

Dale Sutcliffe (dales@enhanced-performance.com) wrote on MMXXVI September
MCMXCIII in <URL:news:36F19392.B5309942@enhanced-performance.com>:
|| How would I execute and pass information to another script on different
|| server?

Start up a socket connection to the other server.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: 19 Mar 1999 18:35:31 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Re: exporting perl.exp problem
Message-Id: <slrn7f567k.kg6.mgm@unpkhswm04.bscc.bls.com>

In article <iCwI2.149$zG2.988@PM01NEWS>, Scott Ranzal wrote:
>install of perl5.005_02 on AIX4.3.1.  Running make and get the following
>WARNING messages.
>
>
>exported symbol not defined: Mycalloc
>exported symbol not defined: Myfree
>...
>
>basically every entry in the perl.exp file generates this WARNING.
>
>what can i do to fix this error message
>
>scott
>
>scott.ranzal@mci.com

It's been long enough since I last rebuilt that I don't recall the specifics,
but I'd bet money that I didn't override any defaults when I ran configure.

If it helps, I'm also at 4.3.1, and herewith is the output from perl -V:

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=aix, osvers=4.3.0.0, archname=aix
    uname='aix unpkhswm04 3 4 000148764600 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=8192
		-I/usr/local/include'
    ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=8192
		-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
		-bE:$(BASEEXT).exp -b noentry -lc -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under aix
  Compiled at Dec 17 1998 15:27:06
  @INC:
    /usr/local/lib/perl5/5.00502/aix
    /usr/local/lib/perl5/5.00502
    /usr/local/lib/perl5/site_perl/5.005/aix
    /usr/local/lib/perl5/site_perl/5.005
    .


-- 
Mitchell Morris

Underlying Principle of Socio-Genetics: Superiority is recessive.


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

Date: 19 Mar 1999 19:55:59 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Finding the size of a scalar
Message-Id: <7cua4f$4pi$1@info2.uah.edu>

In article <36F284FC.EB758D2E@worldnet.att.net>,
	Frank Hale <frankhale@worldnet.att.net> writes:
: Say I want to have a scalar that stores a string and I don't want it to
: be larger than 256kb how can I get the size of it to test for this?

Read the perlfunc documentation on Perl's length() operator.

Greg
-- 
No one now dies of fatal truths: there are too many antidotes to them.
    -- Nietzsche


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

Date: 19 Mar 1999 11:08:36 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: GNUfind -mmin and find2perl.
Message-Id: <m1677xcn63.fsf@halfdome.holdit.com>

>>>>> "milburn" == milburn  <milburn@ltpmail.gsfc.nasa.gov> writes:

milburn> Is there a way to modify find2perl to handle "-mmin" or does anyone
milburn> know of another method I could use to accomplish this.

-mmin +60 would be approximately the same as -eval '-M $_ > 60/86400'

I'm using the -M here to get the mod time in days, so I have to scale
60 to parts of a day.

print "Just another Perl hacker,"

-- 
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: 19 Mar 1999 19:28:52 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Help: Conditional use of packages in Perl
Message-Id: <7cu8hk$eln$1@pegasus.csx.cam.ac.uk>

Larry Rosler <lr@hpl.hp.com> wrote:
>
>BEGIN {
>  if (condition is true)
>    use package1;
>  else
>    use package2;
>}
>
>If the condition is not known before the program is executed, consider 
>using 'require' instead of 'use'.

You have to use 'require' regardless  -  see my reply to Tad.

There is no way to do a conditional 'use' except by enclosing it in
an eval().


Mike Guy


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

Date: Fri, 19 Mar 1999 14:38:23 -0500
From: Brent.Williams@mci.com (Brent Williams)
Subject: miniperl help
Message-Id: <36F2A7AF3CA.332FBRENT.WILLIAMS@pop.mcit.com>

I am compiling perl5 for windows98 platform. I am having a bit of
success using mingw32 gcc port with the 4dos shell.

The problem I run into is after the miniperl is built.

Apparently miniperl.exe is getting things ready for perl.exe to build. 
I get the following error when miniperl is invoked.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I cannot locate any documentation on this in the FAQ's or the perl.com
documentation. I have tried (and failed) playing with the environment by
setting LC_ALL and LANG but without know what these want (I assume LANG
want to be set to English?) I am kinda lost.

Any advice will be appreciated.

thanks in advance


	Brent Williams
	Brent.Williams@mci.com
	PGP Key -- http://www.palenaka.com/pgp/palenaka.asc




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

Date: 19 Mar 1999 20:23:16 GMT
From: jlmab@students.si.fct.unl.pt (Joao Luis Bonina - LEI)
Subject: Net::NNTP
Message-Id: <7cubnk$9dq$1@news.si.fct.unl.pt>

	Hi!
	Please, where can I find a manual about this module?
	Thanks in advance!

--
   ___  ____                              
 __/oao /__/                    |  	jlmab@students.si.fct.unl.pt
       /___/onina               | 	  a6705@lei.di.fct.unl.pt - PORTUGAL



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

Date: Fri, 19 Mar 1999 14:20:28 -0600
From: rlb@intrinsix.ca (Lee)
Subject: Re: Perl scripts written for UNIX. Will they work on NT?
Message-Id: <B3180DAC96689732BE@204.112.166.88>

In article <MPG.1158625692c24991989764@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:

>I seldom resort to this form of dialogue, but your opinion is indeed a 
>load of tripe, as you say in your pseudo-address.

Really? This is the fifth post from you that I've read today, and I would
have classified all of them as snarky and dismissive. Having a rough day?

>All you are really saying is that programs that rely on Unix-specific 
>commands or system calls run better on Unix-derived systems.  D'uh.  
>This has nothing *whatever* to do with the language from which the
>commands or system calls are invoked.

Judging from the title and the original post, It would seem reasonable to
expect that Perl scripts written for UNIX could well contain Unix-specific
commands or system calls. This may make the port to NT a little less of a
no-brainer than has been suggested by most of these replies.

Lee




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

Date: 19 Mar 1999 19:58:13 GMT
From: James@DX2.home (James Stevenson)
Subject: Re: Please can we stop this PIII thread RIGHT HERE? As it's off-topic for everybody!
Message-Id: <7cua8l$8sm$1if@199.201.191.2>

On Mon, 15 Mar 1999 12:51:05 -0700, Kenny A. Chaffin <kenny@kacweb.com> wrote:
>In article <01be6f1a$1298f700$2a01a8c0@arc7>, binary@eton.powernet.co.uk 
>says...
>> Subject line says it all - we've been through this subject ad nauseam
>> already, after all.
>> 
>> 
>
>you must be from the .c newsgroup.....
>
>-- 
>KAC Website Design
>Custom Programming, Web Design, and Graphics
>kenny@kacweb.com    -     http://www.kacweb.com

Hi

just to add to the point 
it would be impossible to do
eg would it know what os you are running???
talk the the correct cp stack etc......

And of course it has a serial number so there
can work out who steals them if ppl do that sort of thing :)

cya

-- 
Check Out: http://www.users.zetnet.co.uk/james/
E-Mail: mistral@zetnet.co.uk


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

Date: 19 Mar 1999 19:58:55 GMT
From: Edward Hill <edward_hill@gec.nospam.com>
Subject: Re: Please can we stop this PIII thread RIGHT HERE? As it's off-topic for everybody!
Message-Id: <7cua9v$8sm$1j2@199.201.191.2>

James@DX2.home (James Stevenson) was too tempted to not write:
> Hi
> 
> just to add to the point
> it would be impossible to do
> eg would it know what os you are running???
> talk the the correct cp stack etc......
> 
> And of course it has a serial number so there
> can work out who steals them if ppl do that sort of thing :)

It's amazing how a post entitled along the lines of 
'don't reply to this thread' is just too tempting for james.

Is this the same as having a big red button with 'do not push
me on?' 

Ed
-followups means adjusted


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

Date: Fri, 19 Mar 1999 20:26:28 GMT
From: "Michael Stow" <thurlow@clara.co.uk>
Subject: Please Help I'm an Idiot
Message-Id: <UpyI2.910$mi3.170@nnrp3.clara.net>

I want to learn Perl for developing Web applications.
I'm using Active Perl api509e (should I be?)
I run Windows 98 (ditto)
How can I get forms to run perl scripts without the browsers attempting to
download them?

Many many thanks for wasting your time.






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

Date: Tue, 16 Mar 1999 18:40:08 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: problem with scoping using strict no refs
Message-Id: <MPG.1158b5e37a3b122998976a@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7cn0g0$m48@dfw-ixnews8.ix.netcom.com> on Wed, 17 Mar 1999 
01:28:26 GMT, Tim Speevack <speevack@ix.netcom.com >says...
 ...
> # These are the variables I need to create dynamically.
> # my goal is to NOT create them here, but I've been
> # trying lots of variations on this theme.
> my $var_one;
> my $var_two;

Instead of those, try this:

  use vars qw($var_one $var_two);

You are making symbolic references, and using them by their symbolic 
names, but the symbols have not been declared.  "use strict 'vars';" is 
still in effect.  So you must declare your variables before you refer to 
them.

'my' variables are not in the symbol table, so are not the same as the 
variables you created symbolically.  Thus your ttempt at declaring them 
doesn't work.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 19 Mar 1999 21:02:08 +0100
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
Subject: Q: format and write
Message-Id: <36F2AD40.41C6@geophysik.uni-frankfurt.de>

Hello,
I'm trying to write a Perl script which extracts lines containing a
given string from the www access_log, counts them and writes a small
evaluation (how often a given page has been accessed) into a file; I
want that output to be formatted and therefore had a look at the perl
manpages, but the perl script does not write the formatted information,
although it runs without complaining about errors.
Surely I'm missing something, but I don't find an example in the
manpages where a format is defined AND then used by a write statement.
So my only hope is some advice from you; I post the entire script at the
bottom.
BTW, another strange thing is that the script is aborted with the
message:
syntax error at access.pl line 29, near "foreach "
Search pattern not terminated at access.pl line 30.
if I omit the line marked ##!!!!! (see below).
Thank you in advance,

Thomas Ruedas

#!/usr/local/bin/perl5
# analyze web access logfile
@srchstr=("geophys","ruedas");
foreach (@srchstr) { $hits{$_}=0; }
$acclog="/usr/local/etc/httpd/logs/access_log";
unless (-e $acclog || -r $acclog) { die "No file $acclog \b.\n"; }
open (ACCLOG,"$acclog");
open (ACCHIT,">access.hits");
$total=0;
while ($line = <ACCLOG>) {
    ++$total;
    foreach (@srchstr) {
	if ( $line =~ /$_/ ) {
	    ++$hits{$_};
	    print ACCHIT $line;
	}
    }
}
close(ACCLOG);
close(ACCHIT);
open(ACCRES,">access.results");
print ACCRES "Total number of requests: $total\n";
format ACCRES_TOP =
              Web Access Log
file/dir           req.        % of tot.req.
--------------------------------------------
 .
$^='ACCRES_TOP';
print "$srchstr[0],$srchstr[1],\n";    ##!!!!!
foreach (@srchstr) {
$hitperc=100.*$hits{$_}/$total;
format ACCRES =
@<<<<<<<<<<<<<<<   @|||||      @##.##
$_,                $hits{$_},  $hitperc
 .
$~='ACCRES';
write ACCRES;
}
close(ACCRES);
print "Results written to access.results; hits written to
access.hits.\n";
exit;


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

Date: Fri, 19 Mar 1999 11:41:19 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: Re: Regular Expression Help
Message-Id: <7cu95a$1m4$1@ultra.sonic.net>

Thanks, but I know that.  The program will be reading another persons code,
which is written this way.

Philip Newton wrote in message <36F0C52E.C2162F54@datenrevision.de>...
>Gala Grant wrote:
>>
>> "c:\\web\\content\\tbuedit\\alpha\\tools\\pressroom\\releases\\"
>
>Hmm, this has nothing to do with the question, but... did you know that
>you can also use '/' as a path separator, even on Windows systems? That
>way you avoid having to double your backslashes all the time. For
>example, C:\\web\\content is the same as C:/web/content . Looks cleaner
>IMHO.
>
>Cheers,
>Philip




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

Date: Fri, 19 Mar 1999 15:23:38 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Mike Eley <mapman@frii.com>
Subject: Re: script help...?
Message-Id: <36F2B24A.9DDCC419@giss.nasa.gov>

[courtesy copy of post sent to cited author]

Mike Eley wrote:
> 
> # calculate the area of each broad land use in each polygon
> #  NOTE:  The statistics on this level of division won't be great
>        $OutRec{"$Fips, $Mlra, $Hydro, $Broad92"}+=$Xfact * 100

you're missing a semi-colon in the above line.

	Jay Glascoe
-- 
	"The early bird gets the worm, but
	 the second mouse gets the cheese."


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

Date: Fri, 19 Mar 1999 14:10:45 -0500
From: "Robert Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Subset Question
Message-Id: <7cu83l$ss9$1@gaia.ns.utk.edu>

>Lunch break one-liner:
>my @keep=map{push(@temp,$_);$in=$_;map{$temp[$_].$in}(0..$#temp-1)}@array;

I was wondering if someone would come up with a one liner. And, yes, it fits
on one line. But isn't that technically three lines--if ";" is a break?

Foreach is more intuitive than map for me.  If the array is long, however,
speed would be important. Is map faster?  And finally, can someone tell me
why my original mangled the array? It looks logical enough to me. My version
of Perl is  5.004_04 built for sun4-solaris.

Bob

********************
Robert Gwynne, Ph.D.
Speech Communication
University of Tennessee, Knoxville
gwynne@utkux.utk.edu
http://web.utk.edu/~gwynne
423-523-1097 Home
423-974-6836 Office
423-974-4879 Fax
***********************************
Liberalism has always derived its authority and persuasiveness from a vision
of human nobility, from the idea that our dignity is derived from the
exercise of moral choice. Moral absolutism fears this act of choice and
fears the freedom required by the act of choosing.

Liberalism depends, ultimately, on faith in human choosing, and a liberal
revival depends on recovering the inspiration of this central conviction.

Michael Ignatieff






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

Date: 19 Mar 1999 20:14:43 GMT
From: Thelma Lubkin <thelma@alpha2.csd.uwm.edu>
Subject: Re: Subset Question
Message-Id: <7cub7j$vmn$1@uwm.edu>

Robert Gwynne <gwynne@utkux.utk.edu> wrote:
: Foreach is more intuitive than map for me.  If the array is long, however,
: speed would be important. Is map faster?  And finally, can someone tell me
: why my original mangled the array? It looks logical enough to me. My version
: of Perl is  5.004_04 built for sun4-solaris.

This is the original code:
#!/usr/local/bin/perl -w
use strict;
my ($element,$item);
my @array = qw(a b c d);

foreach $item(@array){

    foreach $element(@array){
        print "$item times $element\n";
}
    shift(@array);
}

its results      array and element at each loop of foreach

                                   0 1 2 3
a times a       a[0]   @array = qw(a b c d);
a times b
a times c           first loop of foreach : $element = $array[0];
a times d
                                   0 1 2
c times b       a[1]   @array = qw(b c d); (array shortened by shift)
c times c
c times d           second loop of foreach : $element = $array[1];


                                   0 1
                a[2]   @array = qw(c d);

                    third loop of foreach : $element = $array[2];
                    and the array no longer even has such an element.

                         --thelma

: Bob

: ********************
: Robert Gwynne, Ph.D.
: Speech Communication
: University of Tennessee, Knoxville
: gwynne@utkux.utk.edu
: http://web.utk.edu/~gwynne
: 423-523-1097 Home
: 423-974-6836 Office
: 423-974-4879 Fax
: ***********************************
: Liberalism has always derived its authority and persuasiveness from a vision
: of human nobility, from the idea that our dignity is derived from the
: exercise of moral choice. Moral absolutism fears this act of choice and
: fears the freedom required by the act of choosing.

: Liberalism depends, ultimately, on faith in human choosing, and a liberal
: revival depends on recovering the inspiration of this central conviction.

: Michael Ignatieff






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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5180
**************************************

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