[16208] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3620 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 11 11:10:35 2000

Date: Tue, 11 Jul 2000 08:10:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963328219-v9-i3620@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 11 Jul 2000     Volume: 9 Number: 3620

Today's topics:
    Re: Mechanics of a File Upload? <jboes@eoexchange.com>
    Re: multidimensional associative arrays <bart.lateur@skynet.be>
    Re: multidimensional associative arrays <phil.rennert@ioip.com>
    Re: multidimensional associative arrays <iltzu@sci.invalid>
        Multiple values per key <jdNOjdSPAM@syncon.ie.invalid>
    Re: Need help with scheduling tasks without Cron <Peter.Dintelmann@dresdner-bank.com>
        Perl-Access <cobroautomotive.msn@email.msn.com>
    Re: print command not found <sfox@earthlighttechnologies.com>
        question regarding file locking <thaenel@one.net.au>
        qw and delimiter usage gopal_bhat@my-deja.com
        Redirect External Program's output on Windows ? joerg@sql.de
        Redirect External Program's output on Windows ? joerg@sql.de
        Redirect External Program's output on Windows ? joerg@sql.de
        Redirect External Program's output on Windows ? joerg@sql.de
    Re: rookie:delete <tags> in xml files? (Tad McClellan)
    Re: Syntax? system("copy $src_dir $tgt_dir") dejafcarlet@my-deja.com
    Re: The problem of two Submit buttons <zakm@datrix.co.za>
    Re: The problem of two Submit buttons <flavell@mail.cern.ch>
    Re: The problem of two Submit buttons (Steve Revilak)
    Re: The problem of two Submit buttons <bart.lateur@skynet.be>
    Re: this newsgroup <care227@attglobal.net>
    Re: Unique Items (Sam Holden)
    Re: Unique Items <iltzu@sci.invalid>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Jul 2000 10:48:13 -0400
From: Jeff Boes <jboes@eoexchange.com>
Subject: Re: Mechanics of a File Upload?
Message-Id: <396b3419$0$1505$44a10c7e@news.net-link.net>

Matthew Jochum wrote:
> 
> Hey All,
>     I was wondering how the file upload process works?  What protocol
> the server uses to read the file on a remote computer.  How the bytes
> are transfered, etc etc...


I think it's important to note (beyond things pointed out elsewhere in
this thread) that the browser and the web server are doing the work, not
so much the CGI program. You can build a form like this:

<html><head></head><body>
<form action="/cgi-bin/nosuchscript.cgi">
<input type="file"><input type="submit"></form>
</body></html>

Then load up this page, select a 20 meg file from your hard drive, and
submit it. The browser will grind away for whatever time it takes to
upload the file, then the server will store it in some temp directory.
Finally, the specified program gets called. And of course in this
example, there's no program found, so it bombs. Your program never gets
control of the upload process until the point where the file is already
on the server. This is important, because the second question people ask
(after #1, "how do I do a file upload?") is usually, "How do I prevent
the user from uploading a large file/a binary file/a file I already
have?" And you can't, at least not from your CGI program. Oh, you can
refuse to accept it from the server, but by the time your code is
running, the file is already uploaded, and has eaten up whatever
bandwidth it's going to eat, and occupies space on your server (and
we'll assume that your server is correctly configured to reclaim this at
some point).


-- 
Jeff Boes        |Computer science is no more about   
|jboes@eoexchange.com
Sr. S/W Engineer |computers than astronomy is about    |616-381-9889 ext
18
Change Technology|telescopes. --E. W. Dijkstra         |616-381-4823 fax
EoExchange, Inc. |                                    
|www.eoexchange.com


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

Date: Tue, 11 Jul 2000 15:29:30 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: multidimensional associative arrays
Message-Id: <388mmsovckle7do1tcfukppbcpoak1g50m@4ax.com>

Ala Qumsieh wrote:

>Let's get terminology correct first. Hashes have keys and corresponding
>values. The important thing to remember is 
>
>	"Keys and values have to be scalars."

The second rule is:

	"Keys are treated as strings."

It doesn't apply here, but it's a good rule to remember, anyway.

-- 
	Bart.


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

Date: Tue, 11 Jul 2000 08:57:17 -0400
From: Philip Rennert <phil.rennert@ioip.com>
Subject: Re: multidimensional associative arrays
Message-Id: <396B19AD.904FEF90@ioip.com>

Okay, thanks, but how do you fix the second index ?
(Say $a is two-dimensional and I want all elements of the form $a{whatever}{6})

Abigail wrote:

> Philip Rennert (phil.rennert@ioip.com) wrote on MMDV September MCMXCIII
> in <URL:news:3969DFA5.B7BE6B5E@ioip.com>:
> __ When I have a multidimensional array, it's easy to fix one index and
> __ iterate on another:
> __
> __ for($j=1;$j<=$n;$j++)
> __     {
> __
> __     code involving $a[6][$j]
> __
> __     }
>
> That's horrid, and anti-Perl.
>
>     foreach my $element (@{$a [6]}) { ... }
>
> __ but what's a good way to do that with associative arrays, other than the
> __ kludgey:
> __
> __ foreach( keys %a)
> __     {
> __     if not (/^Fred/){next}
> __
> __     code involving $a{$_}  to deal with only elements of the form
> __ $a{"Fred"}{whatever}
> __
> __ (also this assumes "Fred" doesn't occur in another index or in longer
> __ form in the first)
> __
> __     }
>
> Once you know the Perl way of doing the nested array, nested hashes
> are trivial.
>
>     foreach my $key (keys %{$a {Fred}}) { ... }
>
> or
>
>     while (my ($key, $value) = each %{$a {Fred}}) { ... }
>
> Abigail
> --
> sub J::FETCH{Just   }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
> sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
> sub P::FETCH{Perl   }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
> sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}



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

Date: 11 Jul 2000 13:57:31 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: multidimensional associative arrays
Message-Id: <963323269.29968@itz.pp.sci.fi>

In article <388mmsovckle7do1tcfukppbcpoak1g50m@4ax.com>, Bart Lateur wrote:
>Ala Qumsieh wrote:
>>
>>	"Keys and values have to be scalars."
>
>	"Keys are treated as strings."

<nitpicking> s/treated as/turned into/ </nitpicking>

Depending on how you interpret them, there may or may not be any
difference, but IMHO "turned into" makes it more obvious that once
you've made a hash key out of, say, a hard reference, turning the key
back into a reference is a task comparable to putting Humpty Dumpty
back together again..

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.



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

Date: Tue, 11 Jul 2000 06:05:29 -0700
From: deno <jdNOjdSPAM@syncon.ie.invalid>
Subject: Multiple values per key
Message-Id: <084e78f4.86656db9@usw-ex0105-035.remarq.com>



The following is meant yo update a db, for some reason (which I
cannot figure out) only $dname is being pushed into the database.

Any1 got any ideas.

Thanks.



$mail_sent_total 	= '0';
$mailsent		= '0';
$sendtime		= '0000000000';
$response		= '0';
$mailsys		= 'no_answer';
$recv_time	= '0000000000'


tie %h, 'DB_File', 'DN_Status', O_CREAT|O_RDWR, 0640, $DB_HASH
or die "Cannot open database file: $!\n";

while (<DOMAIN_NAMES>)
	
	{
	
	($dname) = map {s/^\s+//;	# read domain into dname
	s/\s+$//;			# and trim whitespace
	$_} split("\n");
	

 	if (exists $h{$dname}) {print "Record already exists for
= $dname - skipping\n"}
	
else 	
	
	{
 	
	print " \nAdding new record for - $dname\n";
	
	push (@{$h {$dname}}, $mailsent, $sendtime, $response,
$mailsys, $recv_time );

untie %h






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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Tue, 11 Jul 2000 13:24:35 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Need help with scheduling tasks without Cron
Message-Id: <8kf05q$m1s1@intranews.dresdnerbank.de>

    Hi,

pastan@my-deja.com schrieb in Nachricht <8keafg$tbd$1@nnrp1.deja.com>...
> I don't have an opportunity to use Cron or similar features. How can I
>implement scheduling by means of Perl functions such as fork, kill,...?

    from time() you know the current time.
    Since you know when to execute your job
    just sleep() the difference.

    Best regards,

        Peter Dintelmann





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

Date: Tue, 11 Jul 2000 11:06:15 -0400
From: "Gary Cohen" <cobroautomotive.msn@email.msn.com>
Subject: Perl-Access
Message-Id: <OY7LBk06$GA.279@cpmsnbbsa07>

I am trying to use a MS-Access database for a project I am doing in
university along with perl.

I am using OLE and everything works great when I test it offline. However,
when I am trying to put it on my server, it does not want to use the file
that it used offline.

The one difference is that on my local machine, when testing, I used an ODBC
DSN called "Cobro" and used the DSN=Cobro in my connection string.

Online, i am trying to do DSN=d:/webpath/...
The physical location of the file.

Does anyone know a possible error in the following code?

#vallogin.pl  : Used to validate the login

use CGI qw(:standard);
use OLE;

$conn = CreateObject OLE "ADODB.Connection";
$rs=CreateObject OLE "ADODB.Recordset";
$rsProd = CreateObject OLE "ADODB.Recordset";
$rsUpdate= CreateObject OLE "ADODB.Recordset";
$conn->Open("Provider=Microsoft.Jet.OLEDB.3.51; DSN=d:\webserver\....;
UID=;PWD=");
$sql = "SELECT * FROM Members";
$rs = $conn->Execute($sql);

I removed the actual DSN as I know the path is okay, have done it before
using ASP.

Gary




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

Date: Tue, 11 Jul 2000 09:09:04 -0500
From: "Cheeby" <sfox@earthlighttechnologies.com>
Subject: Re: print command not found
Message-Id: <8kf9nd$qpf$1@jair.pressenter.com>

I got it to work.  There was a space in front of my shebang line - hard to
discern with this text editor/font.  Thanks for all your timely help.

Much appreciated.

Cheeby


Cheeby <sfox@earthlighttechnologies.com> wrote in message
news:8kdgmv$rhi$1@jair.pressenter.com...
> I'm running through the O'Reilly book, Learning Perl and am stuck on the
> Hello, World example...
>
> (on SuSE 6.4)
>
> #!/usr/bin/perl
>
> print "What is your name?";
> $name = <STDIN>;
> chomp ($name);
> print "Well, hello, $name!\n";
>
> I've saved it as sample.pl, made it executable with chmod +x and when I
run
> it I get
>
> ./sample.pl: print: command not found
> ./sample.pl: line 6: syntax error near unexpected token ';'
> ./sample.pl: line 6: '$name = <STDIN>;'
>
> I've got Perl 5, and it does reside in /usr/bin/perl
>
> Any advice?  Thanks,
>
> Cheeby
>
>
>




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

Date: Tue, 11 Jul 2000 23:19:28 +0800
From: Thomas Haenel <thaenel@one.net.au>
Subject: question regarding file locking
Message-Id: <396B3AFE.98B82302@one.net.au>

Hi,
could someone tell me the best way to lock files so that only one
process at a time can read/write a file. At the moment I'm using a
simple

while ( -e "datalock" ) {sleep 1;};
 system ("touch datalock");
 open (OUTFILE, ">$REGISTER_FILE") || &Fatal_Error("Error_017"); #tell
user to contact admin

  $line  = "data";
  print OUTFILE $line;
 }
 close(OUTFILE);
 system("rm datalock");

Is there a better way ?

Thanks, Tom.



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

Date: Tue, 11 Jul 2000 14:55:05 GMT
From: gopal_bhat@my-deja.com
Subject: qw and delimiter usage
Message-Id: <8kfcfv$lee$1@nnrp1.deja.com>

Hi,
	I have the following code:

#!/usr/local/bin/perl
@words=qw/This is a list of words/;

foreach $j (@words)
{
        print("\n $j \n");
}

	This serves the purpose of splitting (split()).. But I would like to
get the following working:

#!/usr/local/bin/perl
chomp($i=<STDIN>);
@words=qw/$i/;

foreach $j (@words)
{
        print("\n $j \n");
}

	This fails because 'qw' construct uses '$i' itself as a element in the
array instead of interpolating it.  Is there any way I can acheive this
without using regular expressions or 'split'.
	This is one of my perl class assignments. Any help will be appreciated.
Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 13:14:29 GMT
From: joerg@sql.de
Subject: Redirect External Program's output on Windows ?
Message-Id: <8kf6j5$gmr$1@nnrp1.deja.com>

Dear Perl users,

I ask for hints when porting a Perl program from Unix to Win32:

I need to call external programs that write to their "standard
output", but I need to keep that text in files.
I would prefer to include "standard error" with the output.

On Unix, I call "system" with a string parameter that contains
redirection characters:
   system "program arg1 arg2 > result"
or even
   system "program arg1 arg2 > result 2>&1"
which does exactly what I want.

On Windows NT 4.0 (service pack 5), this fails with both
- "cmd.exe": complains about "syntax error"
- "zsh": passes both ">" and "result" as 3rd + 4th arg to "program"
  (I had to re-write the call to
      system "program" , "arg1 arg2 > result"
  because the original line had used "program" twice - as the
  binary to execute, and as an additional first parameter!)


What is the best way to achieve the desired effect ?

AFAIK, "cmd" does support redirection of standard output;
"zsh" definitely does (and it works when using the command line).

Is it a known effect that the "program" must be separated
from the arguments when using "system" on Windows ?
(It works as one string on Unix and in
   open ( FILE, "program args |" )
but fails in "system".)


Additional information:
- I use "ActivePerl" 5.6.0
- The programs to be called are generated in a MinGW environment,
  they are ".exe" binaries.
- I use the "PERL5SHELL" environment variable to set the command
  interpreter to use.

I post via Deja because my local server does not carry this group;
please keep the title so that I can search for your answers
(or even mail me a copy - thanks!).

Regards and Thanks,
Joerg Bruehe

--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)
mailto: joerg@sql.de


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 13:11:22 GMT
From: joerg@sql.de
Subject: Redirect External Program's output on Windows ?
Message-Id: <8kf6db$glc$1@nnrp1.deja.com>

Dear Perl users,

I ask for hints when porting a Perl program from Unix to Win32:

I need to call external programs that write to their "standard
output", but I need to keep that text in files.
I would prefer to include "standard error" with the output.

On Unix, I call "system" with a string parameter that contains
redirection characters:
   system "program arg1 arg2 > result"
or even
   system "program arg1 arg2 > result 2>&1"
which does exactly what I want.

On Windows NT 4.0 (service pack 5), this fails with both
- "cmd.exe": complains about "syntax error"
- "zsh": passes both ">" and "result" as 3rd + 4th arg to "program"
  (I had to re-write the call to
      system "program" , "arg1 arg2 > result"
  because the original line had used "program" twice - as the
  binary to execute, and as an additional first parameter!)


What is the best way to achieve the desired effect ?

AFAIK, "cmd" does support redirection of standard output;
"zsh" definitely does (and it works when using the command line).

Is it a known effect that the "program" must be separated
from the arguments when using "system" on Windows ?
(It works as one string on Unix and in
   open ( FILE, "program args |" )
but fails in "system".)


Additional information:
- I use "ActivePerl" 5.6.0
- The programs to be called are generated in a MinGW environment,
  they are ".exe" binaries.
- I use the "PERL5SHELL" environment variable to set the command
  interpreter to use.

I post via Deja because my local server does not carry this group;
please keep the title so that I can search for your answers
(or even mail me a copy - thanks!).

Regards and Thanks,
Joerg Bruehe

--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)
mailto: joerg@sql.de


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 13:13:52 GMT
From: joerg@sql.de
Subject: Redirect External Program's output on Windows ?
Message-Id: <8kf6i0$gme$1@nnrp1.deja.com>

Dear Perl users,

I ask for hints when porting a Perl program from Unix to Win32:

I need to call external programs that write to their "standard
output", but I need to keep that text in files.
I would prefer to include "standard error" with the output.

On Unix, I call "system" with a string parameter that contains
redirection characters:
   system "program arg1 arg2 > result"
or even
   system "program arg1 arg2 > result 2>&1"
which does exactly what I want.

On Windows NT 4.0 (service pack 5), this fails with both
- "cmd.exe": complains about "syntax error"
- "zsh": passes both ">" and "result" as 3rd + 4th arg to "program"
  (I had to re-write the call to
      system "program" , "arg1 arg2 > result"
  because the original line had used "program" twice - as the
  binary to execute, and as an additional first parameter!)


What is the best way to achieve the desired effect ?

AFAIK, "cmd" does support redirection of standard output;
"zsh" definitely does (and it works when using the command line).

Is it a known effect that the "program" must be separated
from the arguments when using "system" on Windows ?
(It works as one string on Unix and in
   open ( FILE, "program args |" )
but fails in "system".)


Additional information:
- I use "ActivePerl" 5.6.0
- The programs to be called are generated in a MinGW environment,
  they are ".exe" binaries.
- I use the "PERL5SHELL" environment variable to set the command
  interpreter to use.

I post via Deja because my local server does not carry this group;
please keep the title so that I can search for your answers
(or even mail me a copy - thanks!).

Regards and Thanks,
Joerg Bruehe

--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)
mailto: joerg@sql.de


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 13:12:03 GMT
From: joerg@sql.de
Subject: Redirect External Program's output on Windows ?
Message-Id: <8kf6ek$gln$1@nnrp1.deja.com>

Dear Perl users,

I ask for hints when porting a Perl program from Unix to Win32:

I need to call external programs that write to their "standard
output", but I need to keep that text in files.
I would prefer to include "standard error" with the output.

On Unix, I call "system" with a string parameter that contains
redirection characters:
   system "program arg1 arg2 > result"
or even
   system "program arg1 arg2 > result 2>&1"
which does exactly what I want.

On Windows NT 4.0 (service pack 5), this fails with both
- "cmd.exe": complains about "syntax error"
- "zsh": passes both ">" and "result" as 3rd + 4th arg to "program"
  (I had to re-write the call to
      system "program" , "arg1 arg2 > result"
  because the original line had used "program" twice - as the
  binary to execute, and as an additional first parameter!)


What is the best way to achieve the desired effect ?

AFAIK, "cmd" does support redirection of standard output;
"zsh" definitely does (and it works when using the command line).

Is it a known effect that the "program" must be separated
from the arguments when using "system" on Windows ?
(It works as one string on Unix and in
   open ( FILE, "program args |" )
but fails in "system".)


Additional information:
- I use "ActivePerl" 5.6.0
- The programs to be called are generated in a MinGW environment,
  they are ".exe" binaries.
- I use the "PERL5SHELL" environment variable to set the command
  interpreter to use.

I post via Deja because my local server does not carry this group;
please keep the title so that I can search for your answers
(or even mail me a copy - thanks!).

Regards and Thanks,
Joerg Bruehe

--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
     (speaking only for himself)
mailto: joerg@sql.de


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 09:26:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: rookie:delete <tags> in xml files?
Message-Id: <slrn8mm84m.379.tadmc@magna.metronet.com>

On Tue, 11 Jul 2000 11:09:10 +0200, JENS KNOBLOCH <jensknobloch@web.de> wrote:

>How can I delete text between special <tags> in a xml-file with a
>perl-script??


By parsing the XML.

XML::Parser   or   XML::DOM   modules can parse XML.


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


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

Date: Tue, 11 Jul 2000 13:01:59 GMT
From: dejafcarlet@my-deja.com
Subject: Re: Syntax? system("copy $src_dir $tgt_dir")
Message-Id: <8kf5rs$g78$1@nnrp1.deja.com>

In article <8kd3ak$lrc$1@brokaw.wa.com>,
  "Lauren Smith" <lauren_smith13@hotmail.com> wrote:
>
> <dejafcarlet@my-deja.com> wrote in message
> news:8kd1v2$ved$1@nnrp1.deja.com...
> > Can anyone know why the system command does not worK?  I'm runing on
NT
> > 4.0.
> > *****************************************
> >
> >  print "ntf = $ntf  copying $source_dir to $target_dir  \n";
> >  system("copy $source_dir $target_dir");
> >
> > *****************************************
> > source file = CONFIG.SYS      # first file to copy
> >   copying c:/src to c:/tgt   # source and target resolved
> >
> > error message received
> > The syntax of the command is incorrect
>
> That is not a Perl error.  And besides, you don't really want to spawn
a
> separate process for each file that you copy.
>
> Do yourself a favor and see the documentation for File::Copy.  You'll
be
> glad you did.
>
> Lauren
>
>

Thank you Erick and Lauren,

  I was mistaken regarding forward slash as an alternative to back slash
in DOS.

Forrest


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 11 Jul 2000 12:11:52 +0200
From: Zak McGregor <zakm@datrix.co.za>
Subject: Re: The problem of two Submit buttons
Message-Id: <396AF2E8.FDEE388F@datrix.co.za>

Senthil Raja wrote:

> Lets say I have a form with name="training"
> and in that form I have two submit buttons like,
>
> <input type=submit name=add value=ADD>
> <input type=submit name=remove value=REMOVE>
>
> In my CGI script I need to identify which submit button
> submitted the form because based upon the button that submitted
> the form I need to perform different actions.

Last time I checked, comp.lang.perl.misc was *not* a symbolic link to
alt.silly.cgi.questions - please take this question to the appropriate
newsgroup, alt.www.authoring or some such.




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

Date: Tue, 11 Jul 2000 12:26:50 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: The problem of two Submit buttons
Message-Id: <Pine.GHP.4.21.0007111224560.15622-100000@hpplus03.cern.ch>

On Tue, 11 Jul 2000, Senthil Raja wrote:

> In my CGI script I need to identify which submit button
> submitted the form 

FAQ.  http://www.htmlhelp.org/faq/html/forms.html#two-submit

Not a Perl language question - f'ups set



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

Date: Tue, 11 Jul 2000 09:25:18 -0400
From: revilak@umbsky.cc.umb.edu (Steve Revilak)
Subject: Re: The problem of two Submit buttons
Message-Id: <1edlm3z.1442drx1eta0cyN@svr01-p12.ppp.umb.edu>

Senthil Raja <senthil.raja@adcc.alcatel.be> wrote:

> In my CGI script I need to identify which submit button
> submitted the form because based upon the button that submitted
> the form I need to perform different actions.

That isn't a perl question :-)
 
> How do I do that?

See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2


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

Date: Tue, 11 Jul 2000 15:50:27 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: The problem of two Submit buttons
Message-Id: <jb9mmssfeab4uhrjvbbf09i13f1c64mvlv@4ax.com>

Senthil Raja wrote:

><input type=submit name=add value=ADD>
><input type=submit name=remove value=REMOVE>
>
>In my CGI script I need to identify which submit button
>submitted the form because based upon the button that submitted
>the form I need to perform different actions.
>
>How do I do that?

Oh, gee, why don't you try it. Make a HTML form, forget about ACTION or
METHOD, and put this HTML snippet inside the form. Save locally, launch
the file. Now click on a button. What do you see?

-- 
	Bart.


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

Date: Tue, 11 Jul 2000 09:55:18 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: this newsgroup
Message-Id: <396B2746.5BA680BC@attglobal.net>

Abigail wrote:
> 
> Day (reui@fdd.ff) wrote on MMDV September MCMXCIII in
> <URL:news:8kdm15$iho$9@sunce.iskon.hr>:
> ,,
> ,, What for exactly is this news group?
> 
> To discuss the effect of broken beaks on the sexlife of woodpeckers.
> 
> Except for the red-tailed European woodpecker, who has its own subgroup.
> 
> And the moderated group is for the R and X rated stuff.

I thought all the X rated stuff was sent over the P5P mailing list?


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

Date: 11 Jul 2000 10:08:37 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Unique Items
Message-Id: <slrn8mlsh5.r6h.sholden@pgrad.cs.usyd.edu.au>

On Tue, 11 Jul 2000 09:40:43 GMT,
	philhibbs@my-deja.com <philhibbs@my-deja.com> wrote:
>So, what does this do:
>
>@out = grep(!$saw{s/(.*)/xxx$1/}++, @in);
>
>I expected (hoped) that it would create an array of unique items,
>with "xxx" prepended to each.

From the perlop description of s//

	... returns the number of substitutions made

So each element of @in will have 'xxx' prepended (since s// will modify the
original values). Each substition will return 1 and so $saw{1} will be
incremented. Assuming $saw{1} is undefined or numerically zero, the first
modified element of @in will be copied into @out.

Unless someone has done some operator overloading or tying or @in is _really_
_really_ big at most one element is going to end up in @out.

-- 
Sam

So I did some research. On the Web, of course. Big mistake...
	--Larry Wall


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

Date: 11 Jul 2000 11:24:08 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Unique Items
Message-Id: <963314334.14995@itz.pp.sci.fi>

In article <slrn8mlsh5.r6h.sholden@pgrad.cs.usyd.edu.au>, Sam Holden wrote:
>On Tue, 11 Jul 2000 09:40:43 GMT,
>	philhibbs@my-deja.com <philhibbs@my-deja.com> wrote:
>>
>>@out = grep(!$saw{s/(.*)/xxx$1/}++, @in);
>
>Unless someone has done some operator overloading or tying or @in is _really_
>_really_ big at most one element is going to end up in @out.

I'd say the size of @in is irrelevant.  Even if there could be an
array big enough to cause integer arithmetic overflow - I assume this
is what you were thinking of - the "integer" pragma is not turned on
(at least as far as we can know) so perl would just increment the hash
value literally up to infinity (+inf to be exact).

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.




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

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


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