[22209] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4430 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 20 00:05:36 2003

Date: Sun, 19 Jan 2003 21:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 19 Jan 2003     Volume: 10 Number: 4430

Today's topics:
    Re: cgi.pm-> cant locate object method 'save' via packa Andrew Lee
        Creating standalone application <daby55@NOSPAM.com>
    Re: Creating standalone application <daby55@NOSPAM.com>
    Re: Inlining object methods via preprocessor for effici (Ben Morrow)
    Re: Inlining object methods via preprocessor for effici <goldbb2@earthlink.net>
        is it printf/sprintf that ############ fills this ##### <istink@real.bad.com>
    Re: is it printf/sprintf that ############ fills this # <istink@real.bad.com>
    Re: is it printf/sprintf that ############ fills this # (Tad McClellan)
    Re: push @x, "a $_ b"; only $_ b is pushed <mgjv@tradingpost.com.au>
    Re: push @x, "a $_ b"; only $_ b is pushed (Tad McClellan)
    Re: push @x, "a $_ b"; only $_ b is pushed <bwalton@rochester.rr.com>
        Quick HTML/CGI/Perl Question (Kamal)
        Regex to find all words containing a single vowel? (Martin)
    Re: Regex to find all words containing a single vowel? <chang0@adelphia.net>
    Re: Regex to find all words containing a single vowel? (Tad McClellan)
    Re: Running a perl script as a windows 2000 service? <me@home.com>
    Re: Running a perl script as a windows 2000 service? <bart.lateur@pandora.be>
    Re: server and client on the same port <goldbb2@earthlink.net>
    Re: Using domain.com/?query+string and domain.com/index <flavell@mail.cern.ch>
    Re: Using domain.com/?query+string and domain.com/index (Ben Morrow)
    Re: Why can't I just open(FH, ">file.lock")? <stjm2@cam.ac.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Jan 2003 21:13:09 -0500
From: Andrew Lee
Subject: Re: cgi.pm-> cant locate object method 'save' via package
Message-Id: <96mm2vcjo9s1ch67emhnbprloouss5qae3@4ax.com>

On Sun, 19 Jan 2003 19:22:17 GMT, mUs <cmustard_!SPAM@nyc.rr.com>
wrote:

>
>I am using perl/5.6.1 on Debian/GNU Linux Woody 3.0. 
>I am unable to use the 'save' method. There is no explaination of
>having to 'import' anything in the docs, why does this fail?. 
>
><snip>
>
>#!/usr/bin/perl -lTw
>
>use CGI::Carp 'fatalsToBrowser'; # for debugging info
>use strict;
>use diagnostics;
>use CGI;
>use Fcntl;
>
>
>	   while ( !eof(COMM_OUT) ) {
>	       $get_comments = CGI->new(\*COMM_OUT); # pass handle by ref
>	       push @entries, $get_comments;
>
>	     }

How are @entries and $get_comments scoped?

>
>388	    foreach $get_comments ( @entries ) {
>389                 $get_comments->save(\*COMM_OUT);
>390             }
>
></snip>


Evidently. $get_comments is no longer a blassed hash reference to a
CGI object.  What have you done between the declaration of @entries
and here?

Again, where do you declare @entries?




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

Date: Mon, 20 Jan 2003 02:18:30 -0000
From: "Daby" <daby55@NOSPAM.com>
Subject: Creating standalone application
Message-Id: <b0fm9f$v85$1@newsg2.svr.pol.co.uk>

Are there any free tools for doing this, or cheap ones :)? I`ve come across
PerlApp which is part of the $190 ActiveState PDK. I wanted to have a play
with it but unforunately I already have a version the PDK installed to use
the debugger and the trial license has expired - although the visual
debugger stil works

DM


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003




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

Date: Mon, 20 Jan 2003 03:11:09 -0000
From: "Daby" <daby55@NOSPAM.com>
Subject: Re: Creating standalone application
Message-Id: <b0fpc6$mpg$1@newsg3.svr.pol.co.uk>

Nevermind, found one - perl2exe. Not free
"Daby" <daby55@NOSPAM.com> wrote in message
news:b0fm9f$v85$1@newsg2.svr.pol.co.uk...
> Are there any free tools for doing this, or cheap ones :)? I`ve come
across
> PerlApp which is part of the $190 ActiveState PDK. I wanted to have a play
> with it but unforunately I already have a version the PDK installed to use
> the debugger and the trial license has expired - although the visual
> debugger stil works
>
> DM
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003




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

Date: Mon, 20 Jan 2003 01:34:08 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Inlining object methods via preprocessor for efficiency (!?)
Message-Id: <b0fjmg$atn$1@wisteria.csv.warwick.ac.uk>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk> wrote in comp.lang.perl.misc:
>> richw@richw.org (Rich Wales) wrote:
>> >I wrote an object-oriented Perl program some time ago which needed
>> >to run as fast as possible.
>> 
>> Hmm, bad plan. OO is slow in Perl, as inheritance is computed at compile 
>> time.
>
>s/compile time/run time/, I suppose.

D'oh!

Of course...

Ben


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

Date: Sun, 19 Jan 2003 21:42:00 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Inlining object methods via preprocessor for efficiency (!?)
Message-Id: <3E2B61F8.20469FA6@earthlink.net>

Rich Wales wrote:
[snip]
> The obvious Perl thing to do would have been to write a method
> called "extra", something like this:
> 
>         sub extra { my this = shift; this->{extra} }

Try rewriting this method as:

   sub extra { $_[0]->{extra} }

Of course, even more important, find out how often it's actually called,
and whether it *need* to be optomized.

   perldoc -q profile

You'll likely discover that there's other stuff which would be a better
target of optomization.

PS: Instead of the C preprocessor, you might consider using Filter::cpp.

-- 
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r  coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);


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

Date: Sun, 19 Jan 2003 21:40:08 -0500
From: istink <istink@real.bad.com>
Subject: is it printf/sprintf that ############ fills this ###############
Message-Id: <3E2B6188.E8C2CE65@real.bad.com>

could it be printf/sprinf or some other formater that does this

#########################################
#########################################
#########################################
#########################################
#########################################
#########################################
#########################################


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

Date: Sun, 19 Jan 2003 21:42:34 -0500
From: istink <istink@real.bad.com>
Subject: Re: is it printf/sprintf that ############ fills this ###############
Message-Id: <3E2B621A.D5945CEF@real.bad.com>

ARG*$#%%$# posted by mistake.

istink wrote:
 
 could it be printf/sprinf or some other formater that does this
 
 #########################################
 #########################################
 ########### Hello World #################
 ######## What is the purpose of life ####
 #########################################
 #########################################
 #########################################


and

 #########################################
 #########################################
 # Hello World ###########################
 # What is the purpose of life ###########
 #########################################
 #########################################
 #########################################


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

Date: Sun, 19 Jan 2003 22:17:01 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: is it printf/sprintf that ############ fills this ###############
Message-Id: <slrnb2mu1t.obq.tadmc@magna.augustmail.com>

istink <istink@real.bad.com> wrote:
>  
>  could it be printf/sprinf or some other formater that does this
>  
>  #########################################
>  #########################################
>  ########### Hello World #################
>  ######## What is the purpose of life ####
>  #########################################
>  #########################################
>  #########################################


No. Unless you give us some indication of how to determine
where to place the interior strings.

Or maybe you meant "centered" but just messed up the example?

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

foreach ( '', '', 'Hello World', 
          'What is the purpose of life', '', '', '' ) {
   print center($_, 41), "\n";
}

print "\n";

foreach ( '', '', 'Hello World', 
          'What is the purpose of life', '', '', '' ) {
   print ljustify($_, 41), "\n";
}


sub center {
   my($word, $len) = @_;
   $word = " $word " if length $word;   # space pad each end

   my $line = '#' x $len;
   substr($line, ($len/2) - (length($word)/2), length($word)) = $word;

   return $line;
}


sub ljustify {
   my($word, $len) = @_;
   $word = " $word " if length $word;   # space pad each end

   my $line = '#' x $len;
   substr($line, 1, length($word)) = $word;

   return $line;
}
----------------------------------


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


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

Date: Mon, 20 Jan 2003 09:58:54 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: push @x, "a $_ b"; only $_ b is pushed
Message-Id: <slrnb2mbdd.7m2.mgjv@martien.heliotrope.home>

On Sun, 19 Jan 2003 17:11:26 -0500,
	istink <istink@real.bad.com> wrote:
> push @x, "a $_ b";
> 
> why only $_ and what comes after is pushed?

That line above pyshed the string "a $_ b" onto the array, with $_
substituted with whatever is in $_. No more, and no less.

> what happened to text before?

It is still there. I'm sure of it.

> $list="/../myList.txt";

You should always post complete programs, and you should always use
strict and warnings. Always. Especially when posting here. We do not
like doing the work of machines.

That directory path makes no sense to me. There is no directory below
root (it just refers to itself), unless you're on some platform where
that makes sense.

my $list = "myList.txt";

> open (READ, "$list");

Always check the return value of open, especially when posting here. We
can't even debug this potential problem for you. And don't quote
variables unnecessarily.

open READ, $list or die "Could not open '$list': $!\n";

> while (<READ>){
>     chomp;
>     @fields=split /\|/, $_;

my @fields = split /\|/;

>     if ($fields[0] ne "ID") {
>         #get important items first
>         if ($fields[2] eq "y") {
>             $pushit = "why am I not printed $_ why am I getting  attention";

my $pushit...

or you don't even really need a temporary variable here. This is also a
terrible way of debugging, because now your pushed item is no longer
correctly formatted for your later code.

>             push @itemsImportant, $pushit;

@itemsImportant is not declared anywhere. You should declare it, and
make this run under strict. Especially with variable names this long,
and case sensitive, it is just too easy to make a typing mistake

To answer that question in $pushit: Your example data never has a "y" in
$fields[2], so you will never even get to here. If your real data does
have that, then PLEASE submit real data. Don't waste our time.

You do know that $fields[2] refers to the _third_ field, right?

>         }
>         #now get the unimportant items
>         else {
>             push @itemsUnimportant, $_;

@itemsUnimportant is not declared anywhere. You should declare it, and
make this run under strict.

>         }
>     }
> }
> close (READ);
> 
> push @list, @itemsImportant;
> push @list, @itemsUnimportant;


> foreach (@list) {
>     @fields=split /\|/, $_;

my @fields = split /\|/;

>     print "$fields[1]";
>     if ($fields[3]){
>         print " -- Due: $fields[3]";
>     }
>     print "\n";
> }

If I use an input file that has a line like:

3|foo|y|bar

it does get processed there, and then, and it ends up at the start of
@list.

From all of the above, I'd say it's most likely you're using an
incorrect index, but it's impossible for us to say, because you're ot
showing us the real data you're working with.

Also, that first like of your post has absolutely nothing to do with the
code you then discuss. The push is _not_ the problem. 

Martien
-- 
                        | 
Martien Verbruggen      | Freudian slip: when you say one thing but
                        | mean your mother.
                        | 


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

Date: Sun, 19 Jan 2003 17:22:47 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: push @x, "a $_ b"; only $_ b is pushed
Message-Id: <slrnb2mcq7.nr4.tadmc@magna.augustmail.com>

istink <istink@real.bad.com> wrote:
> push @x, "a $_ b";
> 
> why only $_ and what comes after is pushed?


It is _all_ getting pushed.


> what happened to text before?


$_ contains a | and you split on those.


> open (READ, "$list");
              ^     ^
              ^     ^ a useless use of double quotes

You should always, yes *always*, check the return value from open():

   open (READ, $list) or die "could not open '$list'  $!";


>         if ($fields[2] eq "y") {


Your sample data has no records with a "y" in that position,
the if clause will never be executed.

It might be interesting to see what is in $_ at this point:

   print "\$_ contains ($_)\n";

When I use different data and try that, I get:

   $_ contains (2|a|y|c...)


>             $pushit = "why am I not printed $_ why am I getting
> attention";
>             push @itemsImportant, $pushit;

> push @list, @itemsImportant;

> foreach (@list) {
>     @fields=split /\|/, $_;

Given the above value of $_, after the split() you'll have:

   $fields[0]     why am I not printed 2
   $fields[1]     a
   $fields[2]     y
   $fields[3]     c... why am I getting attention


>     print "$fields[1]";
>     if ($fields[3]){


You never _asked_ Perl to print $fields[0], so it doesn't print it.


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


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

Date: Sun, 19 Jan 2003 23:32:28 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: push @x, "a $_ b"; only $_ b is pushed
Message-Id: <3E2B356B.7040803@rochester.rr.com>

istink wrote:

> push @x, "a $_ b";
> 
> why only $_ and what comes after is pushed?
> what happened to text before?


Any chance $_ contains some control characters that act to hide "text 
before" when it is printed to your console?  The entire scalar will be 
pushed to the next array element.


> ---------------------------------
> 
> $list="/../myList.txt";


Interesting file specification:  start at file system root, then go one 
directory up.  Where would that be?  Probably OS dependent on just what 
happens.


> 
> open (READ, "$list");


Always *always* test the result of open for success.  Maybe like:

   open READ,$list or die "Oops, couldn't open $list, $!";

Also, you have a "useless use of quotes" here -- "$list" is better 
written as $list.


 ...


See Jay Tilton's comments for the rest.
-- 
Bob Walton



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

Date: 19 Jan 2003 19:37:15 -0800
From: kamalhyder@hotmail.com (Kamal)
Subject: Quick HTML/CGI/Perl Question
Message-Id: <cdddc935.0301191937.76126bea@posting.google.com>

Hello All,

I have a quick HTML/CGI/Perl question and I hope you can help me.  I
don't do this stuff every day so I feel a little stuck…

I have to write Perl scripts that get some user search criteria,
search a mysql database, and generate results on the screen.  There
are two levels of search: based on the user search criteria, table1 is
generated from the database, and, if the user clicks on a cell in a
particular column, table2 is generated from the same database (but a
different query).  My CGI code is working fine for generating table1
and table2, but the missing piece is where the user clicks on a cell
in table1… that should launch the CGI script that generates table2.

I figured I could generate table1 as a form so that each click fires
off the same CGI with different parameters.  To try this out, I wrote
the following HTML snippet that should launch the CGI:

<html>
<head>
<title>Link Test Page</title> </head>

<body>
<h3 align=center>Link Test Page</h3>

<form method="POST" action="../cgi-bin/linktest.cgi">
<a href="" onClick='return ("Link1")'>Link1</a>
<a href="" onClick='return ("Link2")'>Link2</a>
</form>

</body>
</html>

I cannot put a URL in the above HREF because then a click would take
the user to that URL.

The CGI script that the above HTML should invoke looks like this:

#!/usr/bin/perl -w
use CGI ':standard';

&startHTML;

print "<CENTER><H1>Perl Link Test\n</H1><CENTER>\n";

print "\n";
print a({-href=>"../linktest.html"}, "Back to HTML");
      
print $query->end_html;

exit (0);

sub startHTML
{
$query = new CGI;
print $query->header;
print $query->start_html('Perl Link Test');
}

The HTML code does not work.  When I click on the links, I get a test
message from apache.  I know that apache is running - I can launch
other scripts that I have written, and they work fine.

Do you know what's going on?  How can I achieve the desired result?

Thanks,
-Kamal


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

Date: 19 Jan 2003 18:35:13 -0800
From: mrennix@totalise.co.uk (Martin)
Subject: Regex to find all words containing a single vowel?
Message-Id: <cb57fb72.0301191835.6d9d5714@posting.google.com>

I need to find all words in a file containing only a single vowel.

For example:

$regex = ????????
$string = "The quick brown fox jumped over the lazy dog";
$string =~ /$regex/g;

should match:

The
brown
fox
the
lazy
dog

This sounds simple but I can't work out the regex! Any ideas?

--
Martin


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

Date: Mon, 20 Jan 2003 03:35:31 GMT
From: ebchang <chang0@adelphia.net>
Subject: Re: Regex to find all words containing a single vowel?
Message-Id: <Xns9308E5D14D8Dchang0adelphia.net@24.48.107.53>

mrennix@totalise.co.uk (Martin) wrote in 
news:cb57fb72.0301191835.6d9d5714@posting.google.com:

> I need to find all words in a file containing only a single vowel.

If this is the definition of your task, and if you are dealing with 
distinct words, consider using the tr/// operator - it returns the number 
of replacements made.

For example
    	print ("one" =~ tr/aeiou//);
    	print ("two" =~ tr/aeiou//);

prints 21

> For example:
> 
> $regex = ????????
> $string = "The quick brown fox jumped over the lazy dog";

If, as suggested, there's no additional punctuation, use split to get the 
individual words.  If not m!\w+!g will return the words in a list - then 
use tr on each one.

    	$x = "The quick brown fox jumped over the lazy dog";
    	foreach $y ($x =~ m!\w+!g) {
        	print "$y\n" if ($y =~ tr/aeiou//) == 1;
    	}

> $string =~ /$regex/g;
> 
> should match:
> 
> The
> brown
> fox
> the
> lazy
> dog
> 
> This sounds simple but I can't work out the regex! Any ideas?

Is the task to find the designated words, or is the task to create a 
single regex that will find the words?  If the former, it is simple. 
If the latter, it is so explicit about how to solve the former task that 
it sounds like a homework question.

-- 
EBC


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

Date: Sun, 19 Jan 2003 21:35:06 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regex to find all words containing a single vowel?
Message-Id: <slrnb2mrja.o7e.tadmc@magna.augustmail.com>

Martin <mrennix@totalise.co.uk> wrote:

> I need to find all words in a file containing only a single vowel.


   my @vowel1 = grep tr/aeiouAEIOU// == 1, $string =~ /(\w+)/g;


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


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

Date: Mon, 20 Jan 2003 00:00:39 GMT
From: "MG" <me@home.com>
Subject: Re: Running a perl script as a windows 2000 service?
Message-Id: <H_GW9.19158$o8.378156@twister.tampabay.rr.com>

I read the faq and for Windows 2000 Services it states that the help files
give you all the info you need and they don't give any info.  I will try the
earlier post, as I had neverheard of wperl.  Thanks.

"Bart Lateur" <bart.lateur@pandora.be> wrote in message
news:supk2vgpn3mek3ckmdcabo7kdbmnqmdvcr@4ax.com...
> The advice John Fraser gave you (startup folder or registry entry for
> the automatic startup, wperl to hide the console) would be the first I
> thought of. However, there are also a few entries on running perl
> scripts as services in Activestate's FAQ, for NT and for Win2k, with
> perhaps a better approach:
>
> How do I run a Perl script as a Windows NT Service?
> How do I run a Perl script as a Windows 2000 Service?
>
<http://aspn.activestate.com//ASPN/Reference/Products/ActivePerl/faq/Windows
/ActivePerl-Winfaq4.html#How_do_I_run_a_Perl_script_as>
>
> --
> Bart.
>




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

Date: Mon, 20 Jan 2003 00:48:24 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Running a perl script as a windows 2000 service?
Message-Id: <9mgm2voc775hv6g3ubm340t5v46v89edhr@4ax.com>

MG wrote:

> I will try the
>earlier post, as I had neverheard of wperl. 

You haven't? Look into the "bin" directory of the perl tree. Likelely,
you will find "wperl.exe" there. Perl consists of a rather large DLL,
perl56.dll, about 650k. Then there  is the loading program, "perl.exe"
or "perl.5.6.1.exe" (for perl 5.6.1), which are, as far as I know,
exactly the same executable, about 20480 bytes. And then there is
"wperl.exe", which is an exact copy of "perl.exe", also 20480 bytes, but
with ONE byte changed. That byte defined whether the executable will be
started up with, or without a console window (AKA a "DOS window"). To be
honest, they've used a script to get "wperl.exe" from "perl.exe", and
it's also included: look for a file called "exetype.pl" or
"exetype.bat".

And a way to start up a script without a DOS window, from another
script, is dicussed in this thread on Perlmonks.org:

	<http://perlmonks.org/index.pl?node_id=192421>

I later turned it into this little module that can relaunch the script
that uses it without window:

	package Win32::Detached;

	use strict;
	use Win32;
	use Win32::Process;
	use Cwd;

	if(@ARGV and $ARGV[0] eq '-nolaunch') {
	    shift;
	} elsif(!$^C) {
	    Win32::Process::Create(
	        my $ProcessObj,
	        $^X,
	        join(" ", map { tr/ // ? qq["$_"] : $_ } $^X, $0,
	 	"-nolaunch", @ARGV),
	        0,
	        DETACHED_PROCESS,
	        cwd,
	    ) or die Win32::FormatMessage(Win32::GetLastError());
	    exit;
	}

	1;

Save as "Win32\Detached.pm" somewhere in @INC. If you do 

	use Win32::Detached;

then the script will relaunch itself, this time without console window,
and then exit. The second console-less program copy will then run as
normal.

-- 
	Bart.


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

Date: Sun, 19 Jan 2003 21:28:08 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: server and client on the same port
Message-Id: <3E2B5EB8.A6112AC3@earthlink.net>

Markus Rachbauer wrote:
> 
> hi,
> 
> i need to write a program, that interacts with a communication-server,
> which answers requests from clients back to the same ip/port, from
> where the previous connection was initiated.

Is this with TCP or UDP?

If it's with TCP, then don't bother to create a second connection back
from the server to the client, and instead use the original connection
for your data.

If it's with UDP, then you still don't need to create another socket --
the client can listen with the same socket that it sent the data with.

> this means, if i connect to the comm-server from port 9000 on my
> machine, i've to start a listening socket on port 9000.

Hmm, you're talking about connecting.... sounds like TCP.

(You *can* connect() using UDP, but it has a different meaning)

> so i can't send a second message from the same port.

Hrm, now you're talking about "messages", sounds like UDP.

Make up your mind.

> is it possible to start a listening socket on port 9000 and send
> messages from port 9000 on my machine to any port on another
> machine? i've also tried the ReusePort option, but got an error
> message on my system (suse81 on x86).

Decide what protocol you want, first, then ask your question.

(But I'll advise you that if you have one TCP connection from machine
A's port 9000 to machine B's port 2345, then you *cannot* create a
second connection between A's 9000 and B's 2345... it won't work.  The
TCP protocol would have no way of differentiating between the two
connections.)

-- 
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r  coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);


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

Date: Sun, 19 Jan 2003 23:56:05 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Using domain.com/?query+string and domain.com/index.cgi?query+string...
Message-Id: <Pine.LNX.4.40.0301192346370.3614-100000@lxplus072.cern.ch>

On Jan 17, krakle inscribed on the eternal scroll:

> When i use http://domain.com/?query+string the query string is chopped
> off as if never existed and in the browser address bar I see
> http://domain.com/index.cgi.

From the changed URL, we can conclude that the server has performed a
redirection, evidently.

I suggest you should be seeking advice on the relevant
comp.infosystems.www.servers.* group.  You surely don't have a
Perl problem here.

> Does anyone know how I can implement this? Possibly HTACCESS?

You mean .htaccess ?  That's just a container for configuration
statements - which can also appear in server configuration files etc..
If there's anything in what you say, then it would be one of those
_statements_ that was doing the deed, and not the mere fact that it
was in a .htaccess file.

> This is driving my nuts.

Well, I don't think that's anything for which we can offer
specialised help here :-}

> ps. Let me appologize a head of time for being off topic. I couldn't
> find an apache group. So I figured since i'm dealing with Perl scripts
> there is bound to be people here who can help.

Some of us can help you find the appropriate group, at least.

If I knew the answer, I might even tell you what it was - but as it
happens, I'm afraid I don't.  Take a look to find out why the
redirection is occurring - that will almost certainly be the key to
your problem.  Some configuration issues with virtual hosting are
quite subtle, so take it calmly, be patient.  I feel sure that a
solution will prove feasible.



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

Date: Mon, 20 Jan 2003 01:27:47 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Using domain.com/?query+string and domain.com/index.cgi?query+string...
Message-Id: <b0fjaj$apg$1@wisteria.csv.warwick.ac.uk>

krakle@visto.com (krakle) wrote:
>Andrew Lee wrote in message news:<nbui2v4qa0dairg8q695qq8cu1urmmceor@4ax.com>...
>Heres an example http://typex.net/test/?http://yahoo.com
>
<snip>
>
>> But that is just a guess.  I have no idea what your setup is and what
>> you expect.
>
>Just as I described.

In particular, do you have DirectoryIndex index.cgi set on /test? I suspect
not...

This is Not A Perl Question.

Ben



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

Date: Sun, 19 Jan 2003 23:14:25 -0000
From: "Stuart Moore" <stjm2@cam.ac.uk>
Subject: Re: Why can't I just open(FH, ">file.lock")?
Message-Id: <b0fbg1$dm4$1@pegasus.csx.cam.ac.uk>

Posted and emailed:
In news:b082mg$cmb$1@reader1.panix.com, PerlFAQ Server
<comdog@panix.com> declared:
>         sysopen(FH, "file.lock", O_WRONLY|O_EXCL|O_CREAT)

This could (IMO) be improved by explaining what O_WRONLY etc. do (yes I know
it can be looked up but it's only an extra couple of lines here and stops
people having to jump from page to page...)




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4430
***************************************


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