[12971] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 381 Volume: 9

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

Date: Thu, 5 Aug 1999 08:05:11 -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: 381

Today's topics:
    Re: => only in hash initialization? (WAS: mySQL & Perl  <perlking@hotmail.com>
    Re: [offtopic]RE:Quot St and the Jeop Gm <tchrist@mox.perl.com>
    Re: Autovivification? (Abigail)
    Re: can Perl send e-mail with attached files? <ron_savage@non-hp-australia-om5.om.hp.com>
        Capturing Browser Data <anonymous@web.remarq.com>
    Re: Complex data structure julmajuha@my-deja.com
        Emacs info format Perl manual ambient@my-deja.com
        Expect.pm usage trouble <dannn@somewhere.in.time>
        Hackers and Gurus and Wizards <tchrist@mox.perl.com>
    Re: Hackers and Gurus and Wizards (Abigail)
    Re: How to create "function pointers"? <ron_savage@non-hp-australia-om5.om.hp.com>
        how to match this pattern? (Roman Blöth)
    Re: how to substitute strings in a newly created file (Anno Siegel)
    Re: How to turn off cashing in perl??? (Bart Lateur)
    Re: How to turn off cashing in perl??? (Benjamin Franz)
    Re: Need some PERL/CGI thinkers please! (Steve Manes)
    Re: NT Apache Perl <kperrier@blkbox.com>
    Re: NT Apache Perl (Andreas Fehr)
        passing IO handle in reference to hash? <mwood@mhw.ULib.IUPUI.Edu>
    Re: passing IO handle in reference to hash? <tchrist@mox.perl.com>
        POST via an Imagemap - How? <cmeilahn@nauiww.org>
        POST via Imagemap - How? <cmeilahn@nauiww.org>
    Re: Problem reading forms with perl genelong@my-deja.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 05 Aug 1999 09:05:04 EDT
From: "Perl King" <perlking@hotmail.com>
Subject: Re: => only in hash initialization? (WAS: mySQL & Perl -> Something simple)
Message-Id: <19990805130504.64945.qmail@hotmail.com>

Larry Rosler <lr@hpl.hp.com> says...
>Perl King <perlking@hotmail.com> says...
>>open PW => '/etc/passwd'; # Vorausgehenproblem!
>
>This seems like a classic case of TMTOWTDI, in this case involving
>nothing but taste and judgment, on which we can all differ.

A little exercise:

% perl
open PW, '/etc/passwd';

% perl
open PW => '/etc/passwd';
Precedence problem: open PW should be open(PW) at - line 1.

Perl King (again decrees to use => only in hash initialization)


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com


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

Date: 5 Aug 1999 07:32:36 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <37a99274@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net> writes:
:Tom Christiansen wrote:
:> 3) Your message was illegal: it was missing a mandatory header.
:Which one's that? (Is my posting missing it, too?)

It had been lacking a subject line.  I restored it.

--tom
-- 
Someone who truly understands Unix not only understands why "rm *"    
screws you, but understands why IT HAS TO BE THAT WAY.


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

Date: 5 Aug 1999 09:31:30 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Autovivification?
Message-Id: <slrn7qj80t.ucg.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCLXV September MCMXCIII in
<URL:news:37ad2b32.1905128@news.skynet.be>:
$$ Uri Guttman wrote:
$$ 
$$ >you don't run with use strict in general?
$$ 
$$ No. Especially not in one-off scripts, whuich is... most of them. See
$$ the eternal discussion of why "strict" is not the standard option for
$$ Perl, i.e. why YOU have to turn it on, explicitely.


The only time I don't use "use strict;", is when I use -e.

Anything that's complicated enough to put in a file gets use strict.
Regardless whether it's going to be run once or multiple times.



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: Thu, 5 Aug 1999 16:20:47 +1000
From: "Ron Savage" <ron_savage@non-hp-australia-om5.om.hp.com>
Subject: Re: can Perl send e-mail with attached files?
Message-Id: <7obav6$mqc$1@ocean.cup.hp.com>

For a tutorial, see

    http://savage.net.au/Perl-tutorials.html

--
Cheers
Bus: rons@hpaco.aus.hp.com
Home: ron@savage.net.au
http://savage.net.au/




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

Date: Thu, 05 Aug 1999 06:10:35 -0800
From: Samay <anonymous@web.remarq.com>
Subject: Capturing Browser Data
Message-Id: <933862238.8029@www.remarq.com>

Hi,
I would like to write simple perl script (may be
complicated) which deals with my surfing the Internet.
ie.. It can take the browser URL, URL visit time, the
content, links etc..and produce result or messages.
Let's say If I have been looking for perticular word in the
URL or text it will highlight it and will give me an alert
message,and will go to that place in the page and will add
that URL to my URL file.. This is just a sample application.
This falls in the category of "as I surf". More
applications can be developed based on this principle.

I think Win32::OLE and WSH can be helpful in this..
Any pointers will be useful

Thank You
Samay





* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


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

Date: Thu, 05 Aug 1999 14:22:25 GMT
From: julmajuha@my-deja.com
Subject: Re: Complex data structure
Message-Id: <7oc6mk$bgl$1@nnrp1.deja.com>

In article <FFzL6I.1yH@csc.liv.ac.uk>,
  ijg@connect.org.uk (I.J. Garlick) wrote:
> Why?
> 	$Codes{$Comp} = [123, 321, 345, 543];
>
> does what you want. (don't know about the speed difference but gut
feeling
> is that this should be faster.)

The the real program the data is read from a file.
This example was made just to point the problem.

I realize it was a newbie question. I did read the ... document,
but I missed the point that {...} is a dereference operator.
Just before I learned it was for blocks of code...
So here it means same as * in C, am I right?

Thanks also for Derek Thomson for helping.

>
> 	map {print "Code = $_\n"} @{$Codes{$Comp}};

That I have to contemplate next.

Juha Manninen


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


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

Date: Thu, 05 Aug 1999 13:18:27 GMT
From: ambient@my-deja.com
Subject: Emacs info format Perl manual
Message-Id: <7oc2uo$8fa$1@nnrp1.deja.com>

Can anyone direct me to the Emacs info format Perl manual
for a recent Perl release?  The most recent I've been able to
find is for 5.004.


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


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

Date: Thu, 05 Aug 1999 08:15:28 -0400
From: dannn <dannn@somewhere.in.time>
Subject: Expect.pm usage trouble
Message-Id: <37A98060.7C347F9B@somewhere.in.time>

Hi, all

I've been trying to get my perl script to communicate with the Unix
passwd program (Solaris 2.6).  I got the Expect.pm, IO::Tty and IO::Stty
modules set up and am trying the following code snippet:

###################
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();
###################

The 'expect' functions both successfully match their criteria.  The
first 'print' statement seems to be working correctly.  The second seems
to just disappear.  The password remains unchanged.

Unless I misunderstood the examples (which seems highly probable since
my code doesn't work =), this code should do the trick.  I would greatly
appreciate any suggestions/hints/whatever.  Thanks in advance.

dan



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

Date: 5 Aug 1999 07:49:29 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Hackers and Gurus and Wizards
Message-Id: <37a99669@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    M.Ray@ulcc.ac.uk (Malcolm Ray) writes:
:2. It devalues the term.  I suppose everyone will have their own idea
:of what constitutes Perl gurudom, but I'd suggest that a genuine Perl
:guru probably has the following attributes:
:
:	Intimate knowledge of Perl internals, possibly gained by
:	hacking on the source
:
:	Can write JAPH one-liners without breaking sweat
:
:	Can write three modules using XS before breakfast
:
:	Has a bunch of modules on CPAN
:
:	Can answer almost any Perl question without consulting the
:	documentation
:
:	Can answer almost any "what will this do?" question without
:	running the code, however gnarly

Cool.  Perhaps you'd like to inspire a revision to this.  Suggestions
welcome.

			Perl Hierarchy
			==============

   * Novice
        o Thinks CGI and Perl are interchangeable terms.
        o Still thinks Perl looks like bad C code viewed over a 
	  noisy modem.
        o Is insecure about the concept of dollar signs.
        o Thinks Perl should be more like sh or tcl.
        o Has heard of the ``Unix mindset'', but hopes it's a treatable
          condition.
        o Can't figure out how to read input from the keyboard.
        o Thinks regular expressions are somebody cursing.
        o Wonders why no one can give him a straight answer about 
	  whether Perl is compiled or interpreted.

   * Initiate
        o Has begun to learn about $_ -- and doesn't like it a bit.
        o Thinks -w flag is a waste of time.
        o Thinks Perl should be more like C++ or Java.
        o Is still trying to figure why Perl has two different kinds of
          arrays.
        o Knows how to use perlbug, but sends in bogus bug reports.
        o Has been bitten by implicit context conversions, but hasn't
          caught on yet.
        o Can't keep == separate from eq, and thinks that + should
          concatenate strings.

   * User
        o Thinks Perl is just for text processing.
        o Uses the Perl debugger.
        o Has used other people's modules.
        o Wonders what an object is.
        o Knows their way around CPAN.
        o Knows the difference between local and my.
        o Uses <DATA>.
        o Is still trying to figure what references are for.
        o Thinks Perl should be more like scheme or eiffel.
        o Submits real bug reports with perlbug.

   * Expert
        o Write JAPHs to impress their friends and annoy their coworkers.
        o Begins all programs with use strict.
        o Thinks Perl should just be Perl.
        o Has taken enough advantage of cryptocontext to annoy others.
        o Knows how to create records and objects with hash refs.
        o Uses syscall to get at undocumented operating system calls.
        o Curses the flexibility of the Perl object system.
        o Uses /e in substitutes.
        o Has begun to wonder what typeglobs are for.
        o Has written their own modules in Perl.
        o Begins to look at all data in terms of regular expressions.
        o Understands why regexes can't match nested data.
        o Rewrites minor utilities in Perl.

   * Hacker
        o Writes games in Perl.
        o Has written extension modules in C.
        o Uses AUTULOAD and closures in curious ways.
        o Appreciates the aethetics of the Schwartzian Transform.
        o Delights in the flexibility of the Perl object system.
        o Has written their own pod2XXX translator.
        o Understands the output from Perl -Dflags.
        o Accesses the Perl symbol table directly.
        o Submits bug reports with working patches.
        o Edits files using a special Perl-embedded version of vi or emacs.
        o Has contributed modules, manpages, and tools to the standard Perl
          distribution.

   * Guru
        o Can answer any Perl question instantly.
        o Can write anything in Perl -- and does.
        o Takes advantage of undocumented language features.
        o Writes code that gives even Larry pause.
        o Implements opaque objects and compiled regexes using closures.
        o Can read and understand the output of the perl-to-C compiler.
        o Embeds Perl interpreters in larger applications.
        o Has written their own -d:debugger module.
        o Used object-oriented programming before it existed.
        o Is debating taking their turn with the patch pumpkin.

   * Wizard
        o Is on a first-name basis with Larry's wife.
        o Has written or rewritten major areas in the Perl compiler or
          interpreter.
        o Is thinking about rewriting the regex engine, the memory
          allocator, or the garbage collector.
        o Doesn't write games in Perl, because they realize that Perl
          itself is the game.

That was of course patterned on the old "Unix Hierarchy" list:

		     The Unix Hierarchy
		     ==================

   * Beginner
        o insecure with the concept of a terminal
        o has yet to learn the basics of vi
        o has not figured out how to get a directory
        o still has trouble with typing after each line of input

   * Novice
        o knows that `ls' will produce a directory
        o uses the editor, but calls it `vye'
        o has heard of `C' but never used it
        o has had his first bad experience with rm
        o is wondering how to read his mail
        o is wondering why the person next to him seems to like Unix so very
          much.

   * User
        o uses vi and nroff, but inexpertly
        o has heard of regular-expressions but never seen one.
        o has figured out that `-' precedes options
        o has attempted to write a C program and has decided to stick with
          pascal
        o is wondering how to move a directory
        o thinks that dbx is a brand of stereo component
        o knows how to read his mail and is wondering
        o to read the news

   * Knowledgeable User
        o uses nroff with no trouble, and is beginning to learn tbl and eqn
        o uses grep to search for fixed strings
        o has figured out that mv(1) will move directories
        o has learned that "learn" doesn't help
        o somebody has shown him how to write C programs
        o once used sed to do some text substitution
        o has seen dbx used but does not use it himself
        o thinks that make is a only for wimps

   * Expert
        o uses sed when necessary
        o uses macro's in vi, uses ex when neccesary
        o posts news at every possible opportunity
        o write csh scripts occasionally
        o write C programs using vi and compiles with cc
        o has figured out what `&&' and '||' are for
        o thinks that human history started with '!h'

   * Hacker
        o uses sed and awk with comfort
        o uses undocumented features of vi
        o write C code with `cat >' and compiles with '!cc'
        o uses adb because he doesn't trust source debuggers
        o can answer questions about the user environment
        o writes his own nroff macros to supplement std. ones
        o write scripts for Bourne shell (/bin/sh)
        o knows how to install bug fixes

   * Guru
        o uses m4 and lex with comfort
        o writes assembly code with `cat >'
        o uses adb on the kernel while system is loaded
        o customizes utilities by patching the source
        o reads device driver source with his breakfast
        o can answer any Unix question after a little thought
        o uses make for anything that requires two or more distinct commands
          to achieve
        o has learned how to breach security but no longer needs to try

   * Wizard
        o writes device drivers with `cat >'
        o fixes bugs by patching the binaries
        o can answer any question before you ask
        o writes his own troff macro packages
        o is on first-name basis with Dennis, Bill, and Ken

My geekspeak summarizer reports the following semantic landmines
awaiting winkiddies who try to interprete the terms above:

  o When I say hacker, I mean what you would call coder, but for you
    hacker means what I would call cracker or criminal or script kiddie.

  o When I say guru, I mean what you would call god, but for you guru
    means what I would call wizard.

  o When I say wizard, I mean what you would call guru, but for you
    wizard means what I would call GUI annoyance.

--tom
-- 
"There are no personal problems which cannot be solved through suitable 
 application of high explosives."


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

Date: 5 Aug 1999 09:28:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Hackers and Gurus and Wizards
Message-Id: <slrn7qj7rf.ucg.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXV September
MCMXCIII in <URL:news:37a99669@cs.colorado.edu>:
##      [courtesy cc of this posting mailed to cited author]
## 
##    * Hacker
##         o Writes games in Perl.
##         o Has written extension modules in C.
##         o Uses AUTULOAD and closures in curious ways.
                     ^O
##         o Appreciates the aethetics of the Schwartzian Transform.
##         o Delights in the flexibility of the Perl object system.
##         o Has written their own pod2XXX translator.
##         o Understands the output from Perl -Dflags.
##         o Accesses the Perl symbol table directly.
##         o Submits bug reports with working patches.
##         o Edits files using a special Perl-embedded version of vi or emacs.
##         o Has contributed modules, manpages, and tools to the standard Perl
##           distribution.



Abigail
-- 
Expert, with some of Guru and a slight pitch of 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: Thu, 5 Aug 1999 16:27:45 +1000
From: "Ron Savage" <ron_savage@non-hp-australia-om5.om.hp.com>
Subject: Re: How to create "function pointers"?
Message-Id: <7obbc8$n28$1@ocean.cup.hp.com>

TMTOWTDI (Tested code):

#!perl -w
#
# Name:
# evalDemo.pl.
#
# Purpose:
# Demonstrate using eval{} to call a sub.

use integer;
use strict;

# --------------------------------------------

sub one
{
 my($input) = @_;

 ($input, 2 * $input);
}

# --------------------------------------------

sub two
{
 my($input) = @_;

 ($input, 2 * $input);
}

# --------------------------------------------

my(%hash) =
(
 'one' => 1,
 'two' => 2,
);

my(@result);

for (keys(%hash) )
{
 {
  no strict 'refs';
  eval{@result = &$_($hash{$_})};
  die($@) if ($@);
 }
 print 'Result: ', join(', ', @result), " \n";
}


--
Cheers
Bus: rons@hpaco.aus.hp.com
Home: ron@savage.net.au
http://savage.net.au/




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

Date: Thu, 05 Aug 1999 13:51:22 GMT
From: bloeth@gosub.de (Roman Blöth)
Subject: how to match this pattern?
Message-Id: <37a99604.189119820@client.ne.news.psi.net>

Dear readers,

how can I do pattern matching, if I want to extract two strings out of
a string:

I got strings like:

someword_someotherword_1.gif

but also

someword_1.gif


Now I want the first word to get into $1 and - if there's a second one
- the second one into $2. The underscores and numbers (which vary)
should not get into $1 and $2.


Any idea?


Best regards,
Roman.


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

Date: 5 Aug 1999 14:29:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to substitute strings in a newly created file
Message-Id: <7oc73q$eb9$1@lublin.zrz.tu-berlin.de>

Tom Kralidis  <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote in comp.lang.perl.misc:
>I'm writing a script to make files of directory listings.  However, I'd
>like to strip the extensions off all files listed in the new file, but
>can't seem to get the syntax correct:
>
>#!/public/bin/perl -w

One point for using -w.  One point deduction for not using strict.

>opendir FLTCOR, "fltcor" or die "can't open directory: $!";

One point for checking opendir for success.

>@rsps = grep !/^\.\.?$/, readdir FLTCOR;

There's no real need to read all of the directory into @rsps.  You
can process them just a easily one by one and reduce memory usage.

>closedir FLTCOR;
>
>open(RSP, ">rsp.list");

One point deduction for not checking if open worked.

>print RSP "@rsps";

Here you write the complete contents of your directory (sans . and ..)
to rsp.list, blank separated with nary a linefeed.  Not to mention that
no extension stripping has been done at this point.

>while (<>)

Look up what the empty filehandle does.

>{
>s/.*txt.*//g; # extension to be removed is ".txt"

If this regular expression ever gets to see a line, it will reduce it
to emptiness if it contains 'txt' anywhere.  I don't think that's what
you want.

>}
> 
>The script seems to run into infinity at this point, the file is
>created, however.

No.  Assuming you called the script with no arguments, it's waiting
for input from the keyboard.

>Any ideas?

The following will put the filenames minus extension on a line each
in rsp.list.  You'll get an empty line if a file is extension only.

#!/usr/bin/perl -w
use strict;

my $dir = 'fltcor';
my $list = 'rsp.list';

opendir FLTCOR, $dir or die "Can't open directory $dir: $!\n";
open RSP, ">$list" or die "Can't write $list: $!\n";
while ( $_ = readdir( FLTCOR) ) {
  next if m/^\.\.?$/;  # don't process . and ..
  s/\.[^.]+$//;        # crush extension
  print RSP "$_\n";
}
__END__

Anno


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

Date: Thu, 05 Aug 1999 13:11:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to turn off cashing in perl???
Message-Id: <37ab77c4.21504840@news.skynet.be>

I.J. Garlick wrote:

>Unknown option: q
>perldoc [options] PageName|ModuleName|ProgramName...
>perldoc [options] -f BuiltinFunction
>
>So when was perldoc updated?
>What version of Perl do I need?
>If it's earlier than 5.004_04 what went wrong with this installation?

Quite the contrary. You need 5.005.

	Bart.


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

Date: Thu, 05 Aug 1999 14:18:58 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: How to turn off cashing in perl???
Message-Id: <m3hq3.1342$9t2.72926@typhoon01.swbell.net>

In article <7o9m3i$6hq$1@nn-tk001.ocn.ad.jp>, Scott <codeman@gol.com> wrote:
>Dear Sir/Madame,
>
>I am working on a project in Japan at the moment and
>live in Tokyo. I am having trouble with the code as it
>keeps going to the cache and I want it to refresh on the
>first time around.
>
>I was wondering if you had any ideas about how I could
>achieve the effect of it not going to cache. I have tried
>quite a few things.

<html>
 <head>
  <title>Test</title>
 </head>
 <body>
  <form action="/cgi-bin/no-cache-test.cgi" method="POST">
   <input type="text" name="field_name" value="">
   <input type="submit" name="Go!">
  </form>
 </body>
</html>

#!/perl/bin/perl.exe -wT

use strict; 
use CGI;

my $query = new CGI;

my $field_value = $query->param('field_name');
$field_value = escapeHTML($field_value);
my $date = scalar localtime time;
print <<"EOF";
Content-Type: text/html
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Pragma: no-cache

<html>
 <head>
  <title>Test Result</title>
 </head>
 <body>
  <h1>$field_value - $date</h1>
 </body>
</html>
EOF

exit 0;

sub escapeHTML {
    my $value = shift;
    $value =~ s/&/\&amp;/g;
    $value =~ s/>/\&gt;/g;
    $value =~ s/</\&lt;/g;
    $value =~ s/"/\&quot;/g;

    $value;
}


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

Date: Thu, 05 Aug 1999 13:39:28 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: Need some PERL/CGI thinkers please!
Message-Id: <37a99222.382055@news.panix.com>

On Thu, 5 Aug 1999 00:29:13 -0500, "Kevin Alexander"
<kalexa2@_NOSPAM_mindspring.com> wrote:

>Any suggestions as to why?

Is this the entire script?  Where's the HTML <FORM>...</FORM> block?
For that matter, it's always good practice to set up a CGI HTML page
properly with <HTML><HEAD> and <BODY> tags.

Also, you should be running with at least 'perl -w', especially if
you're going to be setting variables from external data.  It will save
you much debugging time.




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

Date: 05 Aug 1999 08:44:50 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: NT Apache Perl
Message-Id: <8E4ADDA0266FE6EF.AF0FC8DA573DCA89.A751A6B03B74D4BD@lp.airnews.net>

"rezn8" <saxbourne@yahoo.com> writes:

> 
> What would be a correct #! if the Perl.exe is in
> e:\usr\bin\win32-x86\perl.exe?

windoze does not under the shebang syntax (that is what the #! is
called).   Perhaps you should go back and read the documentation
that came with your perl distribution to find out how to make it
work under your os.

Kent

PS.  Note that this is the generally accepted quoting style on usenet.


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

Date: Thu, 05 Aug 1999 14:20:26 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: NT Apache Perl
Message-Id: <37a99d64.32390344@news.uniplus.ch>

On 05 Aug 1999 08:44:50 -0500, Kent Perrier <kperrier@blkbox.com>
wrote:

>windoze does not under the shebang syntax (that is what the #! is
>called).   Perhaps you should go back and read the documentation
>that came with your perl distribution to find out how to make it
>work under your os.

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

Andreas


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

Date: 5 Aug 1999 13:35:19 GMT
From: "Mark H. Wood" <mwood@mhw.ULib.IUPUI.Edu>
Subject: passing IO handle in reference to hash?
Message-Id: <7oc3un$nac$1@hercules.iupui.edu>

I'm writing a merge program that needs to keep a zillion things all
associated with the files being merged, so I packed them all into a
couple of hashes:

       open(FILE1,"foo");
       $fyle1{handle} = FILE1;
       $fyle1{eof} = 0;
       $fyle1{buffer} = '';
       $fyle1{key} = ''; # and so on

Now I need to pass these hashes to a few subroutines.  Naked hash
names get converted to lists, so I have to pass a reference:

      get(\%fyle1);

Inside get() I have no trouble getting at most of the slots in the
hash:

	$_[0]->{eof} = 1;

But although I've played with various wrappings and other rewritings,
I can't make use of the file handle:

	$_[0]->{buffer} = <$_[0]->{handle}>;

	Can't use subscript on glob at bar line 11, near "{handle}"
	syntax error at bar line 11, near ">;"
	Execution of bar aborted due to compilation errors.

I know I've missed something that language theorists will find utterly
trivial, but what is it?  How do I write this so that the compiler
recognizes the mess inside the brokets as an IO handle?

I can easily write it like this:

	my(handle) = $_[0]->{handle};
	$_[0]->{buffer} = <$handle>;

and it works just fine, but if I can stuff the dereference inside the
brokets then I can get rid of the overhead of creating, assigning, and
destroying the local variable tens of thousands of times.  The parser
seems to be so intent on closing the broket operator that it fails to
recognize the -> as being part of the interior expression -- for
example:

	$ perl -e '$x = <${$_[0]->{handle}}>;'
	syntax error at -e line 1, at EOF
	Missing right bracket at -e line 1, within string
	Execution of -e aborted due to compilation errors.

Is there any cure?

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
A Brazil-nut is neatly packaged and tightly integrated.  To turn it into
food, you must crack and remove the shell.  I find that I feel the same   
way about an increasing number of software products.  *sigh*


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

Date: 5 Aug 1999 08:12:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: passing IO handle in reference to hash?
Message-Id: <37a99bd9@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Mark H. Wood" <mwood@mhw.ULib.IUPUI.Edu> writes:
:I'm writing a merge program that needs to keep a zillion things all
:associated with the files being merged, so I packed them all into a
:couple of hashes:
:
:       open(FILE1,"foo");

Did you localize *FILE1?

:       $fyle1{handle} = FILE1;

Probably you should store *FILE1 there instead.

:       $fyle1{eof} = 0;

I always get nervous seeing keywords there. Oh well.

:But although I've played with various wrappings and other rewritings,
:I can't make use of the file handle:
:
:	$_[0]->{buffer} = <$_[0]->{handle}>;
:
:	Can't use subscript on glob at bar line 11, near "{handle}"
:	syntax error at bar line 11, near ">;"
:	Execution of bar aborted due to compilation errors.

:I know I've missed something that language theorists will find utterly
:trivial, but what is it

From the perlop manpage:

   If the string inside the angle brackets is a reference to a scalar
   variable (e.g., <$foo>), then that variable contains the name of the
   filehandle to input from, or its typeglob, or a reference to the same.
   For example:

       $fh = \*STDIN;
       $line = <$fh>;

   If what's within the angle brackets is neither a filehandle nor
   a simple scalar variable containing a filehandle name, typeglob,
   or typeglob reference, it is interpreted as a filename pattern to
   be globbed, and either a list of filenames or the next filename in
   the list is returned, depending on context.   This distinction is
   determined on syntactic grounds alone.  That means <$x> is always a
   readline from an indirect handle, but <$hash{key}> is always a glob.
   That's because $x is a simple scalar variable, but $hash{key} is
   not--it's a hash element.

>?  How do I write this so that the compiler
:recognizes the mess inside the brokets as an IO handle?

Also from perlop:

   <FILEHANDLE> may also be spelt readline(FILEHANDLE).  See
   the readline entry in the perlfunc manpage.

So write

    $line = readline($whatever->{handle});

--tom
-- 
 "All things are possible, but not all expedient."  (in life, Unix, and perl)


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

Date: Thu, 05 Aug 1999 09:27:00 -0400
From: Carl Meilahn <cmeilahn@nauiww.org>
Subject: POST via an Imagemap - How?
Message-Id: <37A99124.6C1FC7A4@nauiww.org>

I was wondering if anyone knows a short-cut for submitting to a
cgi script (Solena Sol's db_manager.cgi) via an imagemap rather
than using the post method in a form.  The post method uses
"db_search_and_display_button" as submit's value, but I'm not
sure how to include that in the QUERY_STRING.  Something along
the lines of

/cgi-bin/directory/script.cgi?criteria1=foo&criteria2=bar&??????

Where ?????? is for the POST's SUBMIT value.  Will something like
this work?  I don't want to go in and modify the code at this
point, but I will if I must.

Background: I'm working on another use of a Search/Manager
Database script to allow searches of our affiliated dive shops
and I'd like to use imagemaps of the countries / states /
provinces, etc to make the interface user-friendly. The president
of my company wants me to have it ready by next week... he told
me this morning... so I'm in a time crunch.  Any
suggestions/direction you can provide, or a re-direction to
someone who might know an answer would be greatly appreciated.
Please email the response to me at webmaster@nauiww.org

Thanks in advance.  I simply don't have the time to fully
research this at the moment.

--Carl M.
Webmaster
NAUI Worldwide
http://www.nauiww.org/
http://www.nauitec.com/






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

Date: Thu, 05 Aug 1999 09:35:44 -0400
From: Carl Meilahn <cmeilahn@nauiww.org>
Subject: POST via Imagemap - How?
Message-Id: <37A99330.8E8DA1D6@nauiww.org>

I was wondering if you know a short-cut for submitting to a cgi
script that uses the POST method (Solena Sol's db_manager) via an
imagemap (client side) rather than using the post method in a
form.  The post method uses "db_search_and_display_button" as
submit's value, but I'm not sure how to include that in the
QUERY_STRING. I was thinking about something along the lines of:

/cgi-bin/directory/script.cgi?crietria1=foo&criteria2=bar&XXXXXX

where XXXXXX is the appropriate information for the POST method's
Submit value.  I don't want to modify the code, but I will if I
must.

Please email or CC your suggestions, responses, etc. to
webmaster@nauiww.org

Background: I'm working on another use of a Search/Manager
database to allow searches of our affiliated dive shops and I'd
like to use imagemaps of the countries/states/provinces, etc to
make the interface user-friendly. The president of my company
wants me to have it ready by next week... he told me this
morning... so I'm in a time crunch.  Any suggestions/direction
you can provide, or a re-direction to someone who might know an
answer would be greatly appreciated.

Thanks in advance. I simply don't have the time to fully reseach
this at the moment.

--Carl M.
Webmaster
NAUI Worldwide
http://www.nauiww.org/
http://www.nauitec.com/




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

Date: Thu, 05 Aug 1999 14:53:44 GMT
From: genelong@my-deja.com
Subject: Re: Problem reading forms with perl
Message-Id: <7oc8hj$ct9$1@nnrp1.deja.com>

Thanks for all the replies, but I still don't have my answer.  How can
I let a user enter all ascii characters in a form and get it into a
perl variable?

elephant, you said:
> this is WHY PEOPLE
> ARE CONSTANTLY TOLD TO USE THE CGI MODULE !!!!

Being a newbie, I don't know what that means.  Here is my html code:

<form action="http://www.shareword.com/cgi-bin/edit.pl" method="POST">
<input type="submit" name="save" value="Save"><br><textarea name="text"
rows="20" cols="72">

How do I use "the cgi module"?  Where can I get documentation on it?
Will it fix my problem?  Thanks.

Gene


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


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

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


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