[9966] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3559 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 27 07:02:54 1998

Date: Thu, 27 Aug 98 04:00:21 -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           Thu, 27 Aug 1998     Volume: 8 Number: 3559

Today's topics:
        (no subject) <Bjoern.Beuter2@pcm.bosch.de>
    Re: _reverse_ lookahead? <dgris@rand.dimensional.com>
    Re: _reverse_ lookahead? huntersean@hotmail.com
        allocate TCP reserved port (512-1024)? (GEMINI)
        ClientSide ImageMaps? <Bjoern.Beuter2@pcm.bosch.de>
    Re: How to convince others using perl instead bourne sc <dgris@rand.dimensional.com>
    Re: MIME Type for files with .PL Extensions? <artm@mail.utexas.edu>
    Re: newbie question huntersean@hotmail.com
    Re: newbie question huntersean@hotmail.com
    Re: numeric operators huntersean@hotmail.com
    Re: pattern matching huntersean@hotmail.com
        Perl <-> Database interface module <dante@ar.com.au>
    Re: Perl documentation <zenin@bawdycaste.org>
    Re: Perl version (David W. Crawford)
        Please help me convert MIME-characters - regex question (Jan Ferri)
    Re: Please help me convert MIME-characters - regex ques <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: RE Losing digits on numbers with magic increment <zenin@bawdycaste.org>
        REGEX for non-printable chars <farber@admin.f-tech.net>
    Re: REGEX for non-printable chars (brian d foy)
        REQ Help. What lang do I need to use? letmepost8053@my-dejanews.com
        TK and HTML (sorry) <Bjoern.Beuter2@pcm.bosch.de>
        using ioctl under WinNT <joerg.weigang@amd.com>
    Re: using ioctl under WinNT <zenin@bawdycaste.org>
    Re: Which DBM do I have here??? <zenin@bawdycaste.org>
    Re: WWW POST via Perl <founder@pege.org>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 27 Aug 1998 11:48:12 +0200
From: "Bjvrn Beuter" <Bjoern.Beuter2@pcm.bosch.de>
Subject: (no subject)
Message-Id: <35E52B5B.5FBE049F@pcm.bosch.de>

Hi there,

I'm searching for a possibility to execute perl scripts from HTML code
and browser.
Does anybody knows something about that?

Thanks and regards,
Bjvrn



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

Date: Thu, 27 Aug 1998 06:51:29 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: _reverse_ lookahead?
Message-Id: <6s2ut2$blr$1@rand.dimensional.com>

In article <6s18l2$11vk$1@ausnews.austin.ibm.com>
thartman@xxxx.xx (Todd 
"Waxahachiefortudinouslyexportitionismistically" Hartman) wrote:

>For example, I want to match a string of digits not preceded by
>the character 'a':

I can't figure out how to do it without explicitly
declaring all of the acceptable first characters.  
This example will match a string of digits that is
immediately preceded by a character matching [b-z].

#!perl
use 5.005;

@a = qw/r34565 a234567 y345645/;

for(@a){
    print "$_\n";
    print "$_\n" if /(?<=[b-z])\d+/;
}

__END__

dgris
- My first sentence sounds wrong.  What I mean is that
I can't figure out how to do this using look-behinds
without expliciting listing all acceptable first
characters.  Doing it without look-behinds is simple.
-- 
Daniel Grisinger           dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
                           Dave Clark


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

Date: Thu, 27 Aug 1998 08:57:50 GMT
From: huntersean@hotmail.com
Subject: Re: _reverse_ lookahead?
Message-Id: <6s372d$n27$1@nnrp1.dejanews.com>

In article <6s18l2$11vk$1@ausnews.austin.ibm.com>,
  thartman@xxxx.xx (Todd "Waxahachiefortudinouslyexportitionismistically"
Hartman) wrote:
> Does Perl have a RE feature that does reverse-lookahead (or look-behind)?
> I didn't see any reference to it in ed. 2 of the Camel in the RE extensions
> section (pp. 58-69).  Is there a way to accomplish this?
>
> For example, I want to match a string of digits not preceded by
> the character 'a':
>
>   12345       -- matches "12345"
>   b12345      -- matches "12345"
>   a12345      -- doesn't match
>   joe123456   -- matches "123456"
>
> Is there some way to massage the current RE extensions to do this?
>
> todd.
>
> --
> Todd Hartman           thartman@austin.ibm.cNOSPAMom      (512)838-8789

You could try reversing your string and then using a lookahead assertion to
match.

Sean H

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 27 Aug 1998 04:55:49 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: allocate TCP reserved port (512-1024)?
Message-Id: <6s2osl$51t$1@netnews.csie.NCTU.edu.tw>

hi all,
  I am writing a rshell function using socket.
according to the protocol, the rshell daemon only
accept the connection of peer port = 512-1024 (by default).
If I execute my script by root privilege,
I can bind the socket to any port, including the 
reserved ports 0-1024, but I'd like to let the system
choose a port from 512 to 1024 for me, not to assign 
a fix port by myself. By specifying the port=0, system will
assign a port > 1024 for me, but that's not what I want.
So is there any way to make it?
thanks.


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

Date: Thu, 27 Aug 1998 12:09:51 +0200
From: "Bjvrn Beuter" <Bjoern.Beuter2@pcm.bosch.de>
Subject: ClientSide ImageMaps?
Message-Id: <35E5306F.DE7D49A3@pcm.bosch.de>

Hi there,

everyone can build a sensitive ImageMaps in a HTML document with the
known syntax "usemap etc."
Now my question, how can I make such a ImageMap in Perl/TK?

Thanks and regards,
Bjvrn



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

Date: Thu, 27 Aug 1998 06:09:13 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: How to convince others using perl instead bourne scripts
Message-Id: <6s2sdf$bgt$1@rand.dimensional.com>

[posted to comp.lang.perl.misc and mailed to the cited author]

In article <6s2jeo$1l1$1@nnrp1.dejanews.com>
dzuy@my-dejanews.com wrote:

>	Challenge him/her to write an sh script or C program that reads in
>	a file, then re-arrange the lines randomly.
 ...
>	                                                     If stumped,
>	email me and I'll send a 20 line Perl script to solve this problem.

Why use 20 lines where one will do?

$ perl -i -al012n077 -F"\n" -e 'print splice(@F,int(rand(@F)),1) while $F[0]' file 

dgris
-- 
Daniel Grisinger           dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
                           Dave Clark


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

Date: Wed, 26 Aug 1998 22:06:07 +0000
From: Art Martinez <artm@mail.utexas.edu>
Subject: Re: MIME Type for files with .PL Extensions?
Message-Id: <35E486CF.14C8@mail.utexas.edu>

Carter Blitch wrote:
> 
> Can somebody tell me the MIME Type associated with files with .pl
> extensions???
> thanks!!!!!!!!!
I'm assuming you are wanting to wnd your perl CGI's with .pl.  You can
name them anything you want .cgi .pl or even .xyz   What is important is
that your web server knows to handle whatever extension you choose as a
CGI.  In Apache you need to add a "ScriptAlias .pl"  to your
httpd.conf.  People correct me if I'm wrong, but the MIME-TYPE
associated with the extension is dependent on what the CGI returns
text/html for plain html text/plain for plain txt etc.  You declare the
content type in the http header.  Read the docs for CGI.pm  (you can
output it directly also, to do this the first print statement of your
CGI should be something like:  print "Content-type: text/html";)

Also get a good Perl reference book.  All the O'Reily Books are great
also the "Perl 5 Howto" is pretty good and great with examples.

Art
artm@DONT_SPAM_ME.mail.utexas.edu


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

Date: Thu, 27 Aug 1998 09:43:36 GMT
From: huntersean@hotmail.com
Subject: Re: newbie question
Message-Id: <6s39o8$prq$1@nnrp1.dejanews.com>

You're trying to run a perl 5 program under perl 4.  You need a newer version
of perl.  A lot of sites may actually run perl 5 in parrallel, so it may be
there already.	Try "which perl5" at the command line and see if you get any
joy.  If you get a path back, change the first line of the script to the new
path.

Good Luck

Sean H

In article <35E4894F.EAEEAD08@pitt.edu>,
  Justin Kidder <jrkst34+@pitt.edu> wrote:
> I'm installing a message board script from off the web, but it didn't
> work.  So I ran it with the command "perl -w" and I got the following
> error:
>
> "my" may clash with future reserved word at multipageboard.cgi line 769.
> Syntax error in file multipageboard.cgi at line 769, next 2 tokens "my
> ("
> Execution of multipageboard.cgi aborted due to compilation errors.
>
> Here is my result of "perl -v":
>
> This is perl, version 4.0
>
> $RCSfile: perl.c,v $$Revision: 1.1 $$Date: 1993/05/14 18:36:10 $
> Patch level: 36
>
> And here is part of the source from my script that includes the error
> (line 3):
>
> sub print_multi_pages
> {
>    my ($countpages, @page_contents) = @_;
>    # Finish by writing the Output to the File
>
>    $pagename = $pageprefix . $countpages . $ext2;
>    open (OUTFILE,">$basedir/$pagename")  || die $!;
>
>    # print header
>    &top_of_form2;
>    &print_page_numbers;
>    print OUTFILE  "<ul>";
>
>    # print body
>    $number_of_lines_body = @page_contents;
>         for ($count4 = 0; $count4 < $number_of_lines_body; $count4++)
>    {
>            print OUTFILE "$page_contents[$count4] \n";
>    }
>
>    #print ending
>    &rest_of_form2;
>
>    close(OUTFILE);
>
> }
>
> Can anyone help me out here and tell me how to fix it?  I've never
> really studied perl before, and I don't want to have to learn the whole
> language to install this one script.  Thanks so much to whoever can help
>
> Justin

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 10:08:16 GMT
From: huntersean@hotmail.com
Subject: Re: newbie question
Message-Id: <6s3b6g$r5e$1@nnrp1.dejanews.com>



In article <6s2hr6$8kr$1@wbnws01.ne.highway1.com>,
  "Todd B" <NOTHANKStbeaulieu@mediaone.net> wrote:
> newbies aren't welcome here - we are considered to be the scum of the earth
> amongst the elitest perl snobs.
>
> we are more than welcome to spend our money on their books, but don't try to
> ask any questions.

Not everyone is a snob.  Sometimes a little self-reliance can be the most
valuable lesson you can learn.	As for Randall S and Tom C, who I presume are
the target of your allegation about books, they _do_ answer a lot of
questions, but they have demands on their time and sometimes a pointer to
specific documentation is more than enough of an answer to a question.	After
all, the whole point of having FAQs etc is so that people won't even have to
waste their time _asking_, let alone answering common questions.

>
> regardless of the question, if there is written doc on it somewhere, in some
> form, we are not allowed to ask it.  for some reason we are expected to know
> what to look up and read every line of doc before attempting to code or to
> ask a single question.

The real problem is exactly the opposite of what you say.  Often people seem
to ask the question before even attempting any code.  The only way to learn
is by attempt and failure.  When I'm not sure about something, I do a "perl
-de 0", and go exploring.  Often people post questions, or sample code which
they've obviously not even tried because it won't even pass the syntax check.

Another problem is the meaningless question.

Q. This doesn't work... "open FOO, '|bar';"

If you just say "this doesn't work", noone knows what you expected it to do,
what it does etc etc.  How do you expect anyone to understand it.  I work as
an IT contractor, and when I receive a bug report from one of my users, it
includes test cases that I can use to reproduce the bug, what actually
happened, what behaviour was expected etc.  Since I am getting paid to do
that, I would expect an even better bug/problem report when someone wanted me
to help them for nothing.

>
> aren't internet newsgroups just wonderful?
>

Yes they are.  You can't just expect people to help you without a modicum of
effort on your own part.  After all, if people just give you potted solutions
to every problem, you will never learn to solve them yourself.	I have found
that well-asked questions tend to be responded to in courteous and helpful
fashion. If someone says to you "read perlfaq 17 'How to use the
mix_mince_shred_and_liquidise operator'"  they are saying: "Some of the best
programmers in the world have had a think about how to best solve problems
just like yours and have provided you with the solution that they came up
with... FOR FREE.  You can find it on the web or your very own hard drive."

Keep on perling!
Sean Hunter

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 10:23:43 GMT
From: huntersean@hotmail.com
Subject: Re: numeric operators
Message-Id: <6s3c3e$s35$1@nnrp1.dejanews.com>

You are doing your "decrement test" wrong in sub "not".
> if ($day_found =~ 0) { &prev_month; }

 ... should surely read ...
if ($day_found == 0) { &prev_month; }

Sean H

In article <904181795.747.0.nnrp-10.c2deb1c5@news.demon.co.uk>,
  "Daniel Adams" <dan@fearsome.net> wrote:
> Hi,
>
> I'm throwing myself to the mercies of the clpm ng, unable to get my head
> around a problem I seem to be having with numeric operators and the like. I
> am trying to be a model Usenet citizen, and I have made every effort in this
> post to improve upon my earlier efforts which provided insufficient
> information. I have included comments in my code, I have said what I
> expected the script to do, what it actually does, and included my code at
> the foot of the message - I hope someone feels inspired to help!
>
> I'll explain what is meant to happen, then explain what actually happens
> (the problem!) , and finally print the code is at the foot of this message
> for reference (please bear in mind its not the whole script, just the
> relevant parts.
>
> What is Meant to Happen: Let me say that the aim of (this part of the)
> script is simply to go to one of two subroutines ("success" or "fail") based
> largely on whether certain files exist. When I feed the script information
> intending to make the script reach subroutine "success" it works as
> expected. (I have tested subroutine "fail" also and, if it works properly,
> _when reached_.)
>
> What Actually Happens:  When I feed the script information (through a form
> on the web) intending to make it reach subroutine "fail" it times out to the
> browser, and it does nothing when executed via telnet - I think there is
> some horendous loop going on somewhere which it is unable to break out of,
> but I can't find it in the code. I know the code is slightly sloppy, but I'm
> very new to Perl, so my apologies. Heartfelt thanks in advance to anybody
> who helps me out with this:
>
> Code:
> ############################
>
> $FORM{$name} = $value;
>
> $year = $FORM{'year'};
> $month = $FORM{'month'};
> $day = $FORM{'day'};
> $path = $FORM{'path'};
>
> # set $day_found to $day
> $day_found = $day;
>
> # set $expire to $day minus seven
> $expire = $day - 7;
>
> # go to subroutine "find_out"
> &find_out;
>
> sub find_out {
> # see if the file exists. If it does, go to subroutine "success" (this works
> fine)
> if (-e "/disk1/usr//public_html/archive/$year/$month/$day_found/index.htm")
> { &success; }
> # if the file doesn't exist, then go to subroutine "not"
> else { &not; }
> exit;
> }
>
> sub not {
> # if $day_found has been decremented to a value of 0, then go to subroutine
> "prev_month"
> if ($day_found =~ 0) { &prev_month; }
> # if $day_found is not 0, but is equal in value to variable $expire, then go
> to subroutine "fail"
> elsif ($day_found == $expire) { &fail; }
> # if none of the above conditions are met, decrement variable $day_found by
> one and then...
> else { $day_found--; }
> # go to subroutine "find_out"
> &find_out;
> exit;
> }
>
> sub prev_month {
> # decrement the numerical value of variable $month by one
> $month--;
> # increment variable $day_found by 31
> $day_found += 31;
> # increment variable $expire by 29
> $expire += 29;
> # Return to subroutine "find_out"
> &find_out;
> exit;
> }
>
> ############################
>
> --
>
> Dan Adams
> dan@fearsome.net
> http://fearsome.net
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 09:29:28 GMT
From: huntersean@hotmail.com
Subject: Re: pattern matching
Message-Id: <6s38tn$orf$1@nnrp1.dejanews.com>

In article <35e43cdd.29585853@news.nottingham.ac.uk>,
  itxjcs@unix.ccc.nottingham.ac.uk (James Stout) wrote:
> Hi
>
> I've chcked the FAQ's, and have an idea what to do, but I'm not
> totally sure. My attempts have failed.
>
> I am reading text from a database into scalar variables. I want to
> check the text for the @ sign (i.e. and email address - so it would be
> better to check for xxxxxxxxxxx@xxxxxxxxxx.xxxxxx.) If the text
> contains the @ sign, I want to put <a href mailto:$variable_name> in
> front of the text and </a> at the end of that text.
>
> Something like:
>
> $variable = "this could be an email address like
> itxjcs@nottingham.ac.uk";
> $variable = ~/@/;
> if($variable)
> {
>
> 	help please!
>
> }
>

To do the test you want

if ($variable =~ /@/) {
 ...

Note that =~ is very different from = ~.  "=~" performs a pattern match
against $variable.  "= ~" will probably perform some bit-flipping (which
would explain your wierd results.

You would probably be better off doing the whole match and substitution in one
go using the s/// operator.

Regards
Sean Hunter

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 17:06:36 +1000
From: Dante <dante@ar.com.au>
Subject: Perl <-> Database interface module
Message-Id: <35E5057C.3B3B8393@ar.com.au>

Howdy... I've tried searching through Dejanews archives and also CPAN
for info about this, but came up very very empty...

I've got this Btrieve database, and I'd like to be able to read from and
hopefully write/update it using Perl. I'd be interested to hear any info
about this. Is there a module around to help with this, like for other
database formats?

So far I've come up with a way of "sort of" reading the database, but
only because I know the field widths, and their relation between each
other, but it would be really good if there was a proper way of doing it
as my method is very slow (but it works for the purpose at the moment,
but I'd like to "expand" the purpose of what I'm using the Btrieve db
for).

If not... from what I gather, and I still don't know too much about
Btrieve yet, but are there other ways to read/update Btrieve databases
from Linux, perhaps using C/C++? Any suggestions, pointers of where to
go would be appreciated.

Regards,
Dante - iN oZ
dante@ar.com.au



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

Date: 27 Aug 1998 06:08:26 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl documentation
Message-Id: <904198040.609194@thrush.omix.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
: Grep.  
: grep grep grep grep grep grep.  grep grep grep grep grep grep.
: Grep.

        Or install Text::English and get the much more friendly "perlindex"
        program, which for perl docs blows grep out of the water if you
        don't need full regular expression support.
-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 27 Aug 1998 05:46:25 -0400
From: dc@panix.com (David W. Crawford)
Subject: Re: Perl version
Message-Id: <xz367febvv2.fsf@panix.com>

cberry@cinenet.net (Craig Berry) writes:

> 
> Ferdi (cogelog@wanadoo.fr) wrote:
> : I don't know exactly my Perl version. Where can I find it?
> 
> From the shell:  perl -v   (see perlrun)
> From a script:   $]        (see perlvar)

and vice versa
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#!/usr/local/bin/perl5
$ver_info = `perl -v`;
print "$ver_info\n";
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

dc:panix:~/perl>./ver.pl 

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36

Copyright (c) 1989, 1990, 1991, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 4.0 source kit.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

dc:panix:~/>perl -e 'print "$]\n" '
$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

David W. Crawford    <dc@panix.com>
Los Gatos, CA




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

Date: 27 Aug 1998 07:45:09 GMT
From: Jan.Ferre@uni-c.dk (Jan Ferri)
Subject: Please help me convert MIME-characters - regex question in fact
Message-Id: <6s32q5$ul0$1@news.net.uni-c.dk>

I try to convert some MIME-characters to something reasonably decent, but 
utterly fails.

   given a line like:
      $line="Ple=61se=20H=65lp=20=4De";   # well constructed example
   I try to
      $line=~s/=([\da-fA-F]{2})/chr("\\x$1")/ge;
   in order to get
      $line eq "Please Help Me"

instead it gives me (\000 written as _):
      $line eq "Ple_se_H_lp__e"

Has anyone got a good idea?

Best regards

Jan Ferre'



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

Date: 27 Aug 1998 09:54:44 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Please help me convert MIME-characters - regex question in fact
Message-Id: <7xiujeeu63.fsf@salome.vcpc.univie.ac.at>

Re: Please help me convert MIME-characters - regex question
in fact, Jan <Jan.Ferre@uni-c.dk> said:

Jan> I try to convert some MIME-characters to something
Jan> reasonably decent, but utterly fails.

Jan>    given a line like: $line="Ple=61se=20H=65lp=20=4De";

Jan> $line=~s/=([\da-fA-F]{2})/chr("\\x$1")/ge;

$line =~ s/=([\dA-Fa-f]{2})/chr(hex $1)/ge;

print "$line\n";

  ==> Please Help Me

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 27 Aug 1998 06:29:49 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: RE Losing digits on numbers with magic increment
Message-Id: <904199322.142403@thrush.omix.com>

Bruce Smith <9401962@ml.petech.ac.za> wrote:
: Should have mentioned it. All the scripts that access the stats files using flock
: to lock the files with LOCK_EX.

        Please show your code.  Flock() and friends are *very* easy things to
        get wrong if you don't understand exactly what the system is doing
        under the hood.

: I have had a suggestion that Perl automatically determines what size of
: underlying variable the number must get stored in

        Perl stores all numbers in the same amount of space.

: and that I am reaching the end of the storage space, eg it allocate 16
: bits and then the increment requires 17.

        Even a hit counter on Yahoo would have a hard time maxing out
        a perl integer value. :-)

        This is not the problem.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 27 Aug 1998 02:09:04 -0400
From: Paul Farber <farber@admin.f-tech.net>
Subject: REGEX for non-printable chars
Message-Id: <Pine.LNX.3.96.980827015456.150A-100000@admin.f-tech.net>

hello all, 

my very limited knowledge of perl regex's is showing (that freaking camel
book is a waste of time.  read it 50 time and still can't make sence of it
 ... try Rule 3 para 1... who writes that stuff???)

Basically, I have the output of a NET::Telnet session in an @array.  But
for some reason there are ^M's in it (control chatacters ???) after the
first --More-- break.   When I cat-ed the file it printed OK, only when I 
used less did it print these ^M's (two of them seperated by about 40
spaces). I need to get rid of them so the split// functions will work. 

I've exhausted my resources and need the line that will cure all my
woe's...

Thanks.

Paul D. Farber II
Farber Technology
717-628-5303
farber@f-tech.net



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

Date: Thu, 27 Aug 1998 02:35:11 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: REGEX for non-printable chars
Message-Id: <comdog-ya02408000R2708980235110001@news.panix.com>
Keywords: from just another new york perl hacker

In article <Pine.LNX.3.96.980827015456.150A-100000@admin.f-tech.net>, Paul Farber <farber@admin.f-tech.net> posted:

>my very limited knowledge of perl regex's is showing (that freaking camel
>book is a waste of time.  read it 50 time and still can't make sence of it
>... try Rule 3 para 1... who writes that stuff???)

those particular pages are for small bites, lots of chewing, and lots
of time for digesting - something suited for a long weekend picnic rather 
than a subway ride.  you haven't read it two hundred times yet, so you have
a long way to go :)

perhaps you want one of

   #by control character
   s/ \cM //gx;

   #by special character
   s/ \r //gx;

   #by octal code
   s/ \015 //gx;

   #by hex code
   s/ \x0D //gx;

-- 
brian d foy                                  <comdog@computerdog.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
or at least that's how a professor described Dirac's Equation to me.


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

Date: Thu, 27 Aug 1998 08:32:15 GMT
From: letmepost8053@my-dejanews.com
Subject: REQ Help. What lang do I need to use?
Message-Id: <6s35ig$lgp$1@nnrp1.dejanews.com>

Hello,

Thank you in advance for any help.

Here's the deal, as webmaster, I've gotten pretty good with HTML.  I even have
some basic java on my sites.

Now I have a need I don't even know which direction to start in to find an
answer. If someone would be so kind as to point me in the right direction, it
would be greatly appreciated.

A web surfer comes to my site with either a pc (win 95/98) or mac. Surfer
wants to add a .jpg/.png/.gif to our site that encourges people to share
their vaction photos.

Here's an example...
http://store.yahoo.com/tesdriv.html
under build a store.

I don't want them to ftp, it has to be idiot proof. I want something along
the lines of a form.  One of the options would be to attach said file for
uploading.

What lang, programs, and/or set of commands should I look to for study to get
this to work?

Feel free to post answer, but I'd really appreciate and email answer too.

Eric
acernote at earthlink dot net

 signacernote

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 11:49:58 +0200
From: "Bjvrn Beuter" <Bjoern.Beuter2@pcm.bosch.de>
Subject: TK and HTML (sorry)
Message-Id: <35E52BC6.A1161261@pcm.bosch.de>

Hi there,

I'm searching for a possibility to execute perl scripts from HTML code
and browser.
Does anybody knows something about that?

Thanks and regards,
Bjvrn



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

Date: Thu, 27 Aug 1998 10:14:10 +0200
From: "Joerg Weigang" <joerg.weigang@amd.com>
Subject: using ioctl under WinNT
Message-Id: <6s34bh$18$1@amdint.amd.com>

What do I have to do to use the ioctl function under WinNT?
I try to read one character from STDIN and I don't want to press "Enter". So
I have to change the input mode to raw with the ioctl function. But it
doesn't work.
Does someone know why?




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

Date: 27 Aug 1998 10:12:20 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: using ioctl under WinNT
Message-Id: <904212671.700656@thrush.omix.com>

Joerg Weigang <joerg.weigang@amd.com> wrote:
: What do I have to do to use the ioctl function under WinNT?
: I try to read one character from STDIN and I don't want to press "Enter". So
: I have to change the input mode to raw with the ioctl function. But it
: doesn't work.
: Does someone know why?

        Have you tried Term::ReadKey?  I don't know if it can do Win32, but
        it's where I'd start.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 27 Aug 1998 06:36:48 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Which DBM do I have here???
Message-Id: <904199741.531699@thrush.omix.com>

Harry Darling <harry.darling@sn.novartis.com> wrote:
: Inherited: large perl program to maintain database
: Interface: Netscape routine named "shuser"
: Database files:
: -rw-r--r--   1 www      daemon   2637824 Aug 27 07:02 Users.db
: -rw-r--r--   1 www      daemon    327680 Aug 26 16:01 Users.id
: I have been told that this is a Berkely DB.  Can anybody identify this
: db type from the file extensions, or give me another hint as to how I
: can identify the db type.

        Try the command "file":

        $ file Users.db Users.id

        I think Netscape uses Berkeley DB v2, however Berkeley DB files
        only use one file, not two.  SDBM and NDBM use two files, as
        I think GNU DBM does as well but I'm not sure.

        Considering the naming convention, could they be two different
        database files? -I don't know of a DBM library that uses .db/.id
        as its extension pair.  Normally it's .pag/.dir for NDBM and
        friends.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 27 Aug 1998 00:26:46 +0200
From: "Mosl Roland" <founder@pege.org>
Subject: Re: WWW POST via Perl
Message-Id: <6s2sji$h0n$1@orudios.magnet.at>

Wim Lambrechts <Wim.Lambrechts@village.uunet.nospam.be> wrote in message
6s1urq$2hu$1@xenon.inbe.net...
>If possible, also send an answer to wim.lambrechts.sms@no-spam.usa.net (and
>remove no-spam)

my $email = scan_message();

$email =~ s/no-spam//g;

It's very simple to remove no-spam ;-)

Mosl Roland
http://pege.org/ clear targets for a confused civilization
http://salzburgs.com/ (did not find a slogan :-)




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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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