[17725] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5145 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 18 21:05:31 2000

Date: Mon, 18 Dec 2000 18:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977191511-v9-i5145@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 18 Dec 2000     Volume: 9 Number: 5145

Today's topics:
    Re: CGI script <mischief@velma.motion.net>
    Re: change Password (Charles DeRykus)
        changing array contents as you iterate over it bdesany@my-deja.com
    Re: existing files (Ben Okopnik)
    Re: existing files (Tad McClellan)
    Re: Get epoch seconds range for today (Sean McAfee)
    Re: Guilty as charged!!! :-) <mischief@velma.motion.net>
        Home Directory mgrime@my-deja.com
    Re: Home Directory <tony_curtis32@yahoo.com>
    Re: How to secure HTTP form POST by a CGI (Brian)
    Re: Language evolution C->Perl->C++->Java->Python (Is P <just_me@nospam.com>
    Re: Language evolution C->Perl->C++->Java->Python (Is P <toma@fluence.com>
    Re: One-Liner to Sum a Stack of Numbers? <revjack@revjack.net>
    Re: One-Liner to Sum a Stack of Numbers? <bart.lateur@skynet.be>
    Re: One-Liner to Sum a Stack of Numbers? <tick.toff@spam.com>
    Re: One-Liner to Sum a Stack of Numbers? (Randal L. Schwartz)
    Re: One-Liner to Sum a Stack of Numbers? (Abigail)
    Re: One-Liner to Sum a Stack of Numbers? <tick.toff@spam.com>
    Re: Performance optimization of DBI::CSV upuautiii@my-deja.com
        perl, iis, form/java mail, form width invinfo@my-deja.com
    Re: Please help - split question? (Tad McClellan)
    Re: Please help - split question? (Abigail)
        possibly st00pid question regarding 'require' <nospam@nospam.com>
        PROBLE WITH MY SCRIPT.  PLEASE HELP! (Fryar386)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 19 Dec 2000 01:34:12 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: CGI script
Message-Id: <t3teokr4o8pv96@corp.supernews.com>

Lalit <lalit@engrs.unl.edu> wrote:
> Hi! I am pretty new to Perl and CGI. We run QNX4.25 on our server with

Thanks for the warning.

> sql anywhere database. I am trying to develop a web interface for it. A
> perl script has to be made to run on a web browser. I have Apache 1.3.9

CGI doesn't run on the browser. CGI runs on the server, under control
of the web server software. It doesn't have to be written in Perl,
so if you know C or C++, get a CGI reference to help you out. They
have a standard input and a standard output, too.

> installed. In the HTML code, I use <FORM METHOD = "POST" ACTION
> "/cgi-bin/filename.cgi">
> The ScriptAlias set in the httpd.conf  is like "ScriptAlias /cgi-bin/
> "/usr/local/apache/cgi-bin/".

If you feel the need to tell us your Apache configuration, you may
be in the wrong group. This is a language group for the Perl language,
hence the name: 'comp.lang.perl.misc'.

Apache configuration is down the hall, third door on your left.

> The file filename.cgi exist in the /usr/local/apache/cgi-bin directory.
> When I try to execute it, I get the error in the browser (both IE and
> Netscape)saying that I do not have permission access that file. I have
> even tried making the permission as -rwxrwxrwx. If you have any ideas I
> would really appreciate a detailed response.

You might have to enable CGI execution and make sure that the extension
has a handler associated with it in your httpd.conf file. You really
don't want the file world readable, writable, and executable. You want
it readable and executable by the web server, which is generally
executing as user 'nobody', but I'm not sure if this holds true on QNX.
I think it would, but I'm not sure.

Since you present us with Apache configuration details but not any Perl
code, I'd suggest you either change your post or change the group in
which it is posted.

> Thanks.

If you are thankful, you should follow the posting guidelines.

Chris
--
Christopher E. Stith - mischief@motion.net



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

Date: Tue, 19 Dec 2000 01:12:17 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: change Password
Message-Id: <G5sJCH.DLE@news.boeing.com>

In article <91lbub$2of$1@newstoo.ericsson.se>,
Per- Fredrik Pollnow <Per-fredrik.Pollnow@epk.ericsson.se> wrote:
>Hi,
>I was wondering if anyone knows how to change password in UNIX(Solaris) with
>a perl script. The function of the script is to add a user and then change
>the password for the user.
>

Adding an account:

With Solaris, take a look at useradd(1M). For 
examples, do a Net search or get "Perl for System
Administration" by David Blank-Edelman. There are
some good examples there.

Changing passwords:

http://seach.cpan.org/search?mode=module&query=Expect

I believe there may be an example in the Expect module's
faq or tutorial.

hth,
--
Charles DeRykus


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

Date: Tue, 19 Dec 2000 00:06:59 GMT
From: bdesany@my-deja.com
Subject: changing array contents as you iterate over it
Message-Id: <91m8qv$lja$1@nnrp1.deja.com>



for (@array) {
   # do some checks with the "first" $_
   # based on the results, splice out various elements of @array
}

Will the for loop reflect changes to @array, or will it iterate over
the elements as they existed when the loop was initiated? I think the
latter.

My question really is how can I make it behave like the former? I have
worked around it by doing this:

while (@array) {
   LOOP:
   for (@array) {
      # do some checks with the "first" $_
      # based on the results, splice out various elements of @array
      last LOOP;
}

This seems really inelegant and not perl-ish. Any suggestions on a more
efficient way to do this?
Thanks-
-Brian.


Sent via Deja.com
http://www.deja.com/


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

Date: 18 Dec 2000 23:37:23 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: existing files
Message-Id: <slrn93t81g.kvf.fuzzybear@Odin.Thor>

The ancient archives of Mon, 18 Dec 2000 23:20:04 +0100 showed
iLs of comp.lang.perl.misc speaking thus:
>I was trying to write a script that could copy files from one dir to
>another, but only if the file doesn't already exist in de second dir.
>
>How can I check for the file to exist ?


Uh, 'cp -u <sourcedir>/* <targetdir>'?

If you want to check for its existence via a Perl script, you can do
this:

if (-e $file) { print "That sucker was trying to hide, but I found it!"; }


Ben Okopnik

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Knowledge is a process of piling up facts; wisdom lies in their
simplification. -- Martin H. Fischer 


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

Date: Mon, 18 Dec 2000 17:15:14 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: existing files
Message-Id: <slrn93t33i.7g8.tadmc@magna.metronet.com>

iLs <iLs@cyberdude.com> wrote:

>How can I check for the file to exist ?


   perldoc -f -e


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


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

Date: Tue, 19 Dec 2000 00:41:52 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Get epoch seconds range for today
Message-Id: <k9y%5.11114$O5.298585@news.itd.umich.edu>

In article <slrn93t2ss.j5f.mgjv@verbruggen.comdyn.com.au>,
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>On 18 Dec 2000 20:31:14 GMT,
>	nobody <nobody@nobody.com> wrote:
>> What I want to get is two values:
>> The epoch seconds for the date: Today 00:00:00
>> The epoch seconds for the date: Today 23:59:59

>> I want to findout if an epoch time fits in today's range...

>Use the standard Time::Local module:

Or for a module-less alternative:

#  Let $time be the epoch time in question:

my @now  = localtime();
my @then = localtime($time);

if ($then[5] == $now[5] && $then[7] == $now[7]) {
    #  $time is in today's time range
}

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Tue, 19 Dec 2000 00:40:57 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Guilty as charged!!! :-)
Message-Id: <t3tbkp62ubr411@corp.supernews.com>

John W <jwmsng@greatnospamwebsolutions.com> wrote:
> OK, folks -- I confess. The file WAS NAMED "test"!

Not the worst sin you could commit. Just don't do it again. :)


>> Do a 'which file1', unless 'file1' == 'test', in which case do a 'man
> test', and
>> never call anything else 'test'.  ;-)
>>

Good advice.

>> One further suggestion - put your current directory ('.') in your path
> ahead of
>> everything else.
>>

Bad advice, at least from a security standpoint. Picture this
scenario:

    You are in someone else's directory, doing file
    maintenance or whatever. You decide to get a
    directory listing. You type 'ls', and hit enter.
    A program in the directory, called 'ls', runs
    with your permissions. The program is a shell
    script that includes the lines 'umount /usr' and
    'mkfs /dev/hdc1', where hdc1 houses your /usr
    partition.

Now, think about running that as root. If you are
going to put the current directory in your path, at least
don't do so as root or as a default for all users or for new
users. There's a reason it isn't included in the path
already.

Much less damaging stuff could be put in there, but you
could still do bad things even as a non-root user. Maybe
you'd open a socket on port 10042 with a shell but no
login, where someone who scans your box and finds the
port open can conenct and type in arbitrary commands to
be executed as the user who started the process.

Now, call me a worry wart, and I know this has drifted
far from the original topic, but I'd rather type './'
than put '.' in my path.

Chris
--
Christopher E. Stith - mischief@motion.net



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

Date: Mon, 18 Dec 2000 23:47:51 GMT
From: mgrime@my-deja.com
Subject: Home Directory
Message-Id: <91m7n6$kjv$1@nnrp1.deja.com>

Hello,

Can anyone tell me if there is there any way to reference your home
directory as the tilde (~) does in shell?

Thanks,
Mike


Sent via Deja.com
http://www.deja.com/


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

Date: 18 Dec 2000 19:53:03 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Home Directory
Message-Id: <8766kh89ds.fsf@limey.hpcc.uh.edu>

>> On Mon, 18 Dec 2000 23:47:51 GMT,
>> mgrime@my-deja.com said:

> Hello, Can anyone tell me if there is there any way to reference
> your home directory as the tilde (~) does in shell?

(Not all shells.)

You want the HOME environment variable, or failing that the home
directory as returned by getpw*().

hth
t
-- 
Eih bennek, eih blavek.


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

Date: Tue, 19 Dec 2000 00:44:55 GMT
From: pontz@NO_SPAM.channel1.com (Brian)
Subject: Re: How to secure HTTP form POST by a CGI
Message-Id: <3a3eadb8.442673230@news.e-dialog.com>

>I need to securely send information from a CGI (Perl Script) to another 
>CGI that is NOT on my server using a HTTP form POST method.  How do I do 
>this?? 

Maybe though https on the other server? Otherwise if the receiving
remote http server is under your control. You could try encrypting the
data with one of the Crypt modules, send it,  and the receiving server
could decrypt it.

Brian Pontz

comp.lang.perl.misc Searchable Archive
http://www.axehind.com/complangperl.html


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

Date: Mon, 18 Dec 2000 23:33:23 +0100
From: Just Me <just_me@nospam.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the     ULTIMATE oflanguages??)
Message-Id: <3A3E90B3.C137A7D7@nospam.com>

As far as I know Digitalk Smalltalk was very cheap in these days until it
was killed by Java (indirectly). But I don't want to get into this
discussion so let's just leave it here.

Tor Iver Wilhelmsen wrote:

>
> No, they are regarded as something _inexpensive_. VisualWorks and the
> rest killed their baby market-wise by charging an arm and a leg for
> their products. The JDK is _free_.
>
> So taker your Tower of Ivory (the close-minded Smalltalk community)
> and stick it where Sun doesn't shine. :-)
>
> --
>   Tor Iver Wilhelmsen                              <toriw@chello.no>
> Life stinks, and don't get me started on the terrible sequel.



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

Date: Mon, 18 Dec 2000 15:17:05 -0800
From: Tom Almy <toma@fluence.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the   ULTIMATE oflanguages??)
Message-Id: <3A3E9AF1.B410070A@fluence.com>

Just Me wrote:
> Where else can you use fractions und numbers of
> unlimited size than in Smalltalk.

Common Lisp

-- 
--------
Tom Almy
Fluence Technology Incorporated
8700 SW Creekside Place
Beaverton, OR 97008
(503) 672-8721


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

Date: 18 Dec 2000 23:22:16 GMT
From: revjack <revjack@revjack.net>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <91m678$m50$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

The WebDragon <nospam@nospam.com> wrote:
: In article <fnl%5.23209$xW4.177588@news-server.bigpond.net.au>, 
: "SuperGumby" <tick.toff@spam.com> wrote:

:  | 
:  | and before I again get in trouble for "jeopardy" posting, please be 
:  | aware:
:  | 
:  | I do not do it to annoy people, I believe what I refer to as "top 
:  | posting" is a much better alternative to "bottom posting", which is 
:  | EVIL.

: how can it be evil? 

It isn't - he's trolling. :)

-- 
___________________
revjack@revjack.net



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

Date: Mon, 18 Dec 2000 23:39:40 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <ct7t3t847qkvidv7r6i3ov01i4ed7hm805@4ax.com>

SuperGumby wrote:

>and before I again get in trouble for "jeopardy" posting, please be aware:
>
>I do not do it to annoy people, I believe what I refer to as "top posting"
>is a much better alternative to "bottom posting", which is EVIL.

How is top-posting less evil than bottom-posting?

Learn to do snip-posting. Only insert parts of the original post that
are relevant to your reply. Please make clear why it is relevant in the
first place. This is not a courtroom, where every sollicitor gets to say
his thing in turns; a series of monologues.

This here is supposed to represent a real communication.

-- 
	Bart.


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

Date: Tue, 19 Dec 2000 00:00:19 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <nyx%5.23961$xW4.185144@news-server.bigpond.net.au>

<snip>
>
>: how can it be evil?
>
>It isn't - he's trolling. :)

no, I am not.

The great majority of groups I am involved in are not *nix specific,
therefore the majority of readers are using Outlook Express (or another win
reader with preview). By using "top posting" a thread can be walked simply.
Even in other OS's, I believe the benefit of top posted replies being
immediately viewable outweighs the possible cons.

I believe most of the reasons The WebDragon raised in his post are
artificial in the context of top v bottom posting. People are lazy and don't
follow most of the points irrespective of top v bottom.

Where specific attention is required "interspersed" reply should be used.

I repeat, I do not do it to annoy people, please don't call me a liar.




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

Date: 18 Dec 2000 16:04:30 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <m13dfl9sz5.fsf@halfdome.holdit.com>

>>>>> "SuperGumby" == SuperGumby  <tick.toff@spam.com> writes:

SuperGumby> The great majority of groups I am involved in are not *nix
SuperGumby> specific, therefore the majority of readers are using
SuperGumby> Outlook Express (or another win reader with preview). By
SuperGumby> using "top posting" a thread can be walked simply.

No, I actually find it harder to read an upside-down quoted item.  I end
up scrolling down, and then up, to see first the question, and then
the answer.

Proper quoting is not *nix-specific.  Wherever did you get THAT idea?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 19 Dec 2000 00:15:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <slrn93ta4a.qqa.abigail@tsathoggua.rlyeh.net>

SuperGumby (tick.toff@spam.com) wrote on MMDCLXVII September MCMXCIII in
<URL:news:nyx%5.23961$xW4.185144@news-server.bigpond.net.au>:
 .. <snip>
 .. >
 .. >: how can it be evil?
 .. >
 .. >It isn't - he's trolling. :)
 .. 
 .. no, I am not.
 .. 
 .. The great majority of groups I am involved in are not *nix specific,
 .. therefore the majority of readers are using Outlook Express (or another win
 .. reader with preview). By using "top posting" a thread can be walked simply.
 .. Even in other OS's, I believe the benefit of top posted replies being
 .. immediately viewable outweighs the possible cons.


This only works under the assumption you get the full thread at once.
Now, many of newcomers perhaps read news twice a week, or only follow
one thread anyway, so that works fine. But more experienced people may
read news 16 times a day, following a dozen groups.

Then you need context if you want to be able to make a sensible reply.


Most Jeopardists end up in my killfile after their first offensive.
I don't think any Jeopardist ever made its way out of it. 



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'


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

Date: Tue, 19 Dec 2000 00:22:42 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <mTx%5.23992$xW4.185326@news-server.bigpond.net.au>


Randal L. Schwartz wrote in message ...
<snip>
>Proper quoting is not *nix-specific.  Wherever did you get THAT idea?

I agree, it is not *nix specific, but the proponents who insist on it tend,
in my experience, to be *nix users. I believe ex-diehard 'bottom posters'
who use programs similar in function to OE, tend to give up whinging about
it and accept the convenience of being able to 'browse' threads.

Worst part is, I hate polluting the group with discussion of what I see as a
trivial difference in posting style. I just cannot see why people get so
upset about it.




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

Date: Mon, 18 Dec 2000 23:51:39 GMT
From: upuautiii@my-deja.com
Subject: Re: Performance optimization of DBI::CSV
Message-Id: <91m7ua$kna$1@nnrp1.deja.com>

Thanks for the response.
I think I'll leave it the way it is. The file grows by 700 to 1500
records a day.

Since I'm planning to switch to a machine with Oracle installed, I'll
abandon this optimization thought.

thanks again for the response.


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 23:53:11 GMT
From: invinfo@my-deja.com
Subject: perl, iis, form/java mail, form width
Message-Id: <91m815$koa$1@nnrp1.deja.com>

Some newbie questions:

1) How can I make my form full size ?  Is there a width attribute ?
	I'm having trouble getting a <hr> tag within a form to stretch
the whole width of the page.


2) How can I call a perl script to handle form processing on a NT / IIS
environment ?
	I'm using ActiveState perl v5.6.0
	How do I have to have my machine configured ?
	What needs to be in my path ?
	I'm assuming I will need the perl script to be in the same
directory of the form.
	ex:  /inetpubs/wwwroot/page.html     will be processed
by  /inetpubs/wwwroot/page.pl

3) I'm looking for good examples of form based email scripts.
	Is javamail good to use for this ?    other suggestions ???

4) I've seen some pages, when saved as a favorite in IE have unique
icons with them.
	See the pages from the  CBOT in particular.
	How is this done ?

-TIA  -Robert




Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 17:55:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Please help - split question?
Message-Id: <slrn93t5f3.7g8.tadmc@magna.metronet.com>

KMiller@2xtreme.net <kmiller@2xtreme.net> wrote:
>I'm trying to convert a postgres table listing into a hash.
>I'm getting a set of blank elements from split.
>I can't figure out where they're coming from.
>
>The listing:
>---- start of listing ---
>Showing only tuples.
> submitter | char(3)   |
> filler1   | char(11)  |
> subdate   | char(4)   |
> filler2   | char(4)   |
> rectype   | char(1)   |
> subname   | char(33)  |
> claimcnt  | char(6)   |
> billval   | char(9)   |
> provcnt   | char(3)   |
> createdat | char(6)   |
> remcnt    | char(6)   |
> certstmt  | char(108) |
> flller3   | char(6)   |
>
>---- end of listing ---
>
>Some test code:
>
>#!/usr/bin/perl -w
>
>map { /\S/ && push @tablist,$_ } map { s'\| $''gm && /(.*)/ && $1 } qx{echo
>'\\t \\d subcontrol'|psql omc};


What is that backtick stuff there? Is that what produces the "listing"?

If so, then you can be more clear about what you mean, and avoid
any mention of the tools that make the data, by using the DATA
filehandle.

map { /\S/ && push @tablist,$_ } map { s'\| $''gm && /(.*)/ && $1 } <DATA>;


Why the 2 useless options on your substitution?

There is only one line per list element anyway, you're never
going to match more than one. 


I do not see a vertical bar-space sequence at the end of
any of the data lines you showed us, so the pattern match
does not succeed, so the other AND clauses are not evaluated,
so the map()ped value will be some sort of "false".  The 
second map filters those out. Nothing gets put into @tablist.

That's how it plays out for me.


I will assume that you have not shown us the real data with
spaces at the end of lines...


>#print out the would be key/value pairs
>map { print "f:$f, t:$t\n";($f,$t)=split(/\|/,$_) } @tablist;
                ^^    ^^

You are printing them before initializing them.

   map { ($f,$t)=split(/\|/,$_); print "f:$f, t:$t\n"; } @tablist;


>I'm stumped.  Any help would be great.


I'm stumped as you why are you using the dual map()s instead
of simply:

   
   my @tablist = grep { s/\| \n// } <DATA>;


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


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

Date: 19 Dec 2000 00:22:41 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Please help - split question?
Message-Id: <slrn93taih.qqa.abigail@tsathoggua.rlyeh.net>

KMiller@2xtreme.net (kmiller@2xtreme.net) wrote on MMDCLXVI September
MCMXCIII in <URL:news:hxv%5.105$OH2.20081@news-west.eli.net>:
`` 
`` map { print "f:$f, t:$t\n";($f,$t)=split(/\|/,$_) } @tablist;


You first print out $f and $t, and then assign to them.

You might want to do it the other way around. Or even get rid of using
tmp variables all together:

    map {printf "f: %s, t:%s\n" => split /\|/} @tablist;


Abigail
-- 
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:


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

Date: 18 Dec 2000 23:25:48 GMT
From: The WebDragon <nospam@nospam.com>
Subject: possibly st00pid question regarding 'require'
Message-Id: <91m6ds$jpb$0@216.155.33.105>

heh :)

anyway, I was just wondering in a somewhat offhand manner.. 

I have a number of scripts that I use to process a file in different 
ways.. yet they all have a similar set of variables to import the data. 

can I dump all that 'similar' stuff into a file 'setup.pl' and have it 
all executed via a 

    require 'setup.pl'; 

which would then let me share all those common variables and their data?

or should require only be used to import various subroutines and 
whatnot?

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 19 Dec 2000 01:08:01 GMT
From: fryar386@aol.com (Fryar386)
Subject: PROBLE WITH MY SCRIPT.  PLEASE HELP!
Message-Id: <20001218200801.26530.00004937@ng-fu1.aol.com>

Ok, my script has two problems.

These are my problems

1st: Whenever my form connects to this script, it just generates a blank page 

2nd: this isn't really a problem, but I really need a locking script so people
can't run this at the same time.  

o and could ya plz e-mail me your replies (it's so hard to find the posts on
this newsgroup)

ok, here's the code:

#!/usr/local/bin/perl -Tw

# $Header: /cys/people/brenner/http/docs/web/perl5/RCS/simple#-form.cgi,v 1.5
1996/03/29 22:58:40 brenner Exp $
# Copyright (C) 1994 Steven E. Brenner
# This is a small demonstration script to demonstrate the use of 
# the cgi-lib.pl library
#10
require 5.001;
use strict;

require "./cgi-lib.pl";

MAIN:
{
  my (%input,   # The CGI data
      $text,          $field, $planet, $speed, $attack, 
#20
$health, $maxhealth, $peri, $KI, $attacks, $intel, $powerlevel, $defence,
$username);  

  # Read in all the variables set by the form
  &ReadParse(\%input);

  # Check that everything has been entered
  foreach $field (qw(username password race)) {
#30
    &CgiDie("Error: Please fill in the '$field'\n") unless defined
$input{$field};
  }
   

  # Do some processing, and print some output
  ($text = $input{'text'}) =~ s/\n/\n<BR>/g; 
#These lines show what planet the person is on
if ($input{'race'} eq "saiyan") { 
#40
($planet = "planet vageta");
}  
if ($input{'maingoal'} eq "speed") {
($speed = "25");
($attack = "10");
($defence = "10");
($KI = "100");
($powerlevel = "1000");
($peri = "5000p");
#50
($health = "100");
($maxhealth = "100");
($intel = "10");
}
if($input{'maingoal'} eq "defence") {
($speed = "10");
($attack = "10");
($defence = "25");
#60
($KI = "100");
($powerlevel = "1000");
($peri = "5000p");
($health = "100");
($maxhealth = "100");
($intel = "10");
}

if ($input{'maingoal'} eq "attack") {
#70
($speed = "10");
($attack = "25");
($defence = "10");
($KI = "100");
($powerlevel = "1000");
($peri = "5000p");
($health = "100");
($maxhealth = "100");
($intel = "10");
#80
}

if ($input{'maingoal'} eq "intel") {
($speed = "10");
($attack = "10");
($defence = "10");
($KI = "100");
($powerlevel = "1000");
($peri = "5000p");
#90
($health = "100");
($maxhealth = "100");
($intel = "25");
}
($username = $input{'username'});
print "Content-type: text/html\n\n";
open(OUT, ">$username.txt")
or die "Error, Please try later\n";
#Put File lock here  


  












print <<ENDOFTEXT;



<html>

<link rel=stylesheet href=http://paweb01.planetarion.com/planet_default.css>
<link rel=stylesheet
href=http://paweb01.planetarion.com/planet_explorer_win.css>

<head>
 <title>Thank You for Joining!</title>
</head>

<body bgcolor=#000000 text=#FFFFFF link=#FFFFCC vlink=#FFFFCC alink=#FFFFCC
leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
 
<script language="JavaScript1.2">

/*
Watermark Backgound Image Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

if (document.all)
document.body.style.cssText="background:black
url(http://members.spree.com/funngames/max_goku_ultimate/animations/instan
tgoku.gif) no-repeat fixed center center"
</script>







<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=58%>Under Construction!</td>
 <td width=36%
background=http://members.spree.com/funngames/maxgoku3/images/top_bar_midd
le.gif>
</td>
 <td width=6%<img
src=http://members.spree.com/funngames/maxgoku3/images/top_bar_right.gif
width=40 height=34 border=0></a></td>
<td width=10
background=http://members.spree.com/funngames/maxgoku3/images/border_left.
gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=10
height=4></td>

</tr>
</table>
<P>


<!-- Section body -->
<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=10
background=http://members.spree.com/funngames/maxgoku3/images/border_left.
gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=10
height=4></td>
 <td width=579><center><b> <CENTER><IMG
SRC="http://www.angelfire.com/anime2/SuperSaiyanGokusGifs/DBZ/Goku/Goku8.gif">



</CENTER></b></center></td>
 <td width=11
background=http://members.spree.com/funngames/maxgoku3/images/border_right
 .gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=11
height=4></td>
</tr>
</table>

















<!-- Section Heading -->
<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=18><img
src=http://members.spree.com/funngames/maxgoku3/images/header_left.gif width=18
height=34></td>
 <td width=100%
background=http://members.spree.com/funngames/maxgoku3/images/header_middl
e.gif><CENTER><B>Thank you for joining Max_Gokus Dragonball Z
RPG!:</B></CENTER></td>
 <td width=18><img
src=http://members.spree.com/funngames/maxgoku3/images/header_right.gif
width=18 height=34></td>
</tr>
</table>





<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
  <td width=10
background=http://members.spree.com/funngames/maxgoku3/images/border_left.
gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=10
height=4></td>
  <td width=579>
Welcome $input{'username:'}!  You are the newest member of Max_Gokus Dragonball
Z RPG!  
<P>
Your Information:
<BR>
RPG name: $input{'username'}
<BR>
Password: $input{'password'}
<BR>
E-Mail: $input{'email'}
<BR>
Special Attacl: $input{'special attack'}
<P>
Shortly you will receive an e-mail at the mail address you provded
<P>
<STRONG>Thanks for Joining Max_Gokus Dragonball Z RPG!</STRONG>
<A HREF="http://maxgoku.hypermart.net/main.html">Back to the Main Page</A>

</td>
</table></td>
  <td width=11
background=http://members.spree.com/funngames/maxgoku3/images/border_right
 .gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=11
height=4></td>

</table>





<!-- Section Heading -->
<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=18><img
src=http://members.spree.com/funngames/maxgoku3/images/header_left.gif width=18
height=34></td>
 <td width=100%
background=http://members.spree.com/funngames/maxgoku3/images/header_middl
e.gif><CENTER><B>My Power Level is:</B></CENTER></td>
 <td width=18><img
src=http://members.spree.com/funngames/maxgoku3/images/header_right.gif
width=18 height=34></td>
</tr>
</table>

<!-- Section body -->
<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=10
background=http://members.spree.com/funngames/maxgoku3/images/border_left.
gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=10
height=4></td>
 <td width=579>
<B>
<CENTER>
<A HREF="http://www.beseen.com/hc-index.html">
<IMG SRC=
"http://pluto.beseen.com/hit.counter?account=821350&font=GreenOnBlack&base=29"
BORDER=0>

</A>
</CENTER>
</B>
</td>
 <td width=11
background=http://members.spree.com/funngames/maxgoku3/images/border_right
 .gif><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=11
height=4></td>
</tr>
</table>






<!-- Bottom of Table -->
<table width=600 align=center border=0 cellpadding=0 cellspacing=0>
<tr>
 <td width=18><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/corner_bl.gif width=18
height=17></td>
 
<td width=100%
background=http://members.spree.com/funngames/maxgoku3/images/bottom_bar.g
if><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/spacer.gif width=1
height=1></td>

 <td width=18><img border=0
src=http://members.spree.com/funngames/maxgoku3/images/corner_br.gif width=18
height=17></td>
</tr>
</table>
<br>

</body>

</html>


 


 


 


 


 


 


 


 


 


 












ENDOFTEXT


print OUT <<ENDOFTEXT;
<P>
Username: $input{username}
Password: $input{password}
E-mail: $input{email}
Attacks: $input{basic1}
Main Goal: $input{maingoal}
Planet: $planet
AIM: $input{aim}
Race: $input{race}
Speed: $speed
Defence: $defence
Attack: $attack
KI: $KI
Health: $health
MaxHealth: $maxhealth
Intellegence: $intel
Peri(money): $peri
Power Level: $powerlevel
ENDOFTEXT
close(OUT)     
or warn "test.txt didn't close nicely: $!\n";  


  # Close the document cleanly.
  print &HtmlBot;
}

End of code



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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