[12719] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 129 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 13 19:57:34 1999

Date: Tue, 13 Jul 1999 16:52:45 -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           Tue, 13 Jul 1999     Volume: 9 Number: 129

Today's topics:
    Re: newbies and usenet [was: DB tutorials] <Webdesigner@NewWebSite.com>
        nph html tables <mark@appal.com>
    Re: nph html tables <ehpoole@ingress.com>
    Re: nph html tables <cs2400@hotmail.com>
    Re: nph html tables (Abigail)
    Re: nph html tables <mark@injection-moldings.com>
        NT Path Question... <soneill@marsworks.com>
    Re: NTLM Authorization (Abigail)
    Re: NTLM Authorization <matt@sergeant.org>
    Re: Old database is erased when I add new information (Perulinks)
    Re: Old database is erased when I add new information (Abigail)
    Re: Old database is erased when I add new information (Abigail)
        opendir/readdir <pgrech@uoguelph.ca>
    Re: opendir/readdir <sjs@yorku.ca>
    Re: opendir/readdir <bwalton@rochester.rr.com>
        Ora vs Syb, CF vs Pl (my decision) <als48@pantheon.yale.edu>
        Packages <bill@fccj.org>
    Re: Parsing Large Text File (Abigail)
        Password Entry <vipul@healtheon.com>
    Re: Password Entry <prlawrence@lehigh.edu>
    Re: Password Entry (John Borwick)
    Re: Password Entry htsun5@my-deja.com
        PERL & Oracle Question mrgiskard@my-deja.com
        perl -e 'print "${\ord(s)}\n";' <perly@ufl.edu>
    Re: perl -e 'print "${\ord(s)}\n";' <mthomas@ulysses.jprc.com>
    Re: perl -e 'print "${\ord(s)}\n";' (Larry Rosler)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Jul 1999 19:27:54 GMT
From: Floyd Morrissette <Webdesigner@NewWebSite.com>
Subject: Re: newbies and usenet [was: DB tutorials]
Message-Id: <7mdfj7$set$1@nnrp1.deja.com>

In article <1dust1s.rd3ku2rvxq8wN@p53.block1.tc4.state.ma.tiac.com>,
  rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:

>
> Obviously none of those books are Programming Perl, which discusses
> crypt() on page 153.  Nor the standard documentation, which discusses
> crypt in perlfunc.  I would say that these four books are not
> comprehensive enough to be your sole resource on Perl.

Now see that was a decent answer. You told me exactly where to find it.
The book and the page number instead of just sending me to the sea of
information. I knew it could be done. That is all I ask. I know I can
find it somewhere in the vast amount of books and documentation out
there. But sometimes its like find a needle in a haystack. Its a lot
easier to ask somebody.

It like if you are lost on the road and you have a map. You know you can
find your out if you study the map long enough. But isn't it a lot
easier to ask a friendly soul to tell you the way, even show you on your
own map. They could just point on the map "Here you are." Sometimes that
is all people are asking for here. Just point me in the right direction.
Pointing somebody in the right direction is not just throwing a map at
them and saying figure it out yourself. I feel like that if somebody
doesn't want to help then they shouldn't answer it at all. Talk about
wasting bandwidth.

I know I am not going to be able to change attitudes to be more friendly
and helpful so I guess if anyone wants to reply then you have the last
word. I quit. I will continue to answer questions the best I can and I
might even have a question or two myself.

Just a side note. Not everyone has the documentation for perl because
not everyone is running perl on their own system and have not needed to
download it. I have a simple dos version of perl I use for checking
systax but it has not documentation. I know its freely available on the
web. I would suggest you point people to the web version.

I don't have Programming Perl but I do have Learning Perl and I could
not find crypt in there.




>
> --
>  _ / '  _      /       - aka -
> ( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
>     /
http://www.tiac.net/users/chipmunk/
>         "It's funny 'cause it's true ... and vice versa."
>

--
Get your web site from http://www.NewWebSite.com
Consultation is always free.
Help with cgi scripts.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 12 Jul 1999 18:07:59 -0500
From: Mark Bannister <mark@appal.com>
Subject: nph html tables
Message-Id: <378A754E.7DF73ADB@appal.com>

Sorry, I know this is most likely the wrong forum, but I can't post to
moderated forums (somehow not even through deja).
I just need a quick answer to this question so if I know it is worth
tracking down the answer.
I have an nph script that does file upload.  The returned page tells the
user the ongoing status.
It all worked fine until I decided to format the page with a html table.

After the table displays either before the upload begins or after,
everything hangs up.  Or rather the browser starts waiting and seems to
not get what it is waiting for.  Eventually I get a time out message or
document contains no data depending on when I output the table.  Added
info -- the table is enclosed in form tags and contains fields.
Am I violating the idea of non-parsed headers?  Do html tables mean it
has to be parsed or something of that nature?
Brass tacks question:  Can I use html tables in the midst of a nph
returned page?
Thanks,
Mark
PS:  sorry if wrong forum.



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

Date: Mon, 12 Jul 1999 20:06:28 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: nph html tables
Message-Id: <378A8304.A56339E4@ingress.com>

Mark Bannister wrote:
> 
> Sorry, I know this is most likely the wrong forum, but I can't post to
> moderated forums (somehow not even through deja).
> I just need a quick answer to this question so if I know it is worth
> tracking down the answer.
> I have an nph script that does file upload.  The returned page tells the
> user the ongoing status.
> It all worked fine until I decided to format the page with a html table.
> 
> After the table displays either before the upload begins or after,
> everything hangs up.  Or rather the browser starts waiting and seems to
> not get what it is waiting for.  Eventually I get a time out message or
> document contains no data depending on when I output the table.  Added
> info -- the table is enclosed in form tags and contains fields.
> Am I violating the idea of non-parsed headers?  Do html tables mean it
> has to be parsed or something of that nature?
> Brass tacks question:  Can I use html tables in the midst of a nph
> returned page?

Seems to me you have already answered your own question: YOU ADDED TABLES.

Most browsers do not attempt to render a table until *all* the data within
the table is received and the final </table> tag is processed.  So, by
including your text in a table you have forced the browser to wait ....
and wait ... and wait... and, well, I'm sure you get the picture. 
Additionally, many browsers buffer input data in small blocks and, so,
will not process the final </table> until a full block of data or an EOF
is received.  Hence the delay you are observing. 

If you think about it, it is difficult for the browser to 'know' how to
display the table until it knows the complete contents of the table --
text and images alike.  If the browser does render a table in real time
the result will often be a screen and table that keep jumping and
refreshing as new data forces it to expand some cells while compressing
others, etc.

"nph" has nothing to do with this problem, all "nph" means is that the
*server* will not parse the headers and should not buffer the
application's data stream.  It generally doesn't mean anything different
to the browser, the browser should display the data it receives as usual
(note that many browsers do buffer input data in small blocks and may not
display the block until a full block or an EOF is received).

"Can I use html tables in the midst of an nph returned page?" ... You've
already answered this one as well -- sure you can so long as you accept
the consequence that a lengthy pause may result in a timeout with no data
or only partial data displayed.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Mon, 12 Jul 1999 21:12:35 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: nph html tables
Message-Id: <931828412.930.47@news.remarQ.com>

Howdy there,

Bottom line:

Any problems you are having with your nph script have nothing to do
with the HTML you are returning.  As far as your Perl/webserver know
(or care), the output is just a stream of data. Plain and simple.

But realize, your browser will not render a table untill everything
inside of it has loaded. (with IE, this is not always true...)

Make sure you are returning *all* the needed headers for the nph
script.... You need more then just "content-type:".

For trouble shooting, try using CGI.pm to generate you headers.

Good luck !




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

Date: 12 Jul 1999 23:34:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: nph html tables
Message-Id: <slrn7olger.h7.abigail@alexandra.delanet.com>

Mark Bannister (mark@appal.com) wrote on MMCXLI September MCMXCIII in
<URL:news:378A754E.7DF73ADB@appal.com>:
:: Sorry, I know this is most likely the wrong forum, but I can't post to
:: moderated forums (somehow not even through deja).

So, your inability to post in moderated groups is out burden, because of...?

    o  You are a lamer.
    o  You just don't care.
    o  You are clueless.
    o  Your mamma told you do so.
    o  You lack braincells.

Please circle all options that apply.



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 13 Jul 1999 06:48:42 -0700
From: Mark Bannister <mark@injection-moldings.com>
Subject: Re: nph html tables
Message-Id: <378B43BA.3ECF8CC9@injection-moldings.com>

<gritting teeth so as not to say something untoward>Hardly a burden. 
Thus the invitation for persons like yourself to ignore and not waste
more bandwidth with vaguely clever retorts.</gritting teeth so as not to
write something untoward>

Abigail wrote:
> 
> Mark Bannister (mark@appal.com) wrote on MMCXLI September MCMXCIII in
> <URL:news:378A754E.7DF73ADB@appal.com>:
> :: Sorry, I know this is most likely the wrong forum, but I can't post to
> :: moderated forums (somehow not even through deja).
> 
> So, your inability to post in moderated groups is out burden, because of...?
> 
>     o  You are a lamer.
>     o  You just don't care.
>     o  You are clueless.
>     o  Your mamma told you do so.
>     o  You lack braincells.
> 
> Please circle all options that apply.
> 
> Abigail
> --
> tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
> sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
> sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
> 
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 13 Jul 1999 13:57:08 GMT
From: "Sean O'Neill" <soneill@marsworks.com>
Subject: NT Path Question...
Message-Id: <UAHi3.27536$ga.41243@news21.bellglobal.com>

I have a site that is in a subfolder of the root web of IIS and the current
directory always seems to start at the root web...and not in the current
folder.  I can detect it and change it inside scripts, but when I try to do
<!-- exec cgi="someScript.cgi" --> NT always is looking at the root web and
of course doesn't find this file since it is in the current folder and not
the root web.

I can easily change this to <!-- exec cgi="/myfolder/someScript.cgi" --> but
that will cause problem when this site is uploaded to a Unix server that
correctly looks in the current folder.

Any ideas?




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

Date: 12 Jul 1999 20:58:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: NTLM Authorization
Message-Id: <slrn7ol791.h7.abigail@alexandra.delanet.com>

dafah@wmdata.com (dafah@wmdata.com) wrote on MMCXLI September MCMXCIII in
<URL:news:7md9t4$phi$1@nnrp1.deja.com>:


[ None Perl question deleted ]


Your newsreader seems to be severely broken. You posted a question,
without refering to any previous material - essentially starting
a new thread. However, the References: header of your post contained
message-ids of three articles.

Here is the References header from your posting (formated to fit in
80 characters):

    References: <378340C7.E8C8A58A@mediaone.net>
                <slrn7o7s0g.ued.abigail@alexandra.delanet.com>
                <37840474.E1DF7B6B@mediaone.net>


I strongly suggest you contact the vendor of your newssoftware and
log a bug.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 13 Jul 1999 09:09:55 +0100
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: NTLM Authorization
Message-Id: <378AF453.8A0A324F@sergeant.org>

dafah@wmdata.com wrote:
> 
> Are there any documentation about how the NT Challenge Response / NTLM
> Authorization headers interact? It seemes as Microsoft does not publish
> this information. But would need this to build a proxy server. When I
> look at the headers it looks something like this:

[snip]

They don't publish it, but someone else somewhere did. Try a net search.
However the algorithm for generating the hash isn't public (or known),
it's a Win32 API call (I think it's a hidden/undocumented API call, but
it's there all the same, because I know that Web Site Pro used the same
API to implement NTLM).

Hence, you can't (at least no-one has yet) implement NTLM on a non-NT
machine.

Matt.


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

Date: 12 Jul 1999 23:57:46 GMT
From: perulinks@aol.com (Perulinks)
Subject: Re: Old database is erased when I add new information
Message-Id: <19990712195746.06618.00010191@ng-fg1.aol.com>

His name is Greg Hassan from the Independent Solution or something like that. 
The scrips was working Ok, I think, when he installed them.  However, since he
wouldn't answer my emails, I tried to do some needed changes myself.  Most of
them worked, but not the last one.
I really don't have complains about the quality of his software; it is
sophisticated.  But I think that if somebody can't or is unwilling to provide
tech support (even for a  extra fee), he/she shouldn't see anything.

Carlos


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

Date: 12 Jul 1999 23:51:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Old database is erased when I add new information
Message-Id: <slrn7olhdv.h7.abigail@alexandra.delanet.com>

Perulinks (perulinks@aol.com) wrote on MMCXLI September MCMXCIII in
<URL:news:19990712083038.07296.00011669@ng34.aol.com>:
|| Hello there,
|| I REALLY would appreciate if somebody helps me here.  I bought some very nice
|| search scrips for my search engine, and the author is unable/uwilling to help
|| me with an installation problem--it is VERY DIFFICULT to get good tech suppor
|| these days.  I tried to contact him many times, but he won't just answer.

So, get a lawyer.

You buy a commercial script, and now you expect this group to give to tech
support on it? 



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 12 Jul 1999 23:55:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Old database is erased when I add new information
Message-Id: <slrn7olhkc.h7.abigail@alexandra.delanet.com>

Perulinks (perulinks@aol.com) wrote on MMCXLI September MCMXCIII in
<URL:news:19990712195746.06618.00010191@ng-fg1.aol.com>:
`` His name is Greg Hassan from the Independent Solution or something like that.
`` The scrips was working Ok, I think, when he installed them.  However, since h
`` wouldn't answer my emails, I tried to do some needed changes myself.  Most of
`` them worked, but not the last one.


Ah, so you screwed up yourself. It's not fair blaiming the author for not
giving support, and then it turn out that you screwed up yourself.


`` I really don't have complains about the quality of his software; it is
`` sophisticated.  But I think that if somebody can't or is unwilling to provide
`` tech support (even for a  extra fee), he/she shouldn't see anything.


Tech support is something else than helping luser out that screw themselves.
You wanted *changes*. That's not tech support. Those are enhancements. For
commercial software, enhancement usually cost money.

Are you sure you license allowed you to modify the scripts? Perhaps the
author is now preparing a lawsuit...



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=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 12 Jul 1999 21:20:08 -0400
From: Paul <pgrech@uoguelph.ca>
Subject: opendir/readdir
Message-Id: <378A9448.A0801C59@uoguelph.ca>

Hello.  I am having trouble with reading file names in a directory.  I
am thinking that the problem lies in the way that I am changing dir.   I
use chdir($directory), where directory is a string containting a
directory name/path.  However this name/path is not from
the root of the  directory structure.

now when I use opendir(FILEHANDLE, $directory);  and test to see it
returns a true, I get false.
then I want to read to contents of the directory so I use
readdir(FILEHANDLE); and that does not work, cause opendir did not work.

Can any one give me any suggestions.

directory contains a directory name/path

(NOTE)  What I am trying to do with this code is count how may files are
in each directory.
are their maybe any either ways.  I don't want directory names part of
the file count.

thanks


the code.

 $directory = substr($_, 0, $index_num);


 if ( chdir($directory) == 0){
   print "Working";

 }else {
  print "Not true";
 }

if (opendir(Ptr, $directory)){
      print "worked";

  }
else {
     print "did not work";
    }

        $name = readdir(Ptr);

   while ($name != "") {

   if (!(opendir(Ptr, $name))) {
    $counter++;
    print "Test";
       }else {
        print "hi";
    }

        $name = readdir(Ptr);

    }
            print ("$directory  $counter \n");
    }
     closedir(Ptr);
}






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

Date: Mon, 12 Jul 1999 20:21:23 -0400
From: Steven Smolinski <sjs@yorku.ca>
To: Paul <pgrech@uoguelph.ca>
Subject: Re: opendir/readdir
Message-Id: <931826137.377901104@newshub.ccs.yorku.ca>

On Mon, 12 Jul 1999, Paul wrote:

>(NOTE)  What I am trying to do with this code is count how may files are
>in each directory.
>are their maybe any either ways.  I don't want directory names part of
>the file count.

hmm....

Make sure the $directory is a proper path, i.e., no slashes on the end, etc.

Try this code (works on my system):

---8<--------
#!/usr/bin/perl -w
use strict;

print "Directory: ";
chomp ( my $directory = <STDIN> );   # get dir from stdin and chomp newline
my $count = 0;             # count of non-dir files in directory
chdir( $directory ) or die $!;  # should work if dir is full path
foreach (<*>) {                      # glob the files in $directory
	unless ( -d $_ ) { ++$count };
}  # unless the filename is a directory, increment $count
print "Non-directory files in $directory number $count.\n";
---8<--------

Steve


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

Date: Mon, 12 Jul 1999 22:56:12 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: opendir/readdir
Message-Id: <378AAACC.CD0F3587@rochester.rr.com>

Paul, I think you've got lots of problems.  I indicated some interspersed
with your code below:

Paul wrote:

> Hello.  I am having trouble with reading file names in a directory.  I
> am thinking that the problem lies in the way that I am changing dir.   I
> use chdir($directory), where directory is a string containting a
> directory name/path.  However this name/path is not from
> the root of the  directory structure.
>
> now when I use opendir(FILEHANDLE, $directory);  and test to see it
> returns a true, I get false.
> then I want to read to contents of the directory so I use
> readdir(FILEHANDLE); and that does not work, cause opendir did not work.
>
> Can any one give me any suggestions.
> ...

> $directory = substr($_, 0, $index_num);
>
>  if ( chdir($directory) == 0){
>

if chdir is successful, it returns true, which, in Perl, is a 1.  Thus, if
chdir works, you will print "Not true".

>    print "Working";
>
>  }else {
>   print "Not true";
>  }
>
> if (opendir(Ptr, $directory)){

Once you have chdir'ed to the directory, opendir won't find it if it has a
piece of a pathname in front of it, but not all the way to root (as you
indicate above), since opendir does the search starting in the current
directory.  Thus, you would want to stay in the original directory where
$directory can be found (that is, just remove the chdir).

>
>       print "worked";
>
>   }
> else {
>      print "did not work";

Here, you should die if opendir didn't work, since there is no way readdir
will work if opendir failed.

>
>     }
>
>         $name = readdir(Ptr);

>
>    while ($name != "") {

!= is a numeric comparison.  Assuming $name is a character string not
starting with a number, $name will have a numeric value of 0, as will "".
Thus, the expression $name != "" will always be false, and the while body
will never be executed.  Or, if $name does start with a non-zero number, it
will be true.  You want the "ne" operator to do a not equals comparison on
two character strings.  But you could almost as well with just
"while($name){"

>
>
>    if (!(opendir(Ptr, $name))) {

I don't think you want the same filehandle here -- Ptr is still open from
the loop reading your directory.  This will clobber that filehandle, and the
loop won't work as you desire.

>
>     $counter++;
>     print "Test";
>        }else {
>         print "hi";
>     }
>
>         $name = readdir(Ptr);

You could have put this right in your while loop -- it would be much
clearer.

>
>
>     }
>             print ("$directory  $counter \n");
>     }

The above bracket has no matching bracket.

>
>      closedir(Ptr);
> }

The above bracket has no matching bracket.

I suggest you try:

perl -w -d filename.pl

and use the debugger to help you with your code.  That's a lot better than
putting a bunch of extra "print"'s in your program.



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

Date: Tue, 13 Jul 1999 10:52:22 -0400
From: Andrew Singer <als48@pantheon.yale.edu>
Subject: Ora vs Syb, CF vs Pl (my decision)
Message-Id: <Pine.GSO.4.10.9907131045000.19437-100000@minerva.cis.yale.edu>

Hi, this is Andrew again.  Thanks everyone for your assistence in helping
me decide which database to use and which programming language to use.
I've come to a decision about which one I think would be best for my
company.  Many people had asked that I let them know what my final
decision was.  I am not posting it here, because that may be construed as
"advertising," but if you send me an email asking for my decision, I will
gladly forward you the 2-page summary of why I chose what I chose.

Thanks again everybody for your help,

Andrew Singer

Home:  (212) 864-3515
Work:  (212) 594-1018 X153
Fax:   (212) 594-8556




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

Date: Fri, 09 Jul 1999 11:13:26 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Packages
Message-Id: <37861117.0@usenet.fccj.cc.fl.us>

> Abigail
> -- 
> package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
>                                       print } sub __PACKAGE__ { &
>                                       print (     __PACKAGE__)} &
>                                                   __PACKAGE__
>                                             (                )
>

package Just_another_Perl_Hacker;

sub print {
    ( $_ = $_[0]) =~ s/_/ /g;

    print;
}

sub __PACKAGE__ {
    &print ( __PACKAGE__ );
}

&__PACKAGE__();

Hadn't thought about 'packages' this way...

-Sneex-  :]
______________________________________________________
http://jacksonville.pm.org


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

Date: 12 Jul 1999 23:59:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Parsing Large Text File
Message-Id: <slrn7olhtm.h7.abigail@alexandra.delanet.com>

Asad (vc13stu1@americasm01.nt.com) wrote on MMCXLI September MCMXCIII in
<URL:news:378A12B7.F1228B8@americasm01.nt.com>:
// Hi,
// 
// I'm trying to parse a large (approx 32MB) textfile into perl dbm.
// 
// Here is my code:
// 
// #!/usr/bin/perl

Where is the '-w'?
Where is the 'use strict;'?

// $key=0;
// open(maindata, "my_large_textfile"); #main database file.

Where is the 'or die' part?

// dbmopen %PNDB, "my_big_dbm_file", 0666;

Why dbmopen and not tie? Where's the 'or die' part?

// $inline=<maindata>;
// 
// while($inline ne "")

Are you sure about this? Do you expect $inline ever to become ""?

//    {
//    $key++;
//    $PNDB{"$key"} = "$inline";

Why the extra quotes? Why the extra quotes?

//    $inline = <maindata>;

Why isn't this in the while() ?

//    }
// close(maindata);
// dbmclose %PNDB;
// exit 0;
// 
// When I run this script I get the following error:
// 
// ndbm store returned -2, errno 28, key "41515" at map_test.pl line 11,
// <maindata> chunk 41515.

Did you check the man page for ndbm?


Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Jul 1999 12:06:04 -0700
From: "Vipul M. Shah" <vipul@healtheon.com>
To: <comp.lang.perl.USENET>, <comp.lang.perl.misc.USENET>
Subject: Password Entry
Message-Id: <000001becd62$c013ba40$9701040a@healtheon.com>

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01BECD28.13B668E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I suppose this is a FAQ, but how does one prevent the password text from being
echoed on the screen in Perl?

--------------------------------------------------------------------------------
Vipul M. Shah
If a parsley farmer is sued, can they garnish his wages?


------=_NextPart_000_0001_01BECD28.13B668E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D696450419-13071999>I suppose this is a FAQ, but how =
does one=20
prevent the password text from being echoed on the screen in =
Perl?</SPAN></DIV>
<HR>
Vipul M. Shah <BR>If a parsley farmer is sued, can they garnish his =
wages?=20
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0001_01BECD28.13B668E0--



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

Date: Tue, 13 Jul 1999 16:05:14 -0400
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: Re: Password Entry
Message-Id: <7mg661$1t06@fidoii.cc.Lehigh.EDU>


Vipul M. Shah <vipul@healtheon.com> wrote:
> I suppose this is a FAQ, but how does one prevent the password text
> from being echoed on the screen in Perl?

use Term::ReadKey;      # Allows use of ReadMode to hide input

I'd guess TMTOWTDI, however.  BTW, you can find the FAQ at:
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html


--
Phil R Lawrence
Lehigh University
Enterprise Systems Implementation
Programmer / Analyst
prlawrence@lehigh.edu     - work
prlawrence@planetall.com  - personal

--
until (!$self->{'plaid pants'}) { bless $self, $class }





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

Date: Tue, 13 Jul 1999 20:05:37 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: Password Entry
Message-Id: <378d9c01.116190933@newshost.unx.sas.com>

On 13 Jul 1999 12:06:04 -0700, "Vipul M. Shah" <vipul@healtheon.com>
wrote:

>I suppose this is a FAQ, but how does one prevent the password text from being
>echoed on the screen in Perl?

trust your instincts.  perlfaq8.

-- 
John Borwick


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

Date: Tue, 13 Jul 1999 22:19:55 GMT
From: htsun5@my-deja.com
Subject: Re: Password Entry
Message-Id: <7mge1u$e2$1@nnrp1.deja.com>

In article <378d9c01.116190933@newshost.unx.sas.com>,
  jobosw@unx.sas.com wrote:
> On 13 Jul 1999 12:06:04 -0700, "Vipul M. Shah" <vipul@healtheon.com>
> wrote:
>
> >I suppose this is a FAQ, but how does one prevent the password text
from being
> >echoed on the screen in Perl?
>
> trust your instincts.  perlfaq8.
>
> --
> John Borwick
>

system("stty -echo");


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 13 Jul 1999 13:23:00 GMT
From: mrgiskard@my-deja.com
Subject: PERL & Oracle Question
Message-Id: <7mfej8$iek$1@nnrp1.deja.com>

Thanks for reading -- Sorry for the length

I know very little about PERL (I'm an ASP and ColdFusion guy), but have
been given a problem to solve that involves writing binary to ACSII
files to an Oracle 7 database, then back to binary.

Here's the scoop: We use a development and production system for our
web development division -- once the developed item is ready for
production, we use an interface created with HTML & PERL to send the
data through a database (I don't know why) from the development server
to the production server. This works fine.

However, the problem we are running into is with JPG files larger than
30-40K. Small ones will transfer without problems. These larger files
appear in the database, but won't reconvert back to JPG format. They
bottleneck in the field they are stored in temporarily. I can manually
copy the data (ASCII) out of the field, but I'm stuck with raw ASCII,
instead of a binary file.  All other types of files work fine.

Is there some type of special ASCII to Binary routine that I'm missing?
One that is required for larger JPG files? Or, do you think it has to
do with Oracle. If anyone can shed some light on this, it would be
greatly appreciated.

Anderson


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 13 Jul 1999 17:16:53 -0400
From: Jeremy James <perly@ufl.edu>
Subject: perl -e 'print "${\ord(s)}\n";'
Message-Id: <378BACC4.350BB4CC@ufl.edu>

perl -e 'print "${\ord(u)}\n";'
117
perl -e 'print "${\ord(s)}\n";'
Substitution pattern not terminated at -e line 1.

can someone help me understand why the 's' is trying to start a
substitution and how I can stop this from happening?

Thank you

Jeremy James
     "It's an important job, because squirrels don't kill themselves."
                                  -- from a spoof of ESR's OSI
resignation






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

Date: 13 Jul 1999 17:32:59 -0400
From: Mark Thomas <mthomas@ulysses.jprc.com>
Subject: Re: perl -e 'print "${\ord(s)}\n";'
Message-Id: <wf1n1x0teus.fsf@ulysses.jprc.com>


Jeremy James writes:
    > perl -e 'print "${\ord(u)}\n";'
    > 117
    > perl -e 'print "${\ord(s)}\n";'
    > Substitution pattern not terminated at -e line 1.

    > can someone help me understand why the 's' is trying to start a

Always use -w, even on one-liners.

$ perl -we 'print "${\ord(u)}\n";'
Unquoted string "u" may clash with future reserved word at -e line 1.
117

-Mark


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

Date: Tue, 13 Jul 1999 14:48:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl -e 'print "${\ord(s)}\n";'
Message-Id: <MPG.11f553f548b6997f989cc2@nntp.hpl.hp.com>

In article <378BACC4.350BB4CC@ufl.edu> on Tue, 13 Jul 1999 17:16:53 -
0400, Jeremy James <perly@ufl.edu> says...
> perl -e 'print "${\ord(u)}\n";'
> 117
> perl -e 'print "${\ord(s)}\n";'
> Substitution pattern not terminated at -e line 1.
> 
> can someone help me understand why the 's' is trying to start a
> substitution and how I can stop this from happening?

Perl can help you understand, if you use the 'w' flag.  Try it first on 
your first line, fix the problem, and then apply the fix on your second 
line.  Hint:  'm' and'y' would have caused problems similar to 's'.

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


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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 V9 Issue 129
*************************************


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