[12597] in Perl-Users-Digest

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

No subject found in mail header

daemon@ATHENA.MIT.EDU (John Stanley)
Fri Jul 2 01:17:31 1999

Date: Thu, 1 Jul 1999 22:05:31 -0700 (PDT)
From: John Stanley <stanley@ruby.OCE.ORST.EDU>
To: perlusers-hutyt@ruby.OCE.ORST.EDU

Return-Path: <Perl-Users-Request@ruby.oce.orst.edu>
Precedence: bulk
From: Perl-Users Digest <Perl-Users-Request@ruby.oce.orst.edu>
To: Perl-Users@ruby.oce.orst.edu (Perl-Users Digest)
Subject: Perl-Users Digest, Issue: 2 Volume: 9
Message-Id: <930891930-v9-i2@ruby.oce.orst.edu>

Perl-Users Digest           Thu, 1 Jul 1999     Volume: 9 Number: 2

Today's topics:
    Re: hiring perl programmers (Laar)
    Re: hiring perl programmers <uri@sysarch.com>
    Re: hiring perl programmers (Iain Chalmers)
    Re: hiring perl programmers <uri@sysarch.com>
    Re: hiring perl programmers (Iain Chalmers)
        How do I do an FTP PUT with LWP? <leonandrews@my-deja.com>
    Re: how to trap errors in open ( | <process_name> ) ?? (Alastair)
    Re: In Mountain View did Larry Wall <keithmur@mindspring.com>
    Re: INC not working properly <pkg@studbox.uni-stuttgart.de>
        linking directories? <chris@mobiles.co.uk>
    Re: linking directories? (Martien Verbruggen)
    Re: Looking for old version of Perl (Alastair)
        Looking for real-time chat <dennis.voss@joice.net>
    Re: Looking for real-time chat <jdsv@hotmailSpAmSuX.com>
        magical string increment subtlety <chogan@cs.cmu.edu>
    Re: magical string increment subtlety <sugalskd@netserve.ous.edu>
    Re: make my day fix an array :-) (Abigail)
    Re: make my day fix an array :-) (Abigail)
    Re: make my day fix an array :-) <uri@sysarch.com>
    Re: Making things go "BEEP!" (Abigail)
        MLDBM on WIN32 <not@gonna.tell>
    Re: Modules on Win32 <hiller@email.com>
    Re: newbie in PERL: Can you please suggest a solution? (Abigail)
    Re: Newbie is back!! This time knows his stuff (he thin <palincss@his=
.com>
    Re: Newbie questions (Abigail)
        oh oh!  Try this <cabney@cyberpass.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest=
 Admin)

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

Date: Fri, 02 Jul 1999 01:52:58 GMT
From: laar@ix.netcom.com (Laar)
Subject: Re: hiring perl programmers
Message-Id: <377c1b5c.2122919@nntp.ix.netcom.com>

On 1 Jul 1999 00:34:30 -0500, abigail@delanet.com (Abigail) wrote:

>Nowadays, programmers that understand the words "space and time
>complexity" seem to be rare. And most of them that don't have a lot
>bigger paycheck than I have.

Do they have as nasty a disposition?

--
Laar
www.netcom.com/~laar/index.html


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

Date: 01 Jul 1999 22:38:03 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: hiring perl programmers
Message-Id: <x7u2rn3hf8.fsf@home.sysarch.com>

>>>>> "N" =3D=3D Neko  <tgy@chocobo.org> writes:

  N> On 30 Jun 1999 11:31:14 -0700, Tom Christiansen <tchrist@mox.perl.co=
m> wrote:
  >> Rather tangential to your point, but not to the grandparent
  >> article, standard programming problems we made the interviewee write
  >> extemporanously, although in any programming language they cared to =
use,
  >> often included these:
  >>=20
  >> 1) You have an array of non-negative integers.  Move all the
  >> zero-valued elements to the front of that array.

  N> My first thought was a simple sort:

  N>     @array =3D sort @array;  # One round of Perl golf :)

but that is O(NlogN) and i bet there are faster algorithms that tom was
looking for.

  N> Then I finished reading the instructions:

  N>     my $size =3D @array;
  N>     @array =3D grep $_, @array;
  N>     unshift @array, (0) x ($size - @array);

this is worse as it is O(N**2).

  >> 2) You have the head node of a doubly linked list and a target value.
  >> Delete the first node in the list whose value matches your target.

  N> Is this cheating?

  N>     my $node =3D $head_node;
  N>     while (1) {
  N>         $node->delete, last if $node->value eq $target_value;
  N>         $node =3D $node->next;
  N>     }

no but it illegal perl code and it doesn't solve the problem. where is
delete or next defined? they do the work so their code should be part
of the solution.

  N> Or maybe:

  N>     my $found;
  N>     my $i =3D 0;
  N>     for (@array) {
  N>         $found++, last if $_ eq $target_value;
  N>         $i++;
  N>     }
  N>     splice @array, $i, 1 if $found;

but that is a perl array, not a doubly linked list so it doesn't solve
the problem.

  N> These are actually kind of fun.  Hopefully, I wasn't too sub-optimal=
. :)

optimize only after you get it working.

NOTE: another reply without snide comments. i must be on a roll.
must be the ones who get the rude answers are the ones who don't have a
sense of humor or self worth. interesting how that works out.

uri

--=20
Uri Guttman  -----------------  SYStems ARCHitecture and Software Enginee=
ring
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consul=
ting
Have Perl, Will Travel  -----------------------------  http://www.sysarch=
.com
The Best Search Engine on the Net -------------  http://www.northernlight=
.com


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

Date: Fri, 02 Jul 1999 12:59:53 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: hiring perl programmers
Message-Id: <bigiain-0207991259530001@bigman.mighty.aust.com>

Uri wrote:

> NOTE: another reply without snide comments. i must be on a roll.
> must be the ones who get the rude answers are the ones who don't have a
> sense of humor or self worth. interesting how that works out.

Hey! what have you done with the *real* Uri??? :-)


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

Date: 01 Jul 1999 23:11:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: hiring perl programmers
Message-Id: <x7iu833fus.fsf@home.sysarch.com>

>>>>> "IC" =3D=3D Iain Chalmers <bigiain@mightymedia.com.au> writes:

  IC> Uri wrote:
  >> NOTE: another reply without snide comments. i must be on a roll.
  >> must be the ones who get the rude answers are the ones who don't hav=
e a
  >> sense of humor or self worth. interesting how that works out.

  IC> Hey! what have you done with the *real* Uri??? :-)

i have kidnapped him and i am holding him hostage. i will release him
when all the whiners in this group acknowledge him to be a perl god and
the proper burnt offerings of newbies are made.

the fake uri

--=20
Uri Guttman  -----------------  SYStems ARCHitecture and Software Enginee=
ring
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consul=
ting
Have Perl, Will Travel  -----------------------------  http://www.sysarch=
.com
The Best Search Engine on the Net -------------  http://www.northernlight=
.com


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

Date: Fri, 02 Jul 1999 13:23:07 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: hiring perl programmers
Message-Id: <bigiain-0207991323070001@bigman.mighty.aust.com>

The Fake Uri wrote:

> >>>>> "IC" =3D=3D Iain Chalmers <bigiain@mightymedia.com.au> writes:
>=20
>   IC> Uri wrote:
>   >> NOTE: another reply without snide comments. i must be on a roll.
>   >> must be the ones who get the rude answers are the ones who don't h=
ave a
>   >> sense of humor or self worth. interesting how that works out.
>=20
>   IC> Hey! what have you done with the *real* Uri??? :-)
>=20
> i have kidnapped him and i am holding him hostage. i will release him
> when all the whiners in this group acknowledge him to be a perl god and
> the proper burnt offerings of newbies are made.

Cool! I'm rounding up a few newbies as I type this - will photos of the
pyre do, or should I snail mail the remains somewhere???

Does it matter if the newbie-roast is contaminated by a whiner or two?

yr mst humble minion,

big

(wondering if he'll get away with slipping a few VB newbies in too)


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

Date: Fri, 02 Jul 1999 00:49:29 GMT
From: Leon <leonandrews@my-deja.com>
Subject: How do I do an FTP PUT with LWP?
Message-Id: <7lh2am$ten$1@nnrp1.deja.com>

Hi,

I am trying to put a file on an ftp server using LWP.

The code below runs, and the file is put on the server, but with no
content, ie the file is there but with a size of 0 bytes.

There are two things I would like to find out:

1) How to change the upload type to ascii using type=3Da  -it says in the
docs that you put the string ``type=3Da" in the URL, but I can't work out
where, or if the backticks.quotes are important.

2) whether this will solve my problem, or if I'm missing some more code.

Many thanks,

Leon.



use LWP::UserAgent;
$ua =3D new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);

# Create a request

$req =3D HTTP::Request->new(PUT
=3D> 'ftp://username:password@ftp.mysite.com/leon.html');
$req->header(Accept =3D> "text/html, */*;q=3D0.1");

my $res =3D $ua->request($req);

# Check the outcome of the response

if ($res->is_success) {
    print $res->content;
}
else {
    print "Bad luck this time\n";
}



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


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

Date: Thu, 01 Jul 1999 22:17:05 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: how to trap errors in open ( | <process_name> ) ??
Message-Id: <slrn7nnts0.65.alastair@calliope.demon.co.uk>

ochang9153@my-deja.com <ochang9153@my-deja.com> wrote:
>Hi all,
>
>I have the following bit of code:
>
>open ( FILE_HANDLE," |myScript.pl > output.txt" );

You should, ofcourse, check the return value of any open.

>exit -1;
>
>if it fails.  Is there any way to check the exit
>code of myscript.pl in the code fragment above??

Checking the docs you should check the return value from a 'close' - fals=
e is
non-zero error status from the child, transmitted to 'close'.

The 'wait' status of the child process is returned in $?.

This translates ;

$exit_value =3D $? >> 8;
$dumped_core =3D $? & 128;
$signal_number =3D $? & 127;

HTH.

--=20

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 01 Jul 1999 14:40:53 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: In Mountain View did Larry Wall
Message-Id: <377BC445.BAA28BDC@mindspring.com>

David Cassell wrote:
>=20
> Jarkko Hietaniemi wrote:
> >
> > lr@hpl.hp.com (Larry Rosler) writes:
> >
> > > Kubla Kahn
> >
> > Kahn?
>=20
> Khan.  Moshe 'Kubla' Kahn is my brother-in-law, who is in
> dry goods.
>=20
LOL.

Reminds me of a DEC (yeah, I know, that dates me) salesman named
Changis.  One of their programmers accidentally referred to him as
"Genghis" in a meeting.  Visions of a Mongol warrior trying to sell
VAXen:  "Looks good inside your yurt.  Can cluster them together; we
call it the Golden Horde.  The Tartars don't have anything like this..."
=20
-----------------
Out, damned spot!
Out, spot, out!
      -- Shakespeare for First Grade




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

Date: Fri, 02 Jul 1999 01:23:47 +0200
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: INC not working properly
Message-Id: <377BF883.1888E011@studbox.uni-stuttgart.de>


> # Trying to set the local variable INC using pop and push.
> pop @INC;
> print "After pop; INC =3D  @INC\n";
> push @INC, ';d:/Perl/5.005/lib';
> push @INC, ';d:/Perl/site/5.005/lib';
> push @INC, ';d:/Perl/site/5.005/lib/File';
> print "After push; INC =3D  @INC\n";

this might work if you take out the semi-colons.

push @INC, 'd:/Perl/5.005/lib';
etc.

better would be to set the PERL5LIB environment variable, and not worry
about scripting it.

--
Pete Gilbert  *** email: pkg@studbox.uni-stuttgart.de


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

Date: Thu, 1 Jul 1999 22:24:07 +0100
From: Chris Conwell <chris@mobiles.co.uk>
Subject: linking directories?
Message-Id: <y50ONAA3x9e3EAQo@mobiles.co.uk>


I'm sure the answer is staring me in the face but I still can't see it!

I know how to use "symlink" to link two filenames together but how do I
replicate the "ln -s" command in Perl so that I can link two directories
together?

I don't have telnet access on a new server so am having to script all
the commands I would normally just type at the command line... :(

--=20

  Chris (Mobiles, Watford)                         http://www.mobiles.co.=
uk=20
+------------------------------------------------------------------------=
--+
| Boxed & Ready: Phone, Connection & 15 months line rental just 79.99 ukp=
  |
|  Contact: 01923-804444  Mobile: 07970-804444  & 24hr Fax: 01923-805555 =
  |
+------------------------------------------------------------------------=
--+
 Retail Shop & Nokia Service Centre: 346-348 St Albans Rd, Watford, WD2 5=
PQ
Nokia Service Centre Tel 01923-801111  Nokia Service Centre Fax 01923-802=
222


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

Date: Fri, 02 Jul 1999 02:22:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: linking directories?
Message-Id: <lnVe3.141$VK2.6017@nsw.nnrp.telstra.net>

In article <y50ONAA3x9e3EAQo@mobiles.co.uk>,
	Chris Conwell <chris@mobiles.co.uk> writes:
> I'm sure the answer is staring me in the face but I still can't see it!

yep.

> I know how to use "symlink" to link two filenames together but how do I
> replicate the "ln -s" command in Perl so that I can link two directorie=
s
> together?

directories are files.

symlink OLD_DIRNAME, NEW_DIRNAME

Just a bit of pedantry: You do not 'links two directories together'.
You create a new filename, which is symbolically linked to the old
one. They do not become equivalent or anything like that. Even a hard
link cannot be described as 'linking two directories together'. In the
latter case you just have two directory entries pointing to the same
inode.

Martien
--=20
Martien Verbruggen                  |=20
Interactive Media Division          | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.       | make up 3/4 of the population.
NSW, Australia                      |=20


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

Date: Thu, 01 Jul 1999 21:13:41 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Looking for old version of Perl
Message-Id: <slrn7nnq53.65.alastair@calliope.demon.co.uk>

Robert Greenwood <robert.greenwood@citicorp.com> wrote:
>Hi
>
>Does anyone know how I can get hold of an old copy of the
>Perl source distribution?  I'm looking for 4.0.1.8.

I should ask 'why?' and counsel using a modern Perl, but won't.

I think that some unix system vendors (e.g. SGI) have, until fairly recen=
tly,
shipped perl version 4 (something) by default. There must be lots of sour=
ce
distributions around. It might be worth asking on ;

comp.sys.sgi.apps

(or a Sun,HP,IBM group)

HTH.

--=20

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 01 Jul 1999 23:12:45 +0200
From: Dennis Voss <dennis.voss@joice.net>
Subject: Looking for real-time chat
Message-Id: <377BD9CD.19A239A3@joice.net>

Hi,

I'm looking for a real time chat script for my intranet.
I have located several ones that modify a static page and
the browser reloads it every 5 secs. - But I'm looking for
a real-time script.
Please tell me where I could find one.
Thanks,

Dennis



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

Date: Thu, 1 Jul 1999 15:34:38 -0600
From: "Jeremy" <jdsv@hotmailSpAmSuX.com>
Subject: Re: Looking for real-time chat
Message-Id: <Q9Re3.407$Jl1.68914@news.uswest.net>

    I don't know why 5 seconds isn't close enough to real-time to be
sufficient, but here's a great script:

http://www.e-scripts.com/echat/index.htm

    If your server is capable, this will do server push and be
virtually-real-time.

    -Jeremy
Dennis Voss <dennis.voss@joice.net> wrote in message
news:377BD9CD.19A239A3@joice.net...
> Hi,
>
> I'm looking for a real time chat script for my intranet.
> I have located several ones that modify a static page and
> the browser reloads it every 5 secs. - But I'm looking for
> a real-time script.
> Please tell me where I could find one.
> Thanks,
>
> Dennis
>




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

Date: Thu, 01 Jul 1999 17:17:36 -0400
From: Christopher Hogan <chogan@cs.cmu.edu>
Subject: magical string increment subtlety
Message-Id: <377BDAF0.4E32AD8C@cs.cmu.edu>

I've tried the following on both 5.004_04 and 5.005_02, with the same
strange result:

> perl -e '$o=3D"k1pam0000" ; $o++ ; print "$o\n" ;'
1

> perl -e '$o=3D"kpam0000" ; $o++ ; print "$o\n" ;' # note no '1' in stri=
ng
kpam0001

Is this a bug or a feature?  What's a work-around to get the latter
behavior in the former case (my filenames just come with numbers in
them)?

--chris

--=20
christopher m. hogan			language technologies institute
chogan@cs.cmu.edu			     carnegie mellon university
http://www.cs.cmu.edu/~chogan		                 pittsburgh, pa


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

Date: 1 Jul 1999 22:46:23 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: magical string increment subtlety
Message-Id: <7lgr3v$1di$1@news.NERO.NET>

In comp.lang.perl.moderated Christopher Hogan <chogan@cs.cmu.edu> wrote:
: I've tried the following on both 5.004_04 and 5.005_02, with the same
: strange result:

:> perl -e '$o=3D"k1pam0000" ; $o++ ; print "$o\n" ;'
: 1

:> perl -e '$o=3D"kpam0000" ; $o++ ; print "$o\n" ;' # note no '1' in str=
ing
: kpam0001

: Is this a bug or a feature?  What's a work-around to get the latter
: behavior in the former case (my filenames just come with numbers in
: them)?

It's a feature. Magic increment only works with strings that match
/^[A-Za-z]+\d*$/, which is why the second works but the first doesn't.
(Since the first doesn't match, perl does a numeric conversion then
increments the result. -w will warn you about this one)

The only real option you've got is to duplicate magic increment's
functionality yourself with a bit more leniency.=20

					Dan


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

Date: 1 Jul 1999 18:44:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: make my day fix an array :-)
Message-Id: <slrn7nnva6.31h.abigail@alexandra.delanet.com>

Mr. Dave (wavey@pilot.infi.net) wrote on MMCXXX September MCMXCIII in
<URL:news:377B0418.89E266ED@pilot.infi.net>:
<> This is a snippet of a data file that my script will work on
<>=20
<> =3Dcasper64=3D Jun 10 00:45:42, dane
<> =3Dmaddog=3D Jun 10 00:54:15, dane
<> =3Dcasper64=3D Jun 10 00:56:12, jamesgr
<>=20
<> Any one know an efficiant way to eliminate lines that have the same
<> =3Duser=3D and are within one minute of each other?  Keep in mind the =
array
<> might me as large as 800 or more elements!  If I sort the array (=3Dus=
er=3D
<> will be in ABC order) I have a subroutine that can eliminate entries
<> within a minute of each other.  But I need the entries in chronologica=
l
<> order....


Poor specification. What is supposed to happen with:


=3Dabigail=3D  Jun 25 10:10:10, abigail
=3Dabigail=3D  Jun 25 10:10:40, abigail
=3Dabigail=3D  Jun 25 10:11:20, abigail


How much entries does the result have:
  0:  10:10:10 is within a minute of 10:10:40, which is within a
      minute of 10:11:20, hence all entries disappear.
  1:  10:10:40 is within a minute of 10:10:10, and 10:11:20 is within
      a minute of 10:10:40, leaving just 10:10:10.
  2:  10:10:40 is withing a minute of 10:10:10. 10:11:20 is more than=20
      a minute from 10:10:10.

I'd say the first option is the most logical one, because "within" is
a symmetric relationship.


Abigail
--=20
srand 123456;$-=3Drand$_--=3D>@[[$-,$_]=3D@[[$_,$-]for(reverse+1..(@[=3Ds=
plit
//=3D>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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


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

Date: 1 Jul 1999 18:45:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: make my day fix an array :-)
Message-Id: <slrn7nnvd2.31h.abigail@alexandra.delanet.com>

Thomas Weholt (thomas@bibsyst.no) wrote on MMCXXX September MCMXCIII in
<URL:news:377B2A37.6921EE8A@bibsyst.no>:
::=20
:: Can`t you answer one posting without being an a**h**e? I`ve read almos=
t every
:: reply you have given and they all contain some stupid, non-constructiv=
e remar
:: I don`t understand why you have the strange need to behave like such a=
n arrog
:: know-it-all in every thing you do in this group. You are most probably=
 a grea
:: perl-hacker, but a supportive tutor-like, guru-could-be you`re most de=
finitly
:: not.


But we love him anyway.



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


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


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

Date: 01 Jul 1999 22:17:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: make my day fix an array :-)
Message-Id: <x7zp1f3icx.fsf@home.sysarch.com>

>>>>> "A" =3D=3D Abigail  <abigail@delanet.com> writes:

  A> Thomas Weholt (thomas@bibsyst.no) wrote on MMCXXX September
  A> MCMXCIII in <URL:news:377B2A37.6921EE8A@bibsyst.no>: :: :: Can`t
  A> you answer one posting without being an a**h**e? I`ve read almost
  A> every :: reply you have given and they all contain some stupid,
  A> non-constructive remar :: I don`t understand why you have the
  A> strange need to behave like such an arrog :: know-it-all in every
  A> thing you do in this group. You are most probably a grea ::
  A> perl-hacker, but a supportive tutor-like, guru-could-be you`re most
  A> definitly :: not.

  A> But we love him anyway.

back at ya!!

uri

(i met abigail at yapc and that totally changed my attitude towards her.)

--=20
Uri Guttman  -----------------  SYStems ARCHitecture and Software Enginee=
ring
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consul=
ting
Have Perl, Will Travel  -----------------------------  http://www.sysarch=
.com
The Best Search Engine on the Net -------------  http://www.northernlight=
.com


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

Date: 1 Jul 1999 18:48:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Making things go "BEEP!"
Message-Id: <slrn7nnvhk.31h.abigail@alexandra.delanet.com>

Andrew Allen (ada@fc.hp.com) wrote on MMCXXX September MCMXCIII in
<URL:news:7lg83o$f26$2@fcnews.fc.hp.com>:
!! David Efflandt (efflandt@xnet.com) wrote:
!! : >print chr(7);
!!=20
!! : That works from the Linux console, but not in xterm=20
!!=20
!! It works in _my_ xterm. When did yours get a beepectomy?


The wonders of xset b off.

Computers should be silent!


Abigail
--=20
srand 123456;$-=3Drand$_--=3D>@[[$-,$_]=3D@[[$_,$-]for(reverse+1..(@[=3Ds=
plit
//=3D>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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


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

Date: Thu, 1 Jul 1999 21:33:34 -0400
From: "Doug Crabtree" <not@gonna.tell>
Subject: MLDBM on WIN32
Message-Id: <7lh51n$f1r$1@nntp5.atl.mindspring.net>

I installed the Win32 modules for MLDBM on my system (ActivePerl).  For s=
ome
reason, it won't work.  The script just seems to stop at the point I use =
any
of the functionality of it.  Has anybody seen/fixed this problem?  Is the=
re
another module that I need?

TIA,
Doug




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

Date: Fri, 02 Jul 1999 03:53:49 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: Modules on Win32
Message-Id: <377C3816.244B7295@email.com>

Thanks the advice.

Doing this, I keep getting errors when it tries to "make". I have the mak=
e
program set to make.exe that came with the Cygwin program that Toby sugge=
sted.
The errors usually say "*** missing separator" but I can't even figure ou=
t what
that means. Can you help?

Thanks again,
Jordan

William Herrera wrote:
>=20
> On Wed, 30 Jun 1999 18:12:50 GMT, Jordan Hiller <hiller@email.com>
> wrote:
>=20
> >This must be a FAQ but I can't find the answer anywhere...
> >
> >I run ActiveState's Perl for Win32 on my Windows 98 machine. How do I =
install
> >modules from CPAN?
>=20
> PPM installs the Activestate packages, some of which are also on CPAN.
> For the CPAN native packages from a CPAN site do this:
>=20
> First, make sure you have cpan.pm (should be in perl/lib)
>=20
> run
>=20
> perl -MCPAN -e shell;
>=20
> from the directory CPAN.pm is in. Configure. Use. The directories CPAN
> creates for new modules are a bit strange sometimes for a win32
> installation. Move if necessary.
>=20
> Should be in some FAQ, I hope.
>=20
> ---
> The above from: address is spamblocked. Use wherrera (at) lynxview (dot=
) com for the reply address.

--=20
Jordan Hiller
hiller@email.com

:=FE


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

Date: 1 Jul 1999 18:50:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: newbie in PERL: Can you please suggest a solution?
Message-Id: <slrn7nnvkr.31h.abigail@alexandra.delanet.com>

info@sisblansko.cz (info@sisblansko.cz) wrote on MMCXXX September
MCMXCIII in <URL:news:7lftnb$er6$1@nnrp1.deja.com>:
;; I have several fields such as First name, Surname, Address and
;; Age.(They can be separated by commas on one line like a text file). I
;; need to allow users to add, save, browse, choose and possibly delete
;; records(lines). I think the best solution would be to use a database b=
ut
;; it seem to be rather difficult in PERL. Is there a more simple way how
;; to do it in PERL? Thanks for an advice.


Databases are incredibly easy in Perl. If you find them rather difficult,
learn a bit about them first. Also, read perlfaq1 for the correct spellin=
g
of Perl.



Abigail
--=20
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q=
{print=20
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | per=
l -w


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


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

Date: Thu, 01 Jul 1999 20:10:06 -0400
From: Steve Palincsar <palincss@his.com>
Subject: Re: Newbie is back!! This time knows his stuff (he thinks)
Message-Id: <377C035E.A5BE6831@his.com>

Cameron Graham wrote:

> #!perl -w
>=20
> #use strict;
>=20
> # PAGE DATA IS RECIEVED HERE
>=20
> @input=3D("name","qname","age","pclans","whyjoin","whyletu","icqpros","=
icqnet"
> ,"longon");
>=20
> # INPUTS FROM THE PAGE ARE
> # TAKEN FROM HERE ON AND
> # ASSIGNED VARIABLES.

You're a C programmer, aren't you?  "main" is not idiomatic perl.

If this is a CGI (and 'inputs from the page' leads me to believe
that is true) it's far more important to be using the -T (taint
checking) switch than the -w switch.

You're checking these errors  one at a time.  In a CGI environment,
you'd do better checking all the errors at once, sending back one
page with an explanation of all the errors.  Far less irritating.
Your approach resembles being nibbled to death by ducks.


> main: {
>     if ( $input[0] eq '' )
>            { $error=3D"Please give me your real name"; }
>                { &oppshtml }

But you've assigned "name" to $input[0].  Why check it?
Ditto for everything else.  Or is there something really
significant (like parsing user input) missing here?
And if so, then perhaps an array isn't the correct data
structure.  A hash would do much better, since you can
contain both the field name and the value.

>=20
>     if ( $input[1] eq '' )
>            { $error=3D"Please give me your Quake name"; }
>                { &oppshtml }
>
[snip]

>=20
> &savefile;
> &thanxhtml   <=3D=3D  what wee little thingie is missing here?  ;
>=20
> ### SUBROUTINES ###
>=20
> # SAVES EVERYTHING TO A FILE
> sub savefile {
>=20
>     $filename=3D"apps/apps.txt";  <=3D=3D  why is this a global?  What =
would
strict say about this?

>=20
>     open(FILE, ">>$filename") || die;  <=3D=3D=3D This would be lots mo=
re helpful
if you knew why it died, don't you think?  try 'or die "Can't open
file, $!";


What an opportunity for a here document!  And as we can
see below, you do know what a here document is.  Works
for files as well as it does sending HTML code to stdout.

>     print FILE "********************************\n";
>     print FILE "NAME: $input[0]\n"; #60
>     print FILE "QUAKE NAME: $input[1]\n";
>     print FILE "AGE: $input[2]\n";
>     print FILE "PREVIOUS CLANS: $input[3]\n";
>     print FILE "JOINING COS: $input[4]\n";
>     print FILE "WE SHOULD LET COS: $input[5]\n";
>     print FILE "ICQ-PROSPER: $input[6]\n";
>     print FILE "ICQ-NET: $input[7]\n";
>     print FILE "BEEN ON PROSPER FOR: $input[8]\n";
>     print FILE "********************************\n"; =20
>     print FILE "\n";
>     close(FILE);   <=3D=3D=3D  you didn't test here, either
> }
>=20
> # THE ERROR MESSAGE (IF APPLICABLE)
> # IS GENERATED INTO A WEB PAGE HERE
> sub oopshtml {
>=20
>     print "Content-type: text/html\n\n";
>     print <<HTML;
> <HTML>
> <HEAD>
> <TITLE>WHOOPS! - SOMETHING WENT WRONG!<TITLE>
> </HEAD>
> <BODY>
> <CENTER>
> <h1>HAY!! $error</h1>
> </CENTER>
> </BODY>
> </HTML>
> HTML
>     exit;
> }
>=20
> # THE THANK YOU HTML MESSAGE IS GENERATED HERE
> sub thanxhtml {}
> (yet to do this little bitty)
>=20
> cheers again ppl!


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

Date: 1 Jul 1999 18:58:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Newbie questions
Message-Id: <slrn7no05i.31h.abigail@alexandra.delanet.com>

CapWalker (jamescwalker@csi.com) wrote on MMCXXX September MCMXCIII in
<URL:news:930853172.25358@www.remarq.com>:
?? Sorry to double post, but I can't find my first message...
??=20
?? As a total newbie I need some guidance, either to a FAQ or
?? if someone can reply...

The FAQ comes with Perl.=20

?? 1 - What programs should I get to start Perl ? I've gotten

Just perl itself.

??     version 5.x and the PDK from Activestate
?? 2 - What program in the two above will create a stand alone
??     executable ?

None. You do not want to do this anyway. Read the faq. It comes
with Perl.

?? 3 - I'm going out tonight and buying the camel book from
??     O'reilly. Are there others that speak to a Windows 9x
??     or NT environment ?

Perl isn't platform specific. It would be wrong to say that you need
the equivalent of the Camel for a specific environment.

There's learning Perl for Windows though - I've always wondered how
that book is written. More pictures? One syllable words? Silly sounds?



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


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


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

Date: Thu, 1 Jul 1999 22:00:11 -0700
From: cabney <cabney@cyberpass.net>
Subject: oh oh!  Try this
Message-Id: <Pine.SOL.3.96.990701214102.3413A-100000@sirius.infonex.com>

Sorry I don't have perlbug on this box.  I'm using 5.00404 here, and I
believe 5.00503 at work, and 5.00405 on my friends box (who helped
me find the working example... thanks chad).

Try invoking this with and without the -D flag and note the behavior of
$DEBUG:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<test1.pl>=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/usr/bin/perl -w
use Getopt::Std;

getopts('pDd:f:');
print "opt-D is:  $opt_D\n";

# if it's on the command line w/no arg it gets a 1
$opt_D ? $DEBUG =3D 1 : $DEBUG =3D 0;

print "opt-D is:  $opt_D\n";
print "DEBUG is:  $DEBUG\n";
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<test1.pl>=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Ok, this is how it /should/ behave:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<test2.pl>=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/usr/bin/perl -w
use Getopt::Std;

getopts('pDd:f:');
print "opt-D is:  $opt_D\n";

# if it's on the command line w/no arg it gets a 1
$opt_D ? foo(1) : foo(0);

print "opt-D is:  $opt_D\n";
print "DEBUG is:  $DEBUG\n";

sub foo {
	$DEBUG =3D shift;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<test2.pl>=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Forgive me if this is a FAQ, or a 'feature', but it looks like
assignments aren't being carried out inside the 'x ? y : z'=20
thinger.  Is this a bug?

-C
--=20
Einstein himself said that God doesn't roll dice. But he was wrong. And
in fact, anyone who has played role-playing games knows that God
probably had to roll quite a few dice to come up with a character like
Einstein.  -- Larry Wall                                     C. Abney



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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)=20
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. =20

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

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