[22852] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5073 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 4 09:06:25 2003

Date: Wed, 4 Jun 2003 06:05:09 -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           Wed, 4 Jun 2003     Volume: 10 Number: 5073

Today's topics:
    Re: formatting my output (Anno Siegel)
    Re: formatting my output (slash)
    Re: Hy guys,I need some help(opening directories) (Zoran)
    Re: Is it possible to do it ? (Winfried Koenig)
    Re: Is it possible to do it ? <usenet@expires082003.tinita.de>
        Need Help with directories (Zoran)
    Re: Need Help with directories <g4rry_short@zw4llet.com>
    Re: Need Help with directories (Zoran)
    Re: NEWBIE: Pls help or point.  Enumerating dirs, findi (Anno Siegel)
    Re: Perl Daemon and inittab <goedicke@goedsole.com>
    Re: Reference types (Anno Siegel)
    Re: Reference types (Dave Pointon)
    Re: regular expression problem <please@no.spam>
    Re: Remove first character in a string? <dbo@xbn.nl>
    Re: Remove first character in a string? (Sara)
    Re: Sorting hash <noreply@gunnar.cc>
    Re: strange perl behaviour with cgi <rinaul@hotmail.com>
    Re: strange perl behaviour with cgi (Sara)
    Re: Unix to Win2k servers <vladimir@NoSpamPLZ.net>
    Re: vars from htaccess to cgi <zak@mighty.co.za>
        where to download perl-5.8.1 src <romerun@romerun.com>
    Re: where to download perl-5.8.1 src <tassilo.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 4 Jun 2003 11:04:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: formatting my output
Message-Id: <bbkjom$bpu$1@mamenchi.zrz.TU-Berlin.DE>

slash <satishi@gwu.edu> wrote in comp.lang.perl.misc:
> hi,
> i am new to perl.
> following is the output i get:
> 
> *        *       *       *       united
> *        *       *       united states
> *        *       united states patent
> *        united states patent april
> united states patent april 16
> states patent april 16 2002
> patent april 16 2002 method
> april 16 2002 method apparatus
> 16 2002 method apparatus performing
> 2002 method apparatus performing variable
> 
> 
> for the following code:
> undef $/;
> 
> @stack=("*\t", "*\t", "*\t", "*\t", "*\t");
> @words = split /\W+/, <> ;
> 
> foreach $word (@words) {
> 
>         chomp($word);
>         shift(@stack);
>         push @stack, $word;
> 
>         printf "@stack\n";
> };
> 
> how can i format it better so the file is a little more readable.

You mean, aligning the words in columns?  One way is to use the module
Text::Table from CPAN.  It will dynamically assign columns to accommodate
all words that appear in each.

        use Text::Table;

        my @words = qw( united states patent april 16 2002 method apparatus
                        performing variable);

        my $n_cols = 5;
        my $col = { align => 'left'}; # no title, left alignment
        my $tb = Text::Table->new( ( $col) x $n_cols);

        my @stack = ( '*' ) x $n_cols;
        for my $word ( @words ) {
            shift @stack;
            push @stack, $word;
            $tb->add( @stack);
        }

        print $tb;

Anno


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

Date: 4 Jun 2003 05:12:17 -0700
From: satishi@gwu.edu (slash)
Subject: Re: formatting my output
Message-Id: <30fe9f1e.0306040412.5afb260d@posting.google.com>

Hi,
Thanks for your response. I tried what you had mentioned before but
not any success. The output I want is the following:

*	*	*	*	united
*	*	*	united	states
*	*	united	states	patent
*	united	states	patent	april
united	states	patent	april	16
states	patent	april	16	2002
patent	april	16	2002	method
april	16	2002	method	apparatus

a tab-delimited file. 

Slash

sholden@flexal.cs.usyd.edu.au (Sam Holden) wrote in message news:<slrnbdqi32.7ki.sholden@flexal.cs.usyd.edu.au>...
> On 3 Jun 2003 18:01:19 -0700, slash <satishi@gwu.edu> wrote:
> > hi,
> > i am new to perl.
> > following is the output i get:
> > 
> > *        *       *       *       united
> > *        *       *       united states
> > *        *       united states patent
> > *        united states patent april
> > united states patent april 16
> > states patent april 16 2002
> > patent april 16 2002 method
> > april 16 2002 method apparatus
> > 16 2002 method apparatus performing
> > 2002 method apparatus performing variable
> > 
> > 
> > for the following code:
> > undef $/;
> > 
> > @stack=("*\t", "*\t", "*\t", "*\t", "*\t");
> > @words = split /\W+/, <> ;
> > 
> > foreach $word (@words) {
> > 
> >         chomp($word);
> 
> That chomp is useless since "\n" is matched by \W and hence won't
> be in any of the elements in @words.
> 
> >         shift(@stack);
> >         push @stack, $word;
> > 
> >         printf "@stack\n";
> 
> printf join("\t", @stack), "\n";
> 
> Plus taking the tabs out of the * strings would make it easier to see
> the individual words.
> 
> Alternatively if you find the letter 'e' to be unsightly you could try
> 
> $word=~tr/eE/33/;
> 
> near the start of the for loop.
> 
> 
> > how can i format it better so the file is a little more readable.
> 
> Defining what 'readable' means in this context would help.


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

Date: Wed, 04 Jun 2003 12:57:56 GMT
From: Zoran.Marinkovic@post.rwth-aachen.de (Zoran)
Subject: Re: Hy guys,I need some help(opening directories)
Message-Id: <3eddebf6.3341447@news.rwth-aachen.de>



On 4 Jun 2003 09:30:36 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>Zoran <zoran_m@t-online.de> wrote in comp.lang.perl.misc:
>> if (!opendir VH,$directory)
>> {
>> $erg_text->delete("1.0",'end');
>> $erg_text->insert('end',"Directory $directory not found\n");return;}
>> 
>> foreach $file (readdir VH){
>> if ($file eq $opname)
>> {
>> open DAT,"< $opname";
>
>You should always check the return value of open().  As you have seen,
>things *can* go wrong.  You could just skip files you can't open:
>
>    open DAT, "< $opname" or do {
>        warn "Can't open $opname in $directory: $!";
>        next;
>    };
>
>> undef $/; 
>> $rawdata=<DAT>;
>> $flaggy=1;
>> }}
>> 
>> All right,thats my code.I am running my program from C:\perl\appz
>> If I open files in this directory I get no problems.But If I am going to 
>> directory C:\perl I cannot open any file.I am getting this error message:
>> 
>> "readline()on closed filehandle DAT at test.pl line 309"
>> 
>> line 309:$rawdata=<DAT>;
>
>Old story, but apparently not a FAQ yet.
>
>readdir() returns only the file name, not the whole path to the file.
>Unless the directory you're reading is your current directory (that
>was the case when your code seemed to work), you must prepend the
>directory name to the file name:
>
>    open DAT, "$directory/$file" or ...
>
>On the other hand, I don't see why you need readdir() at all.  You
>are looking through the directory to find a file named $opname.
>You'd get the same effect, with less hassle, if you just did
>
>    if ( -f "$directory/$opname" ) {
>        open DAT, "$directory/$opname" or ...
>        # etc
>    }
>
>Anno

Oh god,you guys are the best.I understand.I improved it like this:

if (!opendir VH,$directory)
{
$erg_text->delete("1.0",'end');
$erg_text->insert('end',"Directory $directory not found\n");return;}

foreach $file (readdir VH){
if ($file eq $opname)
{

if (!open(DAT,"< $verzeichnis/$opname"))
{$erg_text->insert('end',"File $opname not found\n");return;}
undef $/; 
$rawdata=<DAT>;
}}

Thank you very very much

Greetz
Zoran


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

Date: 4 Jun 2003 03:29:09 -0700
From: w.koenig@acm.org (Winfried Koenig)
Subject: Re: Is it possible to do it ?
Message-Id: <624f7903.0306040229.2049c2aa@posting.google.com>

Jean-Luc BEAUDET wrote:
> 
> Runnin' perl 5.8.0, i try to do a little thing like that:
> 
> while ( $text = <<'END'
> My first line of texte.
> The second one, bigger.
> And the third one....
> END ) {
>     while_cmd;
>     while_cmd
> }
> 
> The result is : Can't find string terminator "END" anywhere before EOF 
> at ./PerlProg.pl


The here-document's terminating string must appear by itself
(unquoted and with no surrounding whitespace) on the 
terminating line. Try this:

foreach my $text ( split /\n/, <<'END') {
    My first line of texte.
    The second one, bigger.
    And the third one....
END
    print "$text\n";
}

Winfried

-- 
Winfried Koenig   +49 69 868707   w.koenig@acm.org
Perl - Beratung und Programmierung in Unixumgebung


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

Date: 4 Jun 2003 11:21:50 GMT
From: Tina Mueller <usenet@expires082003.tinita.de>
Subject: Re: Is it possible to do it ?
Message-Id: <bbkkoe$afslr$1@ID-24002.news.dfncis.de>

Winfried Koenig wrote:

> foreach my $text ( split /\n/, <<'END') {
>     My first line of texte.
>     The second one, bigger.
>     And the third one....
> END
>     print "$text\n";
> }

what i like, too, is that you can chain here-documents like:
my ($x,$y,$z)=(<<END,<<END,<<END);
x
END
y
END
z
END 

(not that i ever really needed this so far, but it's nice...)
regards, tina
-- 
http://www.tinita.de/     \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/   \     / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/   \    \ _,_\ __/\ __/_| /__/ perception
- my mail address expires end of august 2003 -


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

Date: Wed, 04 Jun 2003 12:43:30 GMT
From: Zoran.Marinkovic@post.rwth-aachen.de (Zoran)
Subject: Need Help with directories
Message-Id: <3edde7ab.2242186@news.rwth-aachen.de>

	


Hello guys,i have some problems with opening files in directories.

I am currently running my perl program in C:\perl\appz
Without problems i am able to open files and work with them.
But when I am going to C:\perl and want to open a file i am getting
this error message:

"readline() on closed filehandle DAT at test.pl line 309"


here is the code



if (!opendir VH,$directory)
{
$erg_text->delete("1.0",'end');
$erg_text->insert('end',"Directory $directory not found\n");return;}

foreach $file (readdir VH){
if ($file eq $opname)
{
open DAT,"< $opname";
undef $/; 
$rawdata=<DAT>;
}}


can anyone tell me whats wrong?

Thank you very much

Zoran


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

Date: Wed, 04 Jun 2003 13:51:50 +0000
From: Garry Short <g4rry_short@zw4llet.com>
Subject: Re: Need Help with directories
Message-Id: <bbkq50$8jh$1$8302bc10@news.demon.co.uk>

Zoran wrote:

> 
> 
> 
> Hello guys,i have some problems with opening files in directories.
> 
> I am currently running my perl program in C:\perl\appz
> Without problems i am able to open files and work with them.
> But when I am going to C:\perl and want to open a file i am getting
> this error message:
> 
> "readline() on closed filehandle DAT at test.pl line 309"
> 
> 
> here is the code
> 
> 
> 
> if (!opendir VH,$directory)
> {
> $erg_text->delete("1.0",'end');
> $erg_text->insert('end',"Directory $directory not found\n");return;}
> 
> foreach $file (readdir VH){
> if ($file eq $opname)
> {
> open DAT,"< $opname";
> undef $/;
> $rawdata=<DAT>;
> }}
> 
> 
> can anyone tell me whats wrong?
> 
> Thank you very much
> 
> Zoran

Yes. You posted the exact same topic this morning, and haven't read the
responses that told you what the problem was.

Please go and read the responses to your initial post.

Regards,

Garry




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

Date: Wed, 04 Jun 2003 13:01:49 GMT
From: Zoran.Marinkovic@post.rwth-aachen.de (Zoran)
Subject: Re: Need Help with directories
Message-Id: <3eddecfd.3604508@news.rwth-aachen.de>

On Wed, 04 Jun 2003 13:51:50 +0000, Garry Short
<g4rry_short@zw4llet.com> wrote:

>Zoran wrote:
>
>> 
>> 
>> 
>> Hello guys,i have some problems with opening files in directories.
>> 
>> I am currently running my perl program in C:\perl\appz
>> Without problems i am able to open files and work with them.
>> But when I am going to C:\perl and want to open a file i am getting
>> this error message:
>> 
>> "readline() on closed filehandle DAT at test.pl line 309"
>> 
>> 
>> here is the code
>> 
>> 
>> 
>> if (!opendir VH,$directory)
>> {
>> $erg_text->delete("1.0",'end');
>> $erg_text->insert('end',"Directory $directory not found\n");return;}
>> 
>> foreach $file (readdir VH){
>> if ($file eq $opname)
>> {
>> open DAT,"< $opname";
>> undef $/;
>> $rawdata=<DAT>;
>> }}
>> 
>> 
>> can anyone tell me whats wrong?
>> 
>> Thank you very much
>> 
>> Zoran
>
>Yes. You posted the exact same topic this morning, and haven't read the
>responses that told you what the problem was.
>
>Please go and read the responses to your initial post.
>
>Regards,
>
>Garry
>
>

I am sorry ,my fault .I posted the same on google and they told me it
would take 3-9 hours.I didn't know that it is the same.
I didn't saw my posting.
sorry



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

Date: 4 Jun 2003 12:36:10 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: NEWBIE: Pls help or point.  Enumerating dirs, finding files?
Message-Id: <bbkp3q$ecb$2@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Michael wrote:
> > Let's say that I have "Clock.bmp" in these directories, like so:
> > 
> > \BmpImages\28x28\Clock.bmp
> > \BmpImages\28x28\Disabled\Clock.bmp
> > \BmpImages\28x28\Hot\Clock.bmp
> > \BmpImages\16x16\Clock.bmp
> > \BmpImages\16x28\Disabled\Clock.bmp
> > \BmpImages\16x16\Hot\Clock.bmp
> > 
> > I want to copy these files into a similar directory structure under
> > my main source code directory.  For example, for an application
> > "RemoteDriver"
> 
> <snip>
> 
> > I realize that it is best to learn by doing, but can some old hand
> > please either point me in the right direction or provide a few
> > hints?
> 
> Check out these standard modules:
> 
>      File::Find
>      File::Copy

Plus, very likely, File::Path.

Anno


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

Date: Wed, 04 Jun 2003 11:47:39 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: Perl Daemon and inittab
Message-Id: <m34r363vze.fsf@mail.goedsole.com>

Dear Jack - 

"Jack D." <goodcall__1@hotmail.com> writes:

> I want this running all the time, so I put the perl command as a
> 'respawn' in the inittab.

That's somewhat dangerous.  If something goes wrong with your program
you can easily get into a condition where you freeze the system when
booting.  Then you'll have to do single-user mode...

I'll leave it to the good programmers in this group to tell both of us
the right way to do it.  Chapter 12 in "Advanced Perl Programming"
appears to address developing daemons.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

A day without raw fish is like a day without sunshine.

	- William Goedicke


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

Date: 4 Jun 2003 12:08:20 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Reference types
Message-Id: <bbknfk$ecb$1@mamenchi.zrz.TU-Berlin.DE>

Dick Penny <penny1482@attbi.com> wrote in comp.lang.perl.misc:
> 
> > I'm doing my nut trying to distinguish between references to anonymous
> > and named data elements i.e. given a sub which takes a reference,
> > can/should the sub be able to determine whether the reference is to
> > named or anonymous data.
> >
> I'm not guru, even sort of a newbie, but I have not found (or maybe too dumb
> to notice) any distinction (at least that mattered to me).
> 
> My suggestion, is have a one line sub, that passes the arg to Data::Dumper
> and print, and call it twice passing both to it to see what happens, eg,
> use Data::Dumper;
> blah ...blah...blah
> print Dumper(arg1);
> print Dumper(arg2);

How will that tell the difference between an anonymus and a named scalar?
Dumper is concerend with the contents of variables, not their status.

Anno


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

Date: 4 Jun 2003 05:55:06 -0700
From: david.pointon@tesco.net (Dave Pointon)
Subject: Re: Reference types
Message-Id: <80fceb32.0306040455.581f24f@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbdpuva.hue.tadmc@magna.augustmail.com>...
> Dave Pointon <david.pointon@tesco.net> wrote:
> 
> > Can anyone help ...
> 
> 
> If we knew what the _real_ problem was we might be able to help...
> 
> 
> > I'm doing my nut trying to distinguish between references to anonymous
> > and named data elements
> 
> 
> Why do you think that you need to distinguish them?

I need a sub, which when passed a ref., takes a copy of either the
ref. or the structure dependant on whether the ref. is to named or
anonymous data e.g. assuming

my %hash = (
  field1 => \%someOtherHash,
  field2 => {
    field1 => undef,
    field2 => undef,
  },
);

Calling sub(\%hash) should result in field1 being copied as is i.e. an
ARRAY ref., whereas field2 (the anonymous hash) is copied wholesale.


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

Date: Wed, 04 Jun 2003 13:33:59 +0100
From: Chris Lowth <please@no.spam>
Subject: Re: regular expression problem
Message-Id: <TGlDa.71$0d7.2862@newsfep4-glfd.server.ntli.net>

KT wrote:

> Hi all
> Perl Problem
> if i have a variable that is as followed, how do i assign a new
> variable equal http:// and end with .hk   , but as the web page is
> vary every times, so i think it should stop be4 HTTP/1.0.
> 
> 
> GET http://www.orientaldaily.com.hk/ HTTP/1.0
> Accept: */*
> Accept-Language: en-au
> Proxy-Connection: Keep-Alive
> If-Modified-Since: Sat, 24 May 2003 07:18:51 GMT; length=4848
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
> Q312461; .NET CLR 1.0.3705)
> Host: www.orientaldaily.com.hk
> Proxy-Authorization: Basic cHBwOmFhYWFhYQ==

Assuming your string is in a variable called "$str" and you want the URL in 
$url, then try..
(Not tested...)

$url = ($str =~ m{^GET (.*?) HTTP}s) ? $1 : undef;

Chris
-- 
My real address is: chris at lowth dot sea oh em
-> OpenSource e-mail virus protection : http://protector.sourceforge.net
-> iptables configuration wizards : http://www.lowth.com/LinWiz


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

Date: Wed, 04 Jun 2003 12:44:38 +0200
From: David Bouman <dbo@xbn.nl>
Subject: Re: Remove first character in a string?
Message-Id: <3EDDCD96.FE4E13F2@xbn.nl>

Tad McClellan wrote:
> David Bouman <dbo@xbn.nl> wrote:
>> Koos Pol wrote:
>>
>>> chip() should make a fine opposite to chop() I find myself
>>> removing a first char regularly.
>>
>> Nah, that would imply having an opposite to chomp() as well,
>
> sub pmohc {  # the anti-chomp
>     $_[0] .= $/;
> }

s{\$_\Q[0] .= \E\$/}'length($/) * map s`(?<!$/)\z`$/`||(), @_';

> :-)

:-p

--
David.


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

Date: 4 Jun 2003 05:41:05 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: Remove first character in a string?
Message-Id: <776e0325.0306040441.12ff0587@posting.google.com>

Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> wrote in message news:<newscache$avqwfh$2r$1@news.emea.compuware.com>...
> Bernard El-Hagin wrote (Tuesday 03 June 2003 15:04):
> 
> > Jon Rogers wrote:
> > 
> >> Is there an easy way of removing the first character of a string?
> >> 
> >> I presently use substr. Stupid, I guess.
> > 
> > 
> > On the contrary. It's not stupid. But if you want an alternative there's
> > always:
> > 
> > $text =~ s/^.//;
> 
> 
> chip() should make a fine opposite to chop()
> I find myself removing a first char regularly.

Astute observation- Perl DOES seem to have some "parity" issues like
that. Consider the collary to:

   $x .= $y;

What if I want to PREPEND $y? Seems like

   $x =. $y;

would be nice too... (the '.' seems to be in the wrong place in both
examples). I don't know about you, but I probably need to "prepend" as
often as I need to "append", yet the language only gives me 1/2 of the
functionality built in (no instruction needed on HOW to prepend guys-
I KNOW how to do it the long way probaby 5 different ways)..

Your example of chop() is even more significant, since there are
actually 2 END-OF-LINE manipulators, chop() and chomp(). Perl went out
of its way to help us deal with the END of strings, and provided
nothing as far as a specific function to deal with the beginning. Not
a big drama, of course with a regex you can do whatever you want to
either end, but I agree it seems an odd design criteria to only
concern yourself with 1/2 of a programming requirement.

I've pointed this out in this group as well as on the Perl 6
Developers list but I don't think that parity is of any particular
concern.  I'd hate to drive a car that ONLY turned left. Sure you
could get there eventually but 1/2 the time it's the "long way
around"...

Sometimes Perl is like that. 

Perhaps Damian and company will make some improvements in P6.


Gx


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

Date: Wed, 04 Jun 2003 14:50:14 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sorting hash
Message-Id: <bbkq47$9cfb5$1@ID-184292.news.dfncis.de>

ctcgag@hotmail.com wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>> Considering the above, do you still recommend that the sort is 
>> stabilized, or would such a measure be redundant?
> 
> I am not he, but I recommend that you stabilize the sort, even
> though it is probably redundant.  The performance impact is
> probably low, and better safe than sorry.  It's foolish to tempt
> fate when the defensive solution is so readily available.

Well, Xho, currently I'm applying the "it seems to work" principle.
Or, if you so prefer, I'm tempting fate. I agree that _that_ is
foolish, which was the reason for asking in this group.

I thought (or at least hoped) that it was possible to find out how
perl works in this respect. After all, relying on the behaviour of
perl shouldn't be equal to tempting fate, should it?

Anyway, thanks for your recommendation. Provided that nobody is able
to tell _for sure_ that stabilizing the sort would be redundant, your
recommendation does make sense.

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Wed, 04 Jun 2003 11:43:36 GMT
From: Jes Naulen <rinaul@hotmail.com>
Subject: Re: strange perl behaviour with cgi
Message-Id: <eomrdvojmv35fobo8vf2r5me8jcctr2p6j@4ax.com>

Thank you very much! It was indeed mod_perl that caused the problem. I
read the documentation you mentioned and found a solution that worked.

On Wed, 04 Jun 2003 06:51:31 GMT, Michael Budash <mbudash@sonic.net>
wrote:

>In article <hb3rdv0sl283b02gkgrc89ii9cef33u33c@4ax.com>,
> Jes Naulen <rinaul@hotmail.com> wrote:
>
>> I am very puzzled by some Perl/CGI behaviour. I created a perl cgi
>> script that's called from a browser. The perl variables are getting
>> messed up. It seems the perl session is 'remembering' the values for
>> the browsers perl session. I worked for hours trying to find out
>> what's wrong, but in the end I ended with the bajsic script:
>> 
>>   #!/usr/bin/perl
>>   print "Content-type: text/html\n\n";
>>   print $test;
>> 
>> and it starts counting {1,2,3...). When I open another browser and
>> call the script, that brouwser starts counting from 1 again. Here too,
>> obviously the variable $test is being remembered between browser
>> sessions.
>> 
>> What is wrong (with perl, with apache?) and what can I do about it?
>> 
>> Regards,
>> Jess
>
>i'm gonna go out on a limb and guess that you're script is being run 
>under mod_perl. if so, you need to read this:
>
>http://perl.apache.org/docs/1.0/guide/porting.html
>
>hth-



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

Date: 4 Jun 2003 05:21:52 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: strange perl behaviour with cgi
Message-Id: <776e0325.0306040421.3c84881a@posting.google.com>

Jes Naulen <rinaul@hotmail.com> wrote in message news:<hb3rdv0sl283b02gkgrc89ii9cef33u33c@4ax.com>...
> I am very puzzled by some Perl/CGI behaviour. I created a perl cgi
> script that's called from a browser. The perl variables are getting
> messed up. It seems the perl session is 'remembering' the values for
> the browsers perl session. I worked for hours trying to find out
> what's wrong, but in the end I ended with the bajsic script:
> 
>   #!/usr/bin/perl
>   print "Content-type: text/html\n\n";
>   print $test;
> 
> and it starts counting {1,2,3...). When I open another browser and
> call the script, that brouwser starts counting from 1 again. Here too,
> obviously the variable $test is being remembered between browser
> sessions.
> 
> What is wrong (with perl, with apache?) and what can I do about it?
> 
> Regards,
> Jess


(a) use warnings:

#!/usr/bin/perl -w
                ^^
(b) use strict;

(c) what is $test? I don't see it defined or assigned to anything.

(d) try:  use CGI::Carp 'fatalsToBrowser';

(e) NOTHING is wrong with Perl or APACHE- maybe its YOU!
use CGI::Carp 'fatalsToBrowser';


Gx


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

Date: Wed, 04 Jun 2003 12:52:27 GMT
From: "Vladimir P." <vladimir@NoSpamPLZ.net>
Subject: Re: Unix to Win2k servers
Message-Id: <fYlDa.57722$Z83.597122@wagner.videotron.net>

On 03 Jun 2003 21:46:45 GMT, Chris wrote:
> I need to be able to run a command, from unix to a whole series of Win 2k 
> servers, and grab the output. Basically, something like the ssh mod for 
> unix, or TCL/expect.
> 

You can install ssh daemon/service/whatever-it-is-called-in-M$-world.
and use Net::SSH::Perl to connect and run your commands from unix box. 
I had very good results using (commercial) VShell  
(http://www.vandyke.com/products/index.html) as SSH daemon on windows.



-- 
 .signature: No such file or directory


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

Date: Wed, 04 Jun 2003 13:46:06 +0200
From: Zak McGregor <zak@mighty.co.za>
Subject: Re: vars from htaccess to cgi
Message-Id: <bbkm4u$3ii$1@ctb-nnrp2.saix.net>

On Wed, 04 Jun 2003 11:56:08 +0200, joe <"joe" <tunmaster@hotmail.com>>
wrote:

> This way I can read the variables sent using the GET method. But what
> about variables using the POST method? I tried reading their values
> using the param-functing and by "read (STDIN, my $buffer,
> $ENV{'CONTENT_LENGTH'});"
> 
> Are these variables lost in the process or can anyone tell me how to get
> in touch with them

use CGI or die;

Ciao

Zak

--
========================================================================
http://www.carfolio.com/        Searchable database of 10 000+ car specs
========================================================================


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

Date: Wed, 04 Jun 2003 17:10:17 +0700
From: Komtanoo  Pinpimai <romerun@romerun.com>
Subject: where to download perl-5.8.1 src
Message-Id: <bbkgfh$abspq$1@ID-154347.news.dfncis.de>

Hello

        I've been searching around google, but cannot find any site to download
perl 5.8.1 source code. Anyone know this ?

-- 
$_=`perldoc -U -q "What is a"`;m/"(.*?)"/;print$1



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

Date: 4 Jun 2003 11:21:32 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: where to download perl-5.8.1 src
Message-Id: <bbkkns$gkm$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Komtanoo Pinpimai:

>         I've been searching around google, but cannot find any site to
> download perl 5.8.1 source code. Anyone know this ?

There is no such location as of now. 5.8.1 will be out soon but it's not
yet there.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

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


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