[9317] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2912 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 19 14:07:56 1998

Date: Fri, 19 Jun 98 11:00:49 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 19 Jun 1998     Volume: 8 Number: 2912

Today's topics:
        ^I <ankola@cig.mot.com>
        Comma Operater in a Block <rs83@is7.nyu.edu>
    Re: Comma Operater in a Block (Michael J Gebis)
    Re: Creating the Cartesian product of a set of sets --  <jdporter@min.net>
        Efficiency: required reading (Andy Lester)
    Re: first language <nguyend7@egr.msu.edu>
    Re: first language (Rich Morin)
    Re: first language (Abigail)
    Re: first language (Chris Nandor)
    Re: Flames.... (Stuart McDow)
    Re: Flames.... <tchrist@mox.perl.com>
    Re: Flames.... <johnc@interactive.ibm.com>
    Re: help comparing strings <psdspss@execpc.com>
    Re: help comparing strings <quednauf@nortel.co.uk>
    Re: help with string comparisons (Larry Rosler)
        IRIX upgrade 5.3 -> 6.2  "Illegal expression as lvalue  <bhewitt@orca.akctr.noaa.gov>
    Re: Multi-D Array Sorting <jdporter@min.net>
        Need to split a line with spaces <john.madden@ssa.gov>
    Re: Need to split a line with spaces <chris@nemonet.com>
    Re: Need to split a line with spaces (Joel Coltoff)
    Re: Novell Perl <perlguy@inlink.com>
    Re: Perl CGI problem with Netscape Fasttrack (Steve Linberg)
        Perl debugger with GUI  ptkdb Vers 1.0121 (Andrew E Page)
    Re: Problem with references (Abigail)
        Regular Expression Question <laura.morgan@itron.com>
        setuid problem <zjm@fast-inc.com>
        String manipulation question? camposj@ctc.com
    Re: the ?PATTERN? match syntax pverdret@sonovision-itep.fr
    Re: the ?PATTERN? match syntax <*@qz.to>
    Re: Windows NT, how to copy binary files ! <psdspss@execpc.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Jun 1998 12:11:22 -0500
From: Atul R Ankola <ankola@cig.mot.com>
Subject: ^I
Message-Id: <358A9BBA.7351@cig.mot.com>

Can anyone tell me what the ^I sequence in PERL does?  I've heard that
it can do 4-5 steps in one.  Can anyone refer me to a site that has this
handy?  Thanks.


-- 
---Atul
--


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

Date: Sat, 20 Jun 1998 11:33:38 -0400
From: Ruben I Safir <rs83@is7.nyu.edu>
Subject: Comma Operater in a Block
Message-Id: <358BD651.5749F812@is7.nyu.edu>

Going over the Camel Book I see some algorithms for case/esac or switch
using blocks.

I thought I saw an error in coding, but it seems to be correct, and now
I'm very confused.

I ran the following code:
__________________________________________________________________
#! /usr/bin/perl

$_ = "def";

SWITCH:  {
    if (/^abc/) {$abc = 1; last SWITCH; }
    if (/^def/) {$def = 1; last SWITCH; }
    if (/^xyz/) {$xyz = 1; last SWITCH; }
    $nothing = 1;
}
print "ABC: $abc \n DEF: $def \n XYZ: $xyz \n";


SWITCH:  {
    $abc = 1, last SWITCH if /^abc/;
    $def = 1, last SWITCH if /^def/;
    $xyz = 1, last SWITCH if /^xyz/;
    $nothng = 1;
}

print "ABC: $abc \n DEF: $def \n XYZ: $xyz \n";


I expected all the assingments in the second block to print one because
the side effect of the assignment operator is the actual assignment to
the varriable. while only the return value would be tossed out.  But in
this case, it's like the assignment never even took place?

Why?


Ruben




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

Date: 19 Jun 1998 17:18:17 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Comma Operater in a Block
Message-Id: <6me6gp$gsd@mozo.cc.purdue.edu>

Ruben I Safir <rs83@is7.nyu.edu> writes:

}Going over the Camel Book I see some algorithms for case/esac or switch
}using blocks.

}I ran the following code:
}__________________________________________________________________
}#! /usr/bin/perl

}$_ = "def";
}SWITCH:  {
}    $abc = 1, last SWITCH if /^abc/;
}    $def = 1, last SWITCH if /^def/;
}    $xyz = 1, last SWITCH if /^xyz/;
}    $nothng = 1;
}}

Read this as:
SWITCH:  {
        ($abc=1,last SWITCH) if /^abc/;
        ($def=1,last SWITCH) if /^def/;
        ($xyz=1,last SWITCH) if /^xyz/;
        $nothing = 1; 
}

 ...and all will be good again.


-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Fri, 19 Jun 1998 17:06:02 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Creating the Cartesian product of a set of sets -- LONG
Message-Id: <358A9C30.365D@min.net>

Steven Tolkin wrote:
> 
>...

See my answer to another similar post
in article <3587EAF8.1AE8@min.net>.
This is essentially the same solution. 
One line (marked ###) is changed.


for ( rec( \@chars ) ) {
  print "$_\n";
}

sub rec {
  my( $ar, @stack ) = @_;
  return join ' -- ', map { "@$_" } @stack unless @$ar; ###
  my( $head, @a ) = @$ar;
  map { rec( \@a, @stack, $_ ) } @$head;
}


-- 
John Porter


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

Date: 19 Jun 1998 16:52:15 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Efficiency: required reading
Message-Id: <6me4vv$14o$1@supernews.com>

I see so many questions out in clpm asking about how to make code faster,
I think it's worthwhile mentioning two key texts:

"Code Complete" by Steve McConnell, which devotes chapters 28 and 29 to
the issue of code tuning.  It makes reference to... 

"Writing Efficient Programs" by Jon Bentley.  Don't be scared that it's 16
years old.  It's a programming book for the ages.

I would suggest that anyone who asks the question "How efficient is
[whatever]?" should immediately pick up either/both of these books before
they proceed any further.

xoxo,
Andy


--
-- 
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: 19 Jun 1998 15:56:20 GMT
From: Dan Nguyen <nguyend7@egr.msu.edu>
Subject: Re: first language
Message-Id: <6me1n4$jem$1@msunews.cl.msu.edu>

Larry Rosler <lr@hpl.hp.com> wrote:
: In article <6mbktf$5qp$1@msunews.cl.msu.edu>, nguyend7@egr.msu.edu 
: says...
: ...
: > PASCAL                 C                    Perl
:   Pascal :-)

: As one of the first who tried to teach C many years ago, I can vouch that 
: it is a poor choice for beginners, for one spcific reason that is seldom 
: discussed:  the difficulty of doing simple text input with data 
: conversion.

When I was first learning C I was little amazed that it didn't have
any built in way of reading input, and writing output.  Then I learned
about the library functions that come with standard ANSI C.  Come to
think of it Java has this problem too.  Its hard to get useful
information from the keyboard for an application (no gui) without
figuring out how to parse it yourself.

: Once one gets past single-character input (getchar or getc) or perhaps 
: line-at-a-time-and-parse-it-yourself input (gets or fgets, atoi, atof, 
: ...), one encounters the horrible scanf function, which demands an 
: understanding of pointers and internal representations.  Fuggedaboudit!

: C++ is better on input conversions, and Perl can rely on text isolation 
: via regexes and automatic conversions.  Regexes are hard unless one has 
: been weaned on ed/vi/grep/awk/sed/... but the student must learn them 
: right away to get much useful work done anyway.  But Perl references can 
: wait till much later, while C pointers cannot.

: Don't teach C to beginners!
If you want to learn C.  Try your hand at Pascal first. 

-- 
Dan Nguyen                         |
nguyend7@cps.msu.edu               |   Remember Byron.
http://www.cps.msu.edu/~nguyend7   |   



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

Date: Fri, 19 Jun 1998 10:06:05 -0700
From: rdm@cfcl.com (Rich Morin)
Subject: Re: first language
Message-Id: <rdm-1906981006060001@140.174.42.30>

In article <8c7m2dbgim.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:

>         To master structured programming, learn Pascal *first*.
>         To master object-oriented programing, learn Smalltalk *first*.
> 
> There's no excuse for not knowing Pascal and Smalltalk given the free
> implementations out there.

If this were merely a discussion of languages that can teach nifty ideas,
I would be more than happy to agree with you.  Ada, APL, assembler, Icon,
Lisp, PostScript, and Prolog would be some of my additions.

But, given that we are talking about first languages, and that many users
will have no enthusiasm for learning multiple languages, I cannot agree.

It isn't necessary to use Pascal to learn about structured programming.
I explained it to folks that were using Fortran-63 anbd they got it!  I
would certainly promote Smalltalk as an elegant approach to OO (as C++ is
NOT), but I think the concepts are fairly clear in Perl and Objective-C.


A friend of mine is a very smart engineer/manager.  He uses BASIC for the
occasional programming task he encounters.  I've told him about Perl, but
he says BASIC meets his needs just fine:

  *  It has all the features he needs.
  *  He can use the language from memory.

There are quite a few "casual" or "occasional" programmers out there.  I
don't despise their efforts, any more than I would want a chef to scorn
my technique for making egg sandwiches.  Saying that Perl is "too good
for the likes of them" and such is a bunch of elitist garbage, IMHO.  (I
do not program Perl as well as Larry, and never will, but he doesn't make
fun of me, so I don't make fun of them.)


Still, Perl presents a conundrum.  BASIC (and even awk/sed/sh/tr/...)
doesn't have all the features *I* need, but I'm a bit embarrassed about
the number of books I need to keep next to my desk to get through any
significant Perl programming task.

Nonetheless, I think that a well-chosen subset of Perl can work as well
as BASIC for a beginner, while offering vastly more "growth potential".
Working with Unix over the years has been a tremendous learning exper-
ience for me.  I have been able to use tools crafted by some real pros.
I have much the same feeling about Perl; I think it will take me just
about anywhere I really wish to go...

-r

-- 
Canta Forda Computer Laboratory       | Prime Time Freeware - quality 
UNIX consulting, training, & writing  | freeware at affordable prices
+1 415-873-7841                       | +1 408-433-9662   -0727 (Fax)
Rich Morin, rdm@cfcl.com              | www.ptf.com, info@ptf.com


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

Date: 19 Jun 1998 17:13:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: first language
Message-Id: <6me68f$ijt$1@client3.news.psi.net>

Randal Schwartz (merlyn@stonehenge.com) wrote on MDCCLIII September
MCMXCIII in <URL: news:8cbtrpbgn2.fsf@gadget.cscaper.com>:
++ >>>>> "Dan" == Dan Nguyen <nguyend7@egr.msu.edu> writes:
++ 
++ Dan> The person needs to be a "natural" programmer.  Generally I feel that
++ Dan> most people have hard time not with the language but with the process
++ Dan> of programming.  A person could learn Perl as a first language very
++ Dan> easily and have no problems, while others could become stuck on the
++ Dan> syntax of the language.
++ 
++ I'll second this.  I see far too many people *attempting* programming
++ that would probably have a better time being firefighters or line
++ chefs or congressmen or something.  Sure, maybe nearly anyone with
++ enough effort can hack out a VB script to automate a repeated task,
++ but programming *well* seems to require a twisted aptitude only some
++ small percentage of the population seems to have.  I think I was lucky
++ to be born with it, given the time at which I was born. :-) No
++ ordinary amount of education can seem to teach people how to "think"
++ like a progammer.  ("You have these seven transformations possible and
++ this problem requires converting Q to W... go!")
++ 
++ I suppose it would be too much to ask that if you're not a natural
++ programmer, either stay out of the business, or flag your work
++ properly so that we cleanup people know what to throw out first. :-)


That sounds as if programming would be an art. I disagree with that.
I believe that most people can be able to learn how to program. Just
like most people could learn how to become a car mechanic.

Whether everyone has the motivation to learn is a different issue.




Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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

Date: Fri, 19 Jun 1998 17:17:30 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: first language
Message-Id: <pudge-1906981314440001@dynamic162.ply.adelphia.net>

In article <8c7m2dbgim.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:

# I tell people frequently:
# 
#         To master structured programming, learn Pascal *first*.
#         To master object-oriented programing, learn Smalltalk *first*.
# 
# There's no excuse for not knowing Pascal and Smalltalk given the free
# implementations out there.

I dunno, the only real language I know is Perl, and I am happy.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 19 Jun 1998 16:05:11 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Flames....
Message-Id: <6me27n$oe7$1@ns1.arlut.utexas.edu>

Deva Seetharam <psdspss@execpc.com> writes:
>
> Why do people get mad, when anybody posts a basic/repeat question ?

It breaks up the monotony of the endless litany of FAQs.

1/2 :-)

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: 19 Jun 1998 16:34:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6me3va$11e$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Deva Seetharam <psdspss@execpc.com> writes:
:If somebody thinks the question is stupid/irrelevant/repeated, why
:can't he/she disregard the question ?

Because quite simply, when 95% of the group is buried under the same
stupid question with repeated duplicate answers that are already in the
docs, it dies the signal-to-noise death.  And ignoring them does nothing
to educate them about the fact that they could have and should have helped
themselves to the answer which we have all worked so hard to provide.
Ignoring them is bad, but answering with simple solutions as you
seem to advocate is even worse, because it creates a pattern of addiction.
If we keep giving them hand-outs of free fish, they'll keep coming back
for more instead of learning to fish on their own.  We shouldn't ignore
them and leave them helpless, and we shouldn't give quick fixes that leave
them dependent upon our continued care and feeding.  They should RTFM, or 
else they're just crack addicts.

--tom
-- 
    "It is easier to port a shell than a shell script."
		--Larry Wall


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

Date: Fri, 19 Jun 1998 13:03:04 +0000
From: John Call <johnc@interactive.ibm.com>
Subject: Re: Flames....
Message-Id: <358A616E.4DBABFC0@interactive.ibm.com>

> should have helped themselves to the answer which we have all worked so
> hard to provide.

I used to think that a lot of people on this group were exceptionally hard on
people who asked faqs. Some people still are too hard on them but for the
most part I have been converted and think that the simple questions should
not be answered UNTIL the person goes to the faq, writes their code, it
breaks, attempts to debug it, and can't. Then they should post the proper
snippet here and let someone point our their error. That would seem much more
acceptable.

There are many reasons for looking in the faqs. First you will find your
answer. Second, you will find out things you didn't know that don't apply
directly right now but will in the future. Third, it makes you more
independent.

Before anybody gets the idea that I am some stud programmer, I am not. I am
probably intermediatte at Perl at best (especially when compared to some of
the folks in here). The point is that I will never get any better if I can't
become more self sufficient.

I agree that many newbies don't know about faqs. They know about newsgroups.
They search. Find perl.misc. They submit. They get barked at but hopefully
the bark contains a pointing to the faq. Hopefully they learn and next time
they go to the faq to begin with. The real solution is pointing them to the
faq to begin with if possible. I just don't know how that could be
done.......

my $.02 <- no pun intended

--

John Call




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

Date: Fri, 19 Jun 1998 11:05:37 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: help comparing strings
Message-Id: <358A8C51.C59B5068@execpc.com>



jay_st_louis@my-dejanews.com wrote:

> I was wondering if it was possible to compare a specific length of a string
> using Perl, like strncmp in C.  What I mean is that I only want to compare
> the first 5 characters of a string to the first 5 characters of another
> string. Can it be done?
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading

  what about
substr($str1, 0, 5) cmp substr($str2, 0,5);

Assuming you have not changed $[.

Hope this helps.
Deva




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

Date: Fri, 19 Jun 1998 17:03:42 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: help comparing strings
Message-Id: <358A8BDE.4ED55D6F@nortel.co.uk>

jay_st_louis@my-dejanews.com wrote:
> 
> I was wondering if it was possible to compare a specific length of a string
> using Perl, like strncmp in C.  What I mean is that I only want to compare
> the first 5 characters of a string to the first 5 characters of another
> string. Can it be done?
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading

See the thread: if (something eq "somethingfgjhf")



-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Fri, 19 Jun 1998 10:48:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help with string comparisons
Message-Id: <MPG.ff44450dc4f46b89896a6@nntp.hpl.hp.com>

In article <6me16o$dgr$1@nnrp1.dejanews.com>, jay_st_louis@my-
dejanews.com <jay_st_louis@my-dejanews.com> says...
> I was wondering if there is a way to compare a specific number of characters
> in a string in Perl, like using strncmp in C. for example, if I wanted to
> compare just the first five characters of 2 strings that were 20 characters
> long. can this be done?
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading
> 

This is the THIRD time this question has been asked in the past day or 
so.  Maybe it should become a FAQ.  And maybe before posting, people 
should take the trouble to look at even one day's worth of posts.

Look back for the answer.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 19 Jun 1998 08:53:32 -0700
From: Bob Hewitt <bhewitt@orca.akctr.noaa.gov>
Subject: IRIX upgrade 5.3 -> 6.2  "Illegal expression as lvalue in file..."
Message-Id: <Pine.SGI.3.95.980619073756.6782A-100000@orca.akctr.noaa.gov>

  We just upgraded from IRIX 5.3 to IRIX 6.2. A perl script (running under
perl 4.036) which previously worked has stopped working.  When I start the
perl script, I see: 

  .  Illegal expression (COND_EXPR) as lvalue in file
/usr/lib/perl/sys/socket.ph at line 98, next 2 tokens ") )" 

Has anybody else experienced this?

-----------------------------------------------------------------------------
line 98:

	if (defined ((defined(&_KERNEL) ? &_KERNEL : 0)) ) {
	}

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

       [ Bob Hewitt - bhewitt@orca.akctr.noaa.gov, (206)526-4208 ]







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

Date: Fri, 19 Jun 1998 17:07:34 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Multi-D Array Sorting
Message-Id: <358A9C88.4501@min.net>

root wrote:
> 
> @y = sort {
>         if( $a->[0] == $b->[0]) {
>                  $a->[1] <=> $b->[1];
>         }
>         else {
>                  $a->[0] <=> $b->[0];
>         }
> } @x;

That is written more idiomatically as:

	sort {
		$a->[0] <=> $b->[0]
	||
		$a->[1] <=> $b->[1]
	}

-- 
John Porter


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

Date: Fri, 19 Jun 1998 13:02:07 -0400
From: "John Madden" <john.madden@ssa.gov>
Subject: Need to split a line with spaces
Message-Id: <6me5fs$6fm$1@s00dacf.ssa.gov>

I have a directory listing which looks like this:

6/17/98    09:04p        9,324    file1
6/17/98    09:02           5,342    file2


and so on. I want to get the filename(i.e. file1 or file2) out of this
directory list.

I have tried

foreach $entry(@entries)
{
$f1=(split/s*/)[4];
print ($f1 . "\n");
}

With no luck..any help would be appreciated...







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

Date: Fri, 19 Jun 1998 00:45:22 -0500
From: "Chris" <chris@nemonet.com>
Subject: Re: Need to split a line with spaces
Message-Id: <6me84v$gnu$1@news4.ispnews.com>


John Madden wrote in message <6me5fs$6fm$1@s00dacf.ssa.gov>...
>I have a directory listing which looks like this:
>
>6/17/98    09:04p        9,324    file1
>6/17/98    09:02           5,342    file2
>
>
>and so on. I want to get the filename(i.e. file1 or file2) out of this
>directory list.
>
>I have tried
>
>foreach $entry(@entries)
>{
>$f1=(split/s*/)[4];  # here is a possible problem. you forgot to backslash
the 's'
>print ($f1 . "\n");
>}


Try backslashing that 's'.




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

Date: Fri, 19 Jun 1998 17:46:05 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Need to split a line with spaces
Message-Id: <6me843$93v@netaxs.com>

In article <6me5fs$6fm$1@s00dacf.ssa.gov>,
John Madden <john.madden@ssa.gov> wrote:
>
>6/17/98    09:04p        9,324    file1
>6/17/98    09:02           5,342    file2
>
>foreach $entry(@entries)
>{
>$f1=(split/s*/)[4];
>print ($f1 . "\n");
>}
>
>With no luck..any help would be appreciated...

Lots of problems.

Try \s which should work much better for a space. Try '+' instead
of '*' so you get some spaces. * means 0 or more so if you use that
you split up the date string. This is because the date has no spaces
and you've said split where there aren't any. Your index is wrong unless
of course you've changed the starting index to 1. You are splitting on
the wrong pattern. split defaults to $_;

    $f1 = (split(/\s+/, $entry))[3];

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: Fri, 19 Jun 1998 16:19:56 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Novell Perl
Message-Id: <358A8FAC.6076C776@inlink.com>

I have heard that the Novell flavor is only Perl 4.x compatible.  I have
also heard that they are working on a 5.x version but it is not ready
yet.

HTH,

Brent


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

Date: Fri, 19 Jun 1998 12:09:47 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl CGI problem with Netscape Fasttrack
Message-Id: <linberg-1906981209470001@projdirc.literacy.upenn.edu>

In article <6mc265$5mc@fox.almaden.ibm.com>, huliang@almaden.ibm.com (Hu
Liang) wrote:

> I really need help!!
> 
> My CGI-PERL programs work fine under Lotus GO server, but won't under
Netscape 
> Fasttrack.  I get a "cgi-parse-output reports: the CGI program /bal/bla
did not 
> produce a valid header (name without value: got line "     lc_all =
(unset),")"
> 
> It's fine under GO!  I check the output from command line, fed it through od 
> and no weird chars are printing out.  Made sure the Header had 2
newlines after 
> it, GO didn't mind how many newlines...what's with Fasttrack!?

No idea.  Why are you asking here?  And by the way, any idea what's wrong
with my Toyota?
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Fri, 19 Jun 1998 17:23:46 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Perl debugger with GUI  ptkdb Vers 1.0121
Message-Id: <Eut6zM.BoJ@world.std.com>


ptkdb  A  Perl debugger with Graphical User Interface

You can find this untility with at:

<a href="http://world.std.com/~aep/ptkdb">http://world.std.com/~aep/ptkdb</a>

http://world.std.com/~aep/ptkdb

New Version 1.0121

Three new features, a bug fix and a configuration modification.

New Features

"Goto line", "Find Text", and "Run To Here" have been added

Bug Fix

    I found a bug where you would lose your breakpoints switching
between files manually.  Open a file, set a breakpoint, open
another files, reopen the first file, and the breakpoint isn't
there anymore.  

Configuration Change

   Someone commented that they couldn't see where the program was
stopped.  The line at where the debugger stops the executing program
is done in a bold font.  On some systems this may not be enough to
visually separate it from the surrounding lines.  A blue background
has been added to the configuration of the format of the stopped line.
The package variable that carries the configuration parameters
(@dbgWindow::stop_tag_cfg) has been moved closer to the beginning
of the file.  Season to taste.  


-- 
Andrew E. Page   (Warrior Poet) |   Decision and Effort The Archer and Arrow
Software Engineering Consultant |     The difference between what we are
Unix, Mac, C/C++/Java, Perl, NT |           and what we want to be.


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

Date: 19 Jun 1998 17:18:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Problem with references
Message-Id: <6me6i3$ijt$2@client3.news.psi.net>

Mark-Jason Dominus (mjd@op.net) wrote on MDCCLIII September MCMXCIII in
<URL: news:6mdu0u$iin$1@monet.op.net>:
++ In article <vhpx5s93.fsf@mailhost.panix.com>,
++ Jonathan Feinberg  <jdf@pobox.com> wrote:
++ >This got me thinking, and I decided to do a back-of-the-envelop check,
++ >at least to see if your order of magnitude was correct.
++ 
++ I imagined a thousand people each saying `hash' five or ten times a
++ day.
++ 
++ I also thought it was an undercount. 
++ 
++ >By my thoroughly unscientific survey of DejaNews, 
++ 
++ I think that's the wrong way to look for it, because (a) the big
++ savings is in speech, not in writing, and (b) you speak a lot more
++ than you write.


True, but I seldom speak about Perl. 



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Fri, 19 Jun 1998 10:09:01 -0700
From: Laura Morgan <laura.morgan@itron.com>
Subject: Regular Expression Question
Message-Id: <358A9B2D.7B5B@itron.com>

I have input parameters that can be file.name, *.ext, file.* or *.*
I'm parsing through a file trying to match on this input and perform a
function (i.e. if the user types in *.c, I want to match all files with
a .c extension, etc).

With the input variable name being $file, and the match against variable
named $matchfile, is there a way I can make a comparison that will match
$file with $matchfile, using the wildcard scenerio mentioned above?

Still learning how regular expressions work...
Thanks in advance


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

Date: Thu, 18 Jun 1998 14:19:11 -0400
From: Zach Malchano <zjm@fast-inc.com>
Subject: setuid problem
Message-Id: <35895A1F.5093FABD@fast-inc.com>

I'm in the process of writing a setuid/setgid program, but I'm having a
large problem w/ taint checking. The program gets a username and
password via CGI (html form), but will not allow a file handle:

$path = "/home/$username/www/index.html";
$fh = new FileHandle "$path", "w" or die "Can't open $!\n";
if (defined $fh) {
        print $fh "$page\n";
        @key = keys(%data);
        foreach $n (@key) {
          print $fh ("$n=$data{$n}\n");
        }


undef $fh;
}

Any help or suggestions on how to avoid this problem would be helpful.

Thanks,
Zach Malchano



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

Date: Fri, 19 Jun 1998 17:44:01 GMT
From: camposj@ctc.com
Subject: String manipulation question?
Message-Id: <6me811$qpo$1@nnrp1.dejanews.com>

Anyone,

I'm currently revising a perl script that reads an html document into a
variable and then split it up into 31k increments and then records each piece
to my database.

For example if the length of the document is 70k, I would have 3
pieces (1st piece = 31k, 2nd piece = 31k, 3rd piece = 8k).  Making sure that
each piece does not exceed 31k in length.

Problem:  I have to make sure that before I create a piece that I do not split
up a particular tag over two records.  It has to be whole.
The tag is <a .....> .... </a>

I suspect I would create a loop that would append a piece at a time to a
variable until I reach my 31k limit and than save that last piece to the
database.  And then pick up where I left off and continue through the rest of
the document.

So when I find the first "<a" I would immediately look for the "a>" and save
it to a varible. after each append I guess I would check the length and
continue through if < 31k?

I am new to the perl language.	Can anyone help me along with some of the
ways I would do this in perl.

Thank you in advance for you help

Ps. If you need more information, I will gladly provide it.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Fri, 19 Jun 1998 16:27:51 GMT
From: pverdret@sonovision-itep.fr
Subject: Re: the ?PATTERN? match syntax
Message-Id: <6me3i7$i0i$1@nnrp1.dejanews.com>

In article <6mcrp1$g9d$1@monet.op.net>,
  mjd@op.net (Mark-Jason Dominus) wrote:
>
>
> In article <6mce3p$96f$1@nnrp1.dejanews.com>,
>  <topher67@my-dejanews.com> wrote:
> >The match syntax "?PATTERN?" is very useful and should *not* be removed from
> >perl.
>
> OK.  Why?
>
> I'm not trying to start an argument; I'm really curious.  A few months
> ago I tried to make a list of the least-known and littlest-used Perl
> features.  I polled some experienced Perl programmers for advice.
> When I mentioned ?PATTERN? to them, most of them didn't know what I
> was referring to.
>
> When is ?...? useful?  What do you do with it?
>
>
In one of my program I filter RTF documents with this:

 RTFLINE:while(<RTFLINE>) {
   ...
   ?\{\\colortbl? and do {	# suppress the group \colortbl
      do {
	/\}/ and next RFTLINE;
      } while(<RTFLINE>);
      die "unexpected end of file";
    };
   ...
   print;
 }

Philippe


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 19 Jun 1998 17:41:02 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: the ?PATTERN? match syntax
Message-Id: <eli$9806191315@qz.little-neck.ny.us>

(Quoted text rearranged to suit my reply.)

In comp.lang.perl.misc, Mark-Jason Dominus <mjd@op.net> wrote:
>  <topher67@my-dejanews.com> wrote:
> >The match syntax "?PATTERN?" is very useful and should *not* be removed from
> >perl.
> OK.  Why?

I rarely use it, but I like having it there. Similiarly I rarely use
m'' but I like having it there.

> When is ?...? useful?  What do you do with it?

Seperate boolean states in RE parsing, eg:

#!/usr/bin/perl -w
 
&sep_head_body(\@head, \@bod);
 
# Print first of the two possible From headers.
print grep ?From[ :]?, @head;
 
print "\n";
print @bod[0..3];
 
print '... and ',(@bod-4)," more lines.\n";
 
sub sep_head_body {
  my $current = shift;
 
  # I consider the first balnk line of an RFC822 message to be part of
  # the headers, hence the push before the if.
  while (<STDIN>) {
    push(@$current,$_);
    if (?^\n$?) {
      $current = shift;
    }
  }
}
__END__

> I'm not trying to start an argument; I'm really curious.  A few months
> ago I tried to make a list of the least-known and littlest-used Perl
> features.  I polled some experienced Perl programmers for advice.
> When I mentioned ?PATTERN? to them, most of them didn't know what I
> was referring to.

It should be documented in perlre, and not just perlop. Is m''
documented anywhere, or are people just supposed to infer the
behavior from the way single quotes normally work? It prevents
all interpolation:

#!/bin/perl -w

$_ = <<'END';
From: <*@qz.to>
Subject: Re: the ?PATTERN? match syntax
END

# No need to escape @ here
s'<?.@qz.to>?'Eli the Bearded';

print
__END__

:r! perl -wc %
From: Eli the Bearded
Subject: Re: the ?PATTERN? match syntax


Elijah
------
likes REs


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

Date: Fri, 19 Jun 1998 10:53:14 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: Windows NT, how to copy binary files !
Message-Id: <358A896A.EEF72BDE@execpc.com>



Jahan K. Jamshidi wrote:

> I know how to read a ascii file using perl and write it out somewhere else.  I
> have problem reading a binary file and write out to a new location (kind of
> like copying the an executable program to a new locaiton).  Does perl support
> this function?  Any help is greatly appriciated.
>
> Thanks in advance
>
>

What aboutsystem("copy $src $dest");

Hope this helps.

Deva




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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2912
**************************************

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