[18911] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1079 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 6 21:06:00 2001

Date: Wed, 6 Jun 2001 18:05:13 -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: <991875913-v10-i1079@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 6 Jun 2001     Volume: 10 Number: 1079

Today's topics:
    Re: (csv) Split at a coma, how? (PaulWilson18)
        Binary files, any suggestions? <gamtci@mpinet.net>
        Calling programs from a cgi (Igal Corcos)
    Re: Decimal to Hex <winz@prodigy.net>
    Re: FAQ 6.22:   How can I match strings with multibyte  <pilsl_@goldfisch.at>
    Re: FAQ 6.22:   How can I match strings with multibyte  <elijah@workspot.net>
    Re: find() within find()? <krahnj@acm.org>
    Re: find() within find()? (Clinton A. Pierce)
    Re: Flame,help or killfile ? <buggs-clpm@splashground.de>
        How does Perl handle multiple users? <cochise@sky.net>
    Re: How does Perl handle multiple users? (Logan Shaw)
    Re: How does Perl handle multiple users? <jhall@ifxonline.com>
    Re: How to sort by number first then sort by english na (Randal L. Schwartz)
    Re: How to sort by number first then sort by english na <tsee@gmx.net>
        IEEE 1394  adapter card support ? <rozman@fri.uni-lj.si>
    Re: Is this Perl??? <dkoleary@mediaone.net>
    Re: Is this Perl??? (PaulWilson18)
    Re: Newbie:  Help with cookie code ? (PaulWilson18)
    Re: Newbie: $ character end string? What is wrong? (PaulWilson18)
    Re: OK, it's a bug.  I think. (Sweth Chandramouli)
    Re: OK, it's a bug.  I think. <elijah@workspot.net>
    Re: OT (was Process form WITHOUT feedback page PART 2) <godzilla@stomp.stomp.tokyo>
    Re: parsing perl again <mischief@velma.motion.net>
    Re: Perl is dead! Long live Perl! <billy@armsrace.kremvax.su>
    Re: Perl Regex Question (PaulWilson18)
    Re: perl/cgi and dynamic hyperlink (Logan Shaw)
    Re: perl/cgi and dynamic hyperlink <mischief@velma.motion.net>
    Re: perl/cgi and dynamic hyperlink <buggs-clpm@splashground.de>
    Re: question : OO accessing main::a from main::b::c ?? <ren@tivoli.com>
    Re: Recursing a directory tree <mischief@velma.motion.net>
        Required or executed? <der.prinz@gmx.net>
    Re: Required or executed? <ivoz@starmail.com>
        Setting Up ActiveState Perl on PWS (Chad)
    Re: taint + netstat = error <ryantate@OCF.Berkeley.EDU>
    Re: The FlakeyMind Thaddes FAQ (v0.1) (Topmind)
        Urgent : control code sequences?!?! <brien@discover-net.net>
        variable in variable name <jhall@ifxonline.com>
    Re: What am I doing wrong with this array operation? (PaulWilson18)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 07 Jun 2001 00:01:07 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: (csv) Split at a coma, how?
Message-Id: <20010606200107.20723.00000029@ng-fq1.aol.com>

foreach (@array) {
split(/,/, $_);
}


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

Date: Wed, 06 Jun 2001 22:47:23 GMT
From: Gary <gamtci@mpinet.net>
Subject: Binary files, any suggestions?
Message-Id: <3B1EB344.5582@mpinet.net>

I have a need to read and write binary files (no expectation 
of any sensible text in them).  I'm new to perl, although I've
finished the Perk/Tk aspect of the program and it works fine.

I've gone through several of my Perl books and there's really
never any information on dealing with strictly binary files.
I found "binmode" which I plan to use.

I was wondering if there are any hints or suggestions before I go 
and write this program 15 times before finally figuring it out.  
The data in the files are strings and single chars of binary data, 
some ASCII strings, and 32-bit and 16-bit integers.

Thanks in advance for any advice.


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

Date: 6 Jun 2001 15:22:54 -0700
From: corcos@metalink.com (Igal Corcos)
Subject: Calling programs from a cgi
Message-Id: <23e89631.0106061422.10629f5c@posting.google.com>

Hi,

Can anyone tell me how to call another program from a cgi script.
For example, I have a program in my /bin directory that I want to call
from a cgi script.

I've tried the system(LIST) command but this does not seem to work.  I
get an error saying my program did not produce a valid http header.

Any help would be greatly appreciated.

Thanks.
-Igal Corcos


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

Date: Wed, 6 Jun 2001 19:58:38 -0500
From: "Winston Kotzan" <winz@prodigy.net>
Subject: Re: Decimal to Hex
Message-Id: <9fmjk3$br7u$1@newssvr06-en0.news.prodigy.com>

Thank you very much to everyone who replied to my problem.  I have that part
of my program working perfectly now.  Thanks for the help.

--
Winston Kotzan
http://wak.cjb.net/

"Steffen Beyer" <sb@engelschall.com> wrote in message
news:675lf9.qra.ln@imperia.net...
> Winston Kotzan <winz@prodigy.net> wrote:
>
> > I'm writing a CGI program for the registration of shareware.  The
trouble
> > I'm having is converting a long decimal number to a hexadecimal number.
I
> > tried something similar to this:
> >
> >   $CodeStr =   25194917170125117;
> >   $RegCode = sprintf("%X", $CodeStr);
> >
> > However, the result of printing RegCode yielded FFFFFFFF.  What did I do
> > wrong, and is there an alternative to the sprintf() command?
> >
> > Assistance is very much appreciated.
>
> #!perl
>
> use Bit::Vector;
>
> $CodeStr = '25194917170125117'; # note the quotes which are vital here!
>
> $VecSize = int( 1 + length($CodeStr) * 3.3 / 4 ) * 4; # 3.3 =
log(10)/log(2)
>
> $CodeVec = Bit::Vector->new_Dec($VecSize, $CodeStr);
> $RegCode = $CodeVec->to_Hex();
> $CheckIt = $CodeVec->to_Dec();
>
> print "\$VecSize = '$VecSize'\n";
> print "\$CodeStr = '$CodeStr'\n";
> print "\$CheckIt = '$CheckIt'\n";
> print "\$RegCode = '$RegCode'\n";
>
> This prints:
>
> $VecSize = '60'
> $CodeStr = '25194917170125117'
> $CheckIt = '25194917170125117'
> $RegCode = '05982A4C812193D'
>
> Bit::Vector is available from CPAN or from
>     http://www.engelschall.com/u/sb/download/
>
> Hope this helps!
> --
>     Steffen Beyer <sb@engelschall.com>
>     (This message may not be replyable. Use address on line above
instead!)
>     http://www.engelschall.com/u/sb/whoami/ (Who am I)
>     http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
>     http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)




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

Date: Thu, 7 Jun 2001 01:14:46 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: FAQ 6.22:   How can I match strings with multibyte characters?
Message-Id: <3b1eb967$1@e-post.inode.at>

PerlFAQ Server wrote:

>   How can I match strings with multibyte characters?
> 
>     This is hard, and there's no good way. Perl does not directly support
>     wide characters. It pretends that a byte and a character are
>     synonymous. The following set of approaches was offered by Jeffrey
>     Friedl, whose article in issue #5 of The Perl Journal talks about this
>     very matter.
> 

While this seems to be true (cause it describes one great problem when 
dealing with unicode-databases) it is not what I found in 'man 
perlunicode'. According to this documentation there should be a difference 
between bytes and characters - under special circumstances even when 
dealing with regexpressions. My Problem is: It doesnt work the way it is 
described there.

Unfortunately it is very hard to find people in the usenet to discuss this 
problem.

peter

-- 
pilsl_@goldfisch.at
http://www.goldfisch.at


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

Date: 6 Jun 2001 23:33:33 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: FAQ 6.22:   How can I match strings with multibyte characters?
Message-Id: <eli$0106061929@qz.little-neck.ny.us>

In comp.lang.perl.misc, peter pilsl  <pilsl_@goldfisch.at> wrote:
> While this seems to be true (cause it describes one great problem when 
> dealing with unicode-databases) it is not what I found in 'man 
> perlunicode'. According to this documentation there should be a difference 
> between bytes and characters - under special circumstances even when 
> dealing with regexpressions. My Problem is: It doesnt work the way it is 
> described there.
> 
> Unfortunately it is very hard to find people in the usenet to discuss this 
> problem.

I'll discuss it, but I have no deep knowledge. :^) Just put 'unicode' or
'utf8' in the subject and it gets auto-selected for me.

I've been playing a little with 5.6.1 and it seems better than 5.6.0
but that is still preliminary tests.

Elijah
------
still running 5.6.1 out of the build directory


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

Date: Wed, 06 Jun 2001 23:27:21 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: find() within find()?
Message-Id: <3B1EBC80.8B97CBDB@acm.org>

Patrick Flaherty wrote:
> 
> Hello,
> 
>   New to perl and not sure what the limitations are on subroutine use?
>   I don't seem to be able to call find() within another find(), as in:
> 
> use File::Find;
> my $this_subtree;
> 
> find \&wanted , ('.');
> 
> sub wanted {
>     if (-d $_) {
>         print $_ . "\n";
>         find \&sub_tree , ($_)  ;
>         print $this_subtree . "\n";
>     }
> }
> 
> sub sub_tree {
>     $this_subtree += -s;
> }
> 
> The inner find() seems, in effect, to short-circuit (prematurely terminate) the
> outer find().
> 
>   Any ideas why?

You really don't want to do this.  :-)

#!/usr/bin/perl -w
use strict;
use File::Find;

opendir DIR, '.' or die "Cannot open the current directory: $!";
my @dirs = grep { -d and !/^\.\.?$/ } readdir DIR;
closedir DIR;

for my $dir ( @dirs ) {
    my $this_subtree;
    find( sub { $this_subtree += -s }, $dir );
    print "$dir $this_subtree\n";
    }

__END__


John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 06 Jun 2001 23:51:40 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: find() within find()?
Message-Id: <gmzT6.41548$DG1.6597156@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <1849356.00016bf6.023@drn.newsguy.com>,
	Patrick Flaherty <Patrick_member@newsguy.com> writes:
> Hello,
> 
>   New to perl and not sure what the limitations are on subroutine use?
>   I don't seem to be able to call find() within another find(), as in:
> 
> The inner find() seems, in effect, to short-circuit (prematurely terminate) the
> outer find().
> 
>   Any ideas why?

Yes: Use the Source, Luke.  In File/Find.pm for 5.6.0 I see:

my %SLnkSeen;
my ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
    $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat);

So it seems like File::Find is using a lot of variables that are scoped
to that source file.  In effect, making them global variables for the module.

Probably the find() subroutine (or somethng it calls) trashes one or more 
of these on subsequent invocations that had been setup before.  

The bigger question is, why are you calling find() this way?  It's gonna 
recurse down _for_ you (which is the whole point of calling it).


-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org         Perl Developer's Dictionary -- May 2001
"If you rush a Miracle Man,     for details, see http://geeksalad.org     
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Thu, 7 Jun 2001 02:28:26 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: Flame,help or killfile ?
Message-Id: <9fmhs6$kdb$03$1@news.t-online.com>

Stefan Weiss wrote:

--snip--
> Anyway, I can understand that the regulars* are stressed with the volume
> of postings here, and we're all thankful that they are still here and
> helping, but in my opinion it is their overreacting as often as someone
> doing something really stupid that causes meta-discussions like this
> thread every few days. There Is More Than One Way To tell a newcomer
> that he should have ( read the docs | posted to another group | put the
> quoted text on top | etc ), and if you do it in an unfriendly way, it
> just might backfire and cause another annoying flame war here.

I really go with that paragraph.

And I'd like to add that an intelligent "flame"
ends a discussion and a bad one starts a
whole 20 posts thread which gets more and more
aggressive and less intelligent but rude

I actually found very interesting the difference between
how Larry percieved this newsgroup some years ago
and the defacto.

Buggs 


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

Date: Wed, 06 Jun 2001 17:25:39 -0500
From: Steve <cochise@sky.net>
Subject: How does Perl handle multiple users?
Message-Id: <3B1EADE3.BD0A2351@sky.net>

When data gets sent to a Perl script to be processed, what happens when
other users submit data to the same script.  Do they wait until the
person in front of them is done?  Or can more than one person use the
same script at the same time?  If so, is there a limit?

Steve


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

Date: 6 Jun 2001 18:09:12 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: How does Perl handle multiple users?
Message-Id: <9fmd6o$acj$1@charity.cs.utexas.edu>

In article <3B1EADE3.BD0A2351@sky.net>, Steve  <cochise@sky.net> wrote:
>When data gets sent to a Perl script to be processed, what happens when
>other users submit data to the same script.  Do they wait until the
>person in front of them is done?  Or can more than one person use the
>same script at the same time?  If so, is there a limit?

A Perl script is just code.  It might never be run, or exactly copy of
it might be running at any given time, or a million copies might be
running.

Handling this the job of your operating system, or whatever other
program is invoking the Perl script.

If you want to talk about running instances of a Perl script, then
normally a Perl script will interact with only one user, but there is
no reason why this *must* be the case.  In fact, there are web servers
and mail servers written in Perl, and these interact with multiple
other computers simultaneously.

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


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

Date: Thu, 07 Jun 2001 00:42:49 GMT
From: "John Hall" <jhall@ifxonline.com>
Subject: Re: How does Perl handle multiple users?
Message-Id: <d6AT6.30622$%a.1752546@news1.rdc1.sdca.home.com>

If you were administrating a web server, say apache on UNIX, and you had a
perl script that people used to submit forms, and you looked at all the
processes running - you might see that perl script running a dozen times if
a dozen people were 'hitting it' at the same moment.

So you better be careful if you're having the script do things locally that
might clobber eachother.. Like update logs or something.


"Steve" <cochise@sky.net> wrote in message news:3B1EADE3.BD0A2351@sky.net...
> When data gets sent to a Perl script to be processed, what happens when
> other users submit data to the same script.  Do they wait until the
> person in front of them is done?  Or can more than one person use the
> same script at the same time?  If so, is there a limit?
>
> Steve




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

Date: 06 Jun 2001 15:36:45 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <m1k82p5j7m.fsf@halfdome.holdit.com>

>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:

Todd> @sorted = sort {
Todd> chomp ($a, $b);
>> 
>> Don't do that.  You've just altered the original values in the source
>> list.  Repeatedly. :)
>> 

Todd> I didn't want to do a numeric compare on two strings with
Todd> newlines, even if they do evaluate out to be numbers.

That may well be true.  But you *chomped* *$a*.

$a is a reference back into the original data.  Altering $a alters
the original data.

Don't do that (he says again, and POINTS BACK UP AT WHAT HE SAID BEFORE
AND Todd DIDN'T SEEM TO NOTICE).

It's not like I'm typing randomly here.  I say things for a purpose.

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


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

Date: Thu, 7 Jun 2001 02:31:59 +0200
From: <tsee@gmx.net>
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <9fmhum$g9h$05$1@news.t-online.com>

"Randal L. Schwartz" <merlyn@stonehenge.com> schrieb im Newsbeitrag
news:m1k82p5j7m.fsf@halfdome.holdit.com...

[snip]

> That may well be true.  But you *chomped* *$a*.
>
> $a is a reference back into the original data.  Altering $a alters
> the original data.

Banging my head on the keyboard, I realise that's something *really* bad I
did to one of my first scripts.

Moral: Never ever reuse your first scripts/programs ;-)

> Don't do that (he says again, and POINTS BACK UP AT WHAT HE SAID BEFORE
> AND Todd DIDN'T SEEM TO NOTICE).
>
> It's not like I'm typing randomly here.  I say things for a purpose.

Really? I thought that's why it's you answering questions instead of posting
them!






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

Date: Thu, 7 Jun 2001 00:09:09 +0200
From: "Robert Rozman" <rozman@fri.uni-lj.si>
Subject: IEEE 1394  adapter card support ?
Message-Id: <9fm9g8$d7e$1@news.uni-lj.si>

Hello,

I wonder if there is any module in PERL that would communicate with PCI IEEE
1394 interface card ?


Thanks in advance,

Robert Rozman





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

Date: Wed, 06 Jun 2001 22:51:45 GMT
From: Doug O'Leary <dkoleary@mediaone.net>
Subject: Re: Is this Perl???
Message-Id: <MPG.158870fe28525a1989797@news.randori.com>

Hey;

If you know the name and location of the program creating this error, run 
"file" on it.  For example:  

$ file bin/check_logs
bin/check_logs: perl commands text

or

$ file /usr/bin/passwd
/usr/bin/passwd: setuid ELF 32-bit LSB executable, Intel 80386, version 
1, dynamically linked (uses shared libs), not stripped

HTH;

Doug

-- 
-------------------
Douglas K. O'Leary
Senior System Administrator
dkoleary@mediaone.net


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

Date: 06 Jun 2001 23:56:44 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: Is this Perl???
Message-Id: <20010606195644.20723.00000027@ng-fq1.aol.com>

no


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

Date: 07 Jun 2001 00:00:14 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: Newbie:  Help with cookie code ?
Message-Id: <20010606200014.20723.00000028@ng-fq1.aol.com>

Try:

my $IN = new CGI;

my $cookie = $IN->cookie ( -name => 'ck',
                                         -value => 'one'
                                       );

print $IN->header ( -cookie => $cookie );

Then to fetch........

%ck = fetch CGI::Cookie;

($name,$value) = split(/=/, $ck{ck});
print header;
print "Cookie value is $value";


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

Date: 07 Jun 2001 00:13:14 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: Newbie: $ character end string? What is wrong?
Message-Id: <20010606201314.20675.00000293@ng-fm1.aol.com>

The syntax is wrong.......

Try:
$string="Hello world";

if ($string =~ /Hello$/)
{
        print"Hello is at the the end\n";
}


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

Date: Wed, 06 Jun 2001 22:21:32 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: OK, it's a bug.  I think.
Message-Id: <M1yT6.58526$G5.12729929@news1.rdc1.md.home.com>

In article <eli$0106061653@qz.little-neck.ny.us>,
Eli the Bearded  <elijah@workspot.net> wrote:
>In comp.lang.perl.misc, Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
>> Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
>> >	.  (This is with perl, version 5.005_03 built for 
>> >sun4-solaris-thread, for reference.)
>> 	I just copied the script over to another machine, this one
>> running version 5.005_03 built for sun4-solaris (not -thread), and it
>> behaves exactly as expected, regardless of whether I use $/ or
>> $INPUT_RECORD_SEPARATOR.
>> 
>> 	Is this a bug to be reported, or am I still missing 
>> something?
>
>I've had problems with 'use English' and threading perls. I suspect
>that is at the heart of the problem. It probably is a documentation 
>issue. I perlbug'ed it when I found it and got back a response to
>the tune of "of course that doesn't work with -thread".
	I couldn't find any entries in perlbug about English with
threads.  Could folks try out the following code on their systems and
let me know if it's consistent that it breaks on sun4-solaris-thread?
Thanks.

#!/usr/local/bin/perl

use English;
use Term::ReadKey;

print "\nInitial:\n";
print "\$/: '$/'\n";
print "\$INPUT_RECORD_SEPARATOR: '$INPUT_RECORD_SEPARATOR'\n";

if (@ARGV) {
   local $INPUT_RECORD_SEPARATOR;
   print "\nLocalized values (using INPUT_RECORD_SEPARATOR):\n";
   print "\$/: '$/'\n";
   print "\$INPUT_RECORD_SEPARATOR: '$INPUT_RECORD_SEPARATOR'\n";
} else {
   local $/;
   print "\nLocalized values (using /):\n";
   print "\$/: '$/'\n";
   print "\$INPUT_RECORD_SEPARATOR: '$INPUT_RECORD_SEPARATOR'\n";
};

print ("\nEnter String: ");
$user_input = ReadLine (0);

print "\n\nPrechomp: '$user_input'\n";
chomp ($user_input);
print "Postchomp: '$user_input'\n";

print "\nFinal:\n";
print "\$/: '$/'\n";
print "\$INPUT_RECORD_SEPARATOR: '$INPUT_RECORD_SEPARATOR'\n";
__END__

	.  ("Broken" means that invoking this without an argument
works fine, but invoking it with an argument causes chomp to fail, ReadLine
to require an EOF to return, and $/ and $INPUT_RECORD_SEPARATOR to differ;
for "non-broken" perls, both invocations should Do The Right Thing.)

	-- Sweth.

-- 
Sweth Chandramouli ; <sweth+perl@gwu.edu>


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

Date: 6 Jun 2001 23:28:34 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: OK, it's a bug.  I think.
Message-Id: <eli$0106061921@qz.little-neck.ny.us>

In comp.lang.perl.misc, Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
> Eli the Bearded  <elijah@workspot.net> wrote:
> >In comp.lang.perl.misc, Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
> >> 	Is this a bug to be reported, or am I still missing 
> >> something?
> >I've had problems with 'use English' and threading perls. I suspect
 ...
> 	I couldn't find any entries in perlbug about English with
> threads.  Could folks try out the following code on their systems and
> let me know if it's consistent that it breaks on sun4-solaris-thread?

perl5.005003 without -thread ran it fine.
perl5.6.0    with    -thread broke it.
perl5.6.1    without -thread ran it fine.

All my tests on i686-linux. I don't have a perl5.6.0 without -thread or
perl5.6.1 or perl5.005003 with -thread to test, but I have strong
suspicions about the results.

Elijah
------
build perl5.6.0 with -thread as an experiment and decided not to repeat it


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

Date: Wed, 06 Jun 2001 15:10:03 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OT (was Process form WITHOUT feedback page PART 2)
Message-Id: <3B1EAA3B.55606B14@stomp.stomp.tokyo>

GearGirl wrote:
 
> Godzilla! wrote:
> > GearGirl wrote:
> > > Godzilla! wrote:
> > > > GearGirl wrote:

(snipped)

> > Your cookie routine has been reduced to bare essentials for testing.
 
> Thanks for the suggestion!  And it makes for easier reading for anyone
> wanting to help.  Will try bare-bones posting in the future.
 
> > What happens here, in your else choice, is printing a 204 message
> > conflicts with your html print,   &invalid_viewer;  , following.
> > You cannot return a "no response" then print html. One or the
> > other but not both. This might be the very source of your problem.
> > Note I added a content type print to &valid_viewer. This is a must.
 
> DOH!  Yeah, I didn't catch that before.  The machine I was testing on
> had, of course, registered.  So I had not tested that scenario yet.

 
Run a search on your system and discover where MSIE is stashing
your cookies. Could be anywhere. MSIE writes directories all over
your system with most being completely useless. You might even
find multiple cookie files. Rename your cookie file or files,
temporarily, to kill cookies. You may then test your code.
I cannot remember if MSIE allows you to disable cookies and,
if this will disable reading of cookies already on file.

An alternative is to comment out your cookie sub-routine and
the else following leaving only your "else" alternative code
for testing.

The final outcome of this is you may have to redirect MSIE
browsers to a different page for special treatment. I am not
so sure all this work is worth not having a following page
for confirmation.

Nonetheless, this is an interesting use for antiquated status 204.
I do encourage rogue programming; this is a true art.

Godzilla!


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

Date: Wed, 06 Jun 2001 23:20:35 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: parsing perl again
Message-Id: <thtem3h3s6g78f@corp.supernews.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Damian Conway wrote:

>>Actually, Perl *is* like C in that regard except the other way around:
>>it needs a recursive descent parser because LALR just doesn't hack it. ;-)

> I thought I had read in the dragon book, that LALR is more powerful than
> recursive descent? But, it's been a while. I forgot most of the details.

LALR is faster and more sophisticated, but it requires a context-free
grammar. Recursive descent is slower and a bit simpler, but it can
carry context with it because of its recursive nature. Perl just
wouldn't be Perl if the grammar was context-free.

> Also note that I do think that *humans* use a recursive descent approach
> to comprehend, let alone write, programming code.

In many cases this is probably exactly right. In fact, this is why
many compilers written by hand without the use of compiler generators
tend to use a recursive descent approach. Doing shift-reduce like a
finite automaton keeping track of states can be difficult for an
unaided human mind. That's where LALR / LR(x) / LL(x) parser generators
come in handy.

Chris

-- 
It's not the U in UBE that pisses people off. It's the B.
  -- Martien Verbruggen in clp.misc



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

Date: Wed, 6 Jun 2001 23:22:03 +0000 (UTC)
From: Billy Chambless <billy@armsrace.kremvax.su>
Subject: Re: Perl is dead! Long live Perl!
Message-Id: <9fmdup$v8t$1@news.datasync.com>

In article <3B1DF75B.559B4D51@earthlink.net>,
Andrew Lee  <spamnoo@earthlink.net> wrote:

>Now that corporate reins are tightened and Java is all the rage -- 

Fortunately, most corporate health plans cover Prozac now,
so rage isn't the problem it was. You can proably get it via Medicaid, 
though.

> what manager would invite chaos into her/his system with crazy Perl hacks?

Managers are the source of all chaos. Not to mention entropy and gastric 
irritation.

>So much better to leave the mind behind -- Programming with a mouse can
>be fun!  Yes it can!

Goats are even more fun!

>Soon, very soon unix will be a a footnote in the history of the Almighty
>Microsoft.

Uh...  yeah.

>Beware beware ... Perl angels look down upon us -- from the unemployment
>line.

Unemployed angels? Man, times is HARD! Yesterday, I saw a pimp drini's
a Yugo!

>Larry and Tom and Randall have gigs -- what about you?  Your manager is
>willing to support your crazy Perl antics?  When will he do the RIGHT
>thing and turn to Java???

My manager  makes a pot of Java every morning, usually before 
I get to work. He's a great guy. He helps me sometimes with database
stuff, but he makes me do all the Perl.

>Come -- join me on the unemployment line!  Be a statistic!  Be all that
>this horrible language can let you be!

NAh... it lets me be sittin' on my ass drinking expensive Scotch.

>So!  Stop talking!!!! 

Now THEREs an idea!

> and get in the unemployment line!!!! 

No way. You bums would beg for my Scotch.







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

Date: 07 Jun 2001 00:12:02 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: Perl Regex Question
Message-Id: <20010606201202.20675.00000292@ng-fm1.aol.com>

How about...

/\d*\.?(\d*)?/


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

Date: 6 Jun 2001 18:04:23 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <9fmctn$ab3$1@charity.cs.utexas.edu>

In article <h07tht0c46tr3isgvcusfnm53iecujepim@4ax.com>,
Lou Moran  <lmoran@wtsg.com> wrote:
>On 6 Jun 2001 13:08:23 -0700, krakle@visto.com (krakle) wrote
>wonderful things about sparkplugs:
>>I bet if Larry Walton came here under an alias (Lets just say
>>WaffleKing) you would probably call him a newbie as well
>
>Who is Larry Walton?

He's that guy from that 1970's TV show about a family that lives in the
mountains.  And didn't you know -- the language Python was invented by
this family named Ingalls.

OK, there wasn't really a Larry Walton, but there was a Zebulon, and
Zebulon is a cool name.

>BSOD? In my day we didn't have 0000FF!

Maybe, but that "OOF" painting has been hanging in the Museum of Modern
Art for a while.  I searched the web to try and figure out how long,
but all I could find was pages by people who have trouble spelling "of"
and "momma".  By the way, if anyone knows where I can get an OOF
T-shirt, I'm all ears.  <insert corny "Starry Night"-related joke here>

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


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

Date: Wed, 06 Jun 2001 23:37:34 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <thtflui1o3fcaf@corp.supernews.com>

krakle <krakle@visto.com> wrote:

> People this is the internet.. Answer the questions posted or just

No, this is not "the internet". This is a Usenet newsgroup. Usenet
can be accessed via portals other than the Internet. It predates
the Internet. 

This particular Usenet newsgroup is a discussion group (as are
nearly all groups). Sure, questions get answered, but if all
there was to do was to answer questions, then many of us would
spend our time getting paid to do so somewhere else instead of
coming here. Posts made to a discussion group are open to
discussion. Please do not tell people they must ignore a message.
If you post to a public place, the public has a right to comment
on what they read in your post. You have the right to ingore
those comments _if_you_wish_. No one forces you to respond to a
post nor to ingore it, and you should not be telling others which
to do, either.

> ignore the message... I find it very funny that you regulars will call
> someone a Perl newbie because they are new to  this NEWSGROUP but yet
> still reside to insult them even though these "newbies" know more
> about perl than they do....

"you regulars"..."call someone"..."newbie"..."though"..."newbies"...
"know more"..."perl than they do"

It took a second or three to figure this one out. Flailing
number and person make a sentence read awkwardly.

Anyway, very few regulars around here will insult someone
without provocation. Some people just take offense to being
corrected. People who take offense to being corrected should
not be in a technical field, IMHO.

> I bet if Larry Walton came here under an alias (Lets just say
> WaffleKing) you would probably call him a newbie as well... Humor
> me...

Who is Larry Walton?

Chris
-- 
You must not lose faith in humanity. Humanity is an ocean;
if a few drops of the ocean are dirty, the ocean does not
become dirty.  -- Mohandas K. Gandhi



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

Date: Thu, 7 Jun 2001 02:38:00 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <9fmie4$kdb$03$2@news.t-online.com>

krakle wrote:

--snip--

Godzilla! was rigth when she said  you was a troll.

Buggs


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

Date: 06 Jun 2001 15:32:14 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: question : OO accessing main::a from main::b::c ??
Message-Id: <m3lmn5s629.fsf@dhcp9-173.support.tivoli.com>

On 6 Jun 2001, rbreman@avensus.nl wrote:

> I'am writing my first big perl OO program, i did some small ones
> wich kept to only 1 package from main.

[snipped rest of description and pseudo-code]

The last time I said this, it started a thread of discussion on the
subject, but from an OO perspective, there shouldn't be any need for
you to access other packages.  Pass your instance variables around and
call methods.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Wed, 06 Jun 2001 23:09:26 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Recursing a directory tree
Message-Id: <thte16oue9v7a7@corp.supernews.com>

Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
> On Wed, 06 Jun 2001 04:42:07 GMT, Nan Wang <nwang@shell3.shore.net> wrote:
>>Martien Verbruggen <mgjv@tradingpost.com.au> wrote:

>>I already admitted that I goofed on that part before ever had the displeasure
>>of talking to you.  WTF was your problem? 
>>
>>> see ya. or rather, won't.
>>
>>Big loss, not!

> See, Chris, this is a typical case of someone who deserves a public
> plonking.

I agree wholeheartedly with Bernard. Although I don't believe
strongly in public plonking, I will make an exception for an
exceptional case.

 *kerPlonK!*

Chris

-- 
Parking for people we like only. All other vehicles will be vandalized.



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

Date: Thu, 7 Jun 2001 01:14:03 +0200
From: "Stefan Weiss" <der.prinz@gmx.net>
Subject: Required or executed?
Message-Id: <3b1eb8fa$1@e-post.inode.at>

Hi

Is there a way to test if a script has been started either

    - directly form a shell: ./script.pl
    - passed to perl as parameter: perl script.pl
    - called from some other script: system(), exec(), ...

or

    - require()d from inside a perl script?


I only need to seperate the first three from the last. I tried to
ckeck if STDIN/STDOUT were terminals, but that did not help.


thanks,
stefan





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

Date: Thu, 7 Jun 2001 03:44:49 +0300
From: "Ivo Zdravkov" <ivoz@starmail.com>
Subject: Re: Required or executed?
Message-Id: <3b1ecdd9@news.nwlink.com>

this work, but the style is ... :(

if ($PROGRAM_NAME ne the_script_name){
    # requred
}

"Stefan Weiss" <der.prinz@gmx.net> wrote in message
news:3b1eb8fa$1@e-post.inode.at...
> Hi
>
> Is there a way to test if a script has been started either
>
>     - directly form a shell: ./script.pl
>     - passed to perl as parameter: perl script.pl
>     - called from some other script: system(), exec(), ...
>
> or
>
>     - require()d from inside a perl script?
>
>
> I only need to seperate the first three from the last. I tried to
> ckeck if STDIN/STDOUT were terminals, but that did not help.
>
>
> thanks,
> stefan
>
>
>




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

Date: 6 Jun 2001 16:19:33 -0700
From: vipergtsrz@hotmail.com (Chad)
Subject: Setting Up ActiveState Perl on PWS
Message-Id: <fb12487b.0106061519.3b56e24a@posting.google.com>

I know there are other people out there with posts about PWS and Perl,
but I have a different problem. I bought a book about Perl (from Wrox)
and followed the directions exactly to set it up. I changed the
registry and I set all the permissions. I am getting an HTTP
500/Server Error every time I try to access it. Does anyone know why
this would be? Please help. Thank you.

~Chad


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

Date: Wed, 6 Jun 2001 22:53:25 +0000 (UTC)
From: Ryan Travis Tate <ryantate@OCF.Berkeley.EDU>
Subject: Re: taint + netstat = error
Message-Id: <9fmc95$1dq1$1@agate.berkeley.edu>

Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
 | AFAICT, it's not so much that there are any "variables" involved, but
 | whether or not the "expression" performs an "unsafe operation", and
 | that perl learned that the "expression" still contains tainted data 
 | right before it actually attempts to perform the "unsafe operation".

this makes some sense to me; the key insight seems to have to do with
the difference between a var and an expression ...

 | I think what Mike Guy is trying to say is that your "bug" is caused
 | by an "optimization", i.e. it's a perl "feature" (note the lowercase 
 | "p"). The documentation patch he submitted seems to reflect this.

OK, i think i understand this now. in the previous documentation,
which i had read and which appears in some form in the Camel book, i
had absorbed the idea that sometimes perl would spit out illogical
taint warnings,and that this was an optimization, but i thought this
only concerned tainted vars ...

 | Now that you know what "idio-matic Perl" really means, you can just
 | drop the hyphen in your real code's comment.

i am not familiar with the term "idio-matic" -- does the hyphen give
the term a meaning opposite of idiomatic? 

 | The return value of the first `true` operation is tainted, which
 | causes the second instance to balk. (The first pair of backticks
 | *is* executed).

 ... and with this, everything made sense :-)

thanks for your help, joe

cheers
r


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

Date: Thu, 07 Jun 2001 00:34:13 GMT
From: topmind@technologist.com (Topmind)
Subject: Re: The FlakeyMind Thaddes FAQ (v0.1)
Message-Id: <MPG.15886de4eab904e798995b@news.earthlink.net>

> 
> I guess it is fairly simple.  He is not your employee to work instead of
> you.  You are free to make such FAQ.  Will help to proove your level of
> (not) understanding OO anyways.  Your behaviour and empty agruments here
> did not create you friends... so you can expect fed up people to do
> things like this.  Say thanx to yourself... and go away.
> 
> A
> 

So he is simply *venting* rather than trying to achieve anything
real?

Well, I am frusted by the high hype-to-proof ratio of OOP.
Can I vent too by complaining about which radio stations
OO fans listen to?

-T-




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

Date: Wed, 6 Jun 2001 18:02:13 -0500
From: "Brien Wankel" <brien@discover-net.net>
Subject: Urgent : control code sequences?!?!
Message-Id: <thtdgae8e4h5cf@corp.supernews.com>

i'm writing a script that has to telnet [Net::Telnet] into a piece of
equipment here at work to get some user data. the problem is that once i'm
logged into the equipment i have to send <esc>[<esc>0 to get to the command
prompt that i need. i've tried
@result = $session->cmd(String => "\033 [ \033 0", Prompt => '/MAX>/');
and it doesn't work.
i've also tried to set up the key sequence as a string like this:
$escseq = sprintf("\033","[", "\033", "0");
then sending $escseq as the String in cmd();
i've also tried changing the [ to a \[ but nothing changed.
does anybody know a way to do this [or what i'm doing wrong]. another
workaround would be to send a ctrl-d as the command but i haven't figured
that one out either.

please help!!
thanks in advance,

Brien Wankel
Discover-Net, Inc.




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

Date: Thu, 07 Jun 2001 00:39:21 GMT
From: "John Hall" <jhall@ifxonline.com>
Subject: variable in variable name
Message-Id: <Z2AT6.30609$%a.1752214@news1.rdc1.sdca.home.com>

Ooh, you were getting all ready to yell at me weren't you?

I know how to use Deja News.. Anyway, I read the faq, and got this code
working, but it seems like a ridiculous way to do it! Is there a simpler
way?
___________________________________
#!/usr/bin/perl

%database1 = (
          1 => 'one',
          );

$db = 'database1';
&open_db($db);

sub open_db {

%USER_VARS = ( 1 => @_ );

    print ${$USER_VARS{'1'}} {'1'};

}
___________________________________

Like, for example, why am I going to get a spanking from you kids if I do it
this way?:

___________________________________
#!/usr/bin/perl

%database1 = (
          1 => 'one',
          );

$db = 'database1';
&open_db($db);

sub open_db {

    print ${"@_"} {'1'};

}
___________________________________


http://moron.shutdown.com






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

Date: 07 Jun 2001 00:14:24 GMT
From: paulwilson18@aol.com (PaulWilson18)
Subject: Re: What am I doing wrong with this array operation?
Message-Id: <20010606201424.20675.00000296@ng-fm1.aol.com>

forach (@arr) {
print "$_\n":
}


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

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


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