[8246] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1863 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 18:08:14 1998

Date: Wed, 11 Feb 98 15:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 11 Feb 1998     Volume: 8 Number: 1863

Today's topics:
    Re: ? Regular Expressions ? (Hasan Diwan)
        [ANNOUNCE] Emacs::Lisp 0.3 and emacs-20.2 patch <jtobey@channel1.com>
        ANNOUNCE: D'oh 0.05 (Chris Nandor)
        ANNOUNCE: Lingua::PT::Conjugate (Etienne Grossmann)
        ANNOUNCE: MSSQL::DBlib and MSSQL::Sqllib (Erland Sommarskog)
    Re: Creating HTML documentation (Martien Verbruggen)
    Re: FAQless Forays (was: Code Example Needed) (Eileen Kortright)
        Forked, but do not know how to change a TTY <mb@cup.hp.com>
    Re: Help!  PERL Problem (Martien Verbruggen)
        Installing on win95 <blazing@teleport.com>
    Re: link exchange/swap script (Martien Verbruggen)
    Re: Negative of a minus sign is a plus? <shimpei+this+address+is+NOT+munged+.mil+.gov@socrates.caltech.edu>
        Newbie needs HELP <davidsmith@tidalwave.net>
    Re: Periodically check for lost-carrier (NT4) (Martien Verbruggen)
        Perl compiler <chanp@nortel.ca>
    Re: Perl compiler <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 11 Feb 1998 16:53:42 -0500
From: hdiwan@shell.clark.net (Hasan Diwan)
Subject: Re: ? Regular Expressions ?
Message-Id: <6bt6l6$edd@shell.clark.net>

Peter:-
	man == perldoc
"Peter Perchansky" <fp@pmpcs.com> writes:
>I don't have access to telnet in order to look at manual pages.  Can you
>point me to a web page?

-- 
Hsiang Huang
University of California at Berkeley
Department of Electrical Engineering/Computer Science
hasandiwan@mindless.b.com <--- anti-spam remove b. to reply


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

Date: 11 Feb 1998 22:50:14 GMT
From: John Tobey <jtobey@channel1.com>
Subject: [ANNOUNCE] Emacs::Lisp 0.3 and emacs-20.2 patch
Message-Id: <6bt9v6$7no$1@news1.teleport.com>

File: emacs-20.2-perlmacs-0.3.readme

##################################################################
###### CAUTION ###### CAUTION ###### CAUTION ###### CAUTION ######
##################################################################
#######                                                    #######
#######   THIS IS ALPHA SOFTWARE.  USE AT YOUR OWN RISK!   #######
####### EVERYTHING ABOUT THIS CODE IS SUBJECT TO CHANGE!!! #######
#######                                                    #######
##################################################################
###### CAUTION ###### CAUTION ###### CAUTION ###### CAUTION ######
##################################################################

WHAT
----
$CPAN/authors/id/JTOBEY/emacs-20.2-perlmacs-0.3.pl.gz, a patch for GNU
Emacs 20.2 to embed Perl 5.004.  Includes module "Emacs::Lisp".

WHY
---
The goal is to allow Emacs modules and customization code to be
written in Perl, as well as Emacs Lisp.  As of this ALPHA version, not
all features are implemented, documentation is incomplete, and
examples are lacking.

The task at hand is to discuss possible uses and interface details.
Anyone want to set up a mailing list or newsgroup?  Please email me if
you would like to do this.

HOW
---
You must first install PERL VERSION 5.004.  Although I have never
tried it with 5.003 or 5.0045+, I doubt that it would work and am not
ready to support these.

Your perl must have working ExtUtils::Embed and ExtUtils::MakeMaker
capabilities.  If not, the configure script will exclude Perl support,
and you will have essentially standard GNU Emacs.

Retrieve and untar the Emacs distribution; for example:

   ftp://prep.ai.mit.edu/pub/gnu/emacs-20.2.tar.gz
   ftp://sunsite.unc.edu/pub/gnu/emacs-20.2.tar.gz

Retrieve the patch (see above).  Then do

   cd emacs-20.2
   gzip -dc ../emacs-20.2-perlmacs-0.3.pl.gz |perl
   ./configure
   make

and, if you're the adventurous type,

   make install

Most of the documentation is in perl/Emacs-Lisp/Lisp.pm and should be
accessible after installation via

   perldoc Emacs::Lisp


CAVEAT
------
This is not meant to be tried on anything other than Unix-like
systems.  However, if you get it to work on non-unix, I would be
delighted to hear about it!

Cheers,
John
jtobey@channel1.com




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

Date: 11 Feb 1998 22:50:51 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: ANNOUNCE: D'oh 0.05
Message-Id: <6bta0b$7oe$1@news1.teleport.com>

Making its rounds to CPAN as we speak.



Monday, February 2, 1998

This is D'oh 0.05, a simple debug module that redirects STDERR and
STDOUT to files.  The name is somewhat cathartic, don't you think?

This archive can always be obtained from:

    http://pudge.net/macperl/
    http://perl.com/CPAN/authors/id/CNANDOR/
    http://perl.com/CPAN/modules/by-module/D/

Mac users: The file is a tarred, gzipped file.  Use Stuffit Expander
or a similar program to get at the archive.

Please let me know how well it does(n't) work, and any changes you'd
like to see.


Version: PGPfreeware 5.0 for non-commercial use <http://www.pgp.com>
Charset: noconv

iQCVAwUBNNX8/yhcZja3bnKtAQEITQP/WOT7WYoXRw7xMJ4Vxzxo/ZnA5jhj/dpL
E6BjyuoJeaUQpBYIg0OwOjyVm2aZ66dPqFDD6fjiO8eAxHG0d5ZNf3e0qoP4Kwy1
tMtGVqKw1UpwiBK/WggIpbceX/Cd74IjIVoWdCjz2RcJall8N2hFufW84XjoD+LK
VLbVMhE9wYU=
=1RSp
-----END PGP SIGNATURE-----

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#





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

Date: 11 Feb 1998 22:49:36 GMT
From: etienne@isr.isr.ist.utl.pt (Etienne Grossmann)
Subject: ANNOUNCE: Lingua::PT::Conjugate
Message-Id: <6bt9u0$7n3$1@news1.teleport.com>



  Hello,

 
  the module Lingua::PT::Conjugate is not just for programmers, as it
also contains shell-callable program-lets, one of which is meant to
train the user at conjugating Portuguese verbs :

  The program   treinar  chooses (you may choose it too) a verb, and
asks you to conjugate it. If you fail, it will put it that verb in a
file ~/.flunked.verbs and will probably ask you about that verb later
on, until you learn it (it will then delete the verb from the file). 

  Typical output : (sorry, there are iso-8859-1 characters. they can
be toggled off)

######################################################################
> treinar difundir cimp

           A DRILLING PROGRAM FOR PORTUGUESE VERBS                   
---------------------------------------------------------------------
 INPUT:                       COMMANDS:                              
 q                            Quit                                   
 h                            Print help                             
 <verb>                       Enter the requested verb               
 c [eu|tu...|1..6] <verb>     Correct a previous entry 
 f [tense]                    Fix drilled tense (default : current)
 i                            Toggle iso 8859-1 accentuation
 t [verb] [tense]             Will drill next  on "verb" at "tense"  
                              (default : same)                       
                                                                     
           A ACENTUA\C~AO E A CEDILHA FAZEM-SE ASSIM.                
---------------------------------------------------------------------

           difundir            Conjuntivo  Imperfeito         

        eu difundisse          OK 
        tu difundisses         OK 
   ele/ela difundisse          OK 
       nss difundmssemos       OK 
 eles/elas difundisem          Nope : difundissem

Appending to .flunked_verbs

           cobrir              Conjuntivo Presente            

        eu q

           Adeusinho 

######################################################################

  Not high-tech looks, but it seems to work ok. Bug reports are
welcome and awaited, as well as advice and relevant opinions.	

  On the programming side,

use Lingua::PT::Conjugate ;    

  puts in your namespace a function "conjug" ;

  
$verb  = "dormir";  # The verb is "to sleep"
$tense = "pres"  ;  # The tense is "present". It could have been :

        # "perf"  for "perfeito"              (I slept)
        # "imp"   for "imperfeito"            (I was sleeping) 
        # "fut"   for "futuro"                (I will sleep)
        # "mdp"   for "mais-que-perfeito"     (I had slept)
        # "cpres" for "conjuntivo presente"   (that I sleep)
        # "cimp"  for "conjuntivo imperfeito" (that you were sleeping)
        # "cfut"  for "conjuntivo futuro"     (when I will sleep)
        # "cond"  for "condicional"           (I would sleep)
        # "ivo"   for "imperativo"            (sleep!)
        # "pp"    for "participio passado"    (slept)
        # "grd"   for "gerundivo"             (sleeping)

$a = conjug("$verb","$tense");

   assigns to $a the string : 
<<EOS
dormir :  irreg                              
pres      durmo dormes dorme dormimos dormem 
EOS

  in order to only get the verbal forms, and only for the 3rd person
singular :

$a = conjug("q","dormir","pres",3);

  yields :

<<EOS
dorme
EOS	

	The heading parameter "q" is an option for "quiet". There are
        others, described in the man pages.

  
        There is a shell wrapper called "conjug" , that takes the same
        options as the function :

######################################################################	
> conjug dormir
dormir :  irreg                                             
pres      durmo    dormes    dorme    dormimos    dormem    
perf      dormi    dormiste  dormiu   dormimos    dormiram  
imp       dormia   dormias   dormia   dormmamos   dormiam   
fut       dormirei dormiras  dormira  dormiremos  dormirco  
mdp       dormira  dormiras  dormira  dormmramos  dormiram  
cpres     durma    durmas    durma    durmamos    durmam    
cimp      dormisse dormisses dormisse dormmssemos dormissem 
cfut      dormir   dormires  dormir   dormirmos   dormirem  
cond      dormiria dormirias dormiria dormirmamos dormiriam 
ivo                dorme     dorma    dormamos    dormam    
pp        dormido                                           
grd       dormindo                      
######################################################################	

	that's about it,

	Etienne


ps  : Thanks to all on usenet and here in Lisbon who helped with
advice, tips etc. 


pps : Maybe in a few months, a module that un-conjugates (takes in a
word, and tells me if it could be a verb, and if yes, at what tenses
and persons). Maybe.
 




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

Date: 11 Feb 1998 22:49:04 GMT
From: sommar-perl@algonet.se (Erland Sommarskog)
Subject: ANNOUNCE: MSSQL::DBlib and MSSQL::Sqllib
Message-Id: <6bt9t0$7j6$1@news1.teleport.com>

I'm proud to announce the appearance of MSSQL::DBlib and MSSQL::Sqllib, two
Perl classes for accessing Microsoft SQL Server through DB-Library.

Before I go on, there are two persons that I am in deep gratitude to. 
One is Michael Peppler who is famous for his Sybperl, and MSSQL::DBlib
is bascially a port of Sybperl::DBlib. The other person is Christian 
Mallwitz of Intershop GmbH who ported Sybperl 2.03 to Windows NT. (Thus,
features that Michael Peppler has added in more recent versions of
Sybperl are generally not available.)

MSSQL::DBlib provides a direct interface to MS SQL Server through 
DB-Library. 

MSSQL::Sqllib is built on top of MSSQL::DBlib and provides a high-level
interface, so you can say things like:

   @result = sql("SELECT * FROM sysdatabases");
   foreach $row (@result) {
      print "dbid: $$row{dbid}   name: $$row{name}\n";
   }

In this example you received the result as a hash, but there are several
options. Note the lack of error checking. This is because in the default
configuration MSSQL::Sqllib will abort execution on errors from SQL Server, 
so the caller does not to bother. Yet another goodie is that MSSQL::Sqllib
provides facilities for converting between character sets, far more flexible
that the ANSI/OEM flags you get from Microsoft.

To download it, go to http://www.algonet.se/~sommar/mssql. You can read
the manpages there, before you download. There is also a comparison with
Win32::ODBC for those who might be in doubt on what to use.

The zip file contains source, manpages, examples and binary for the Intel
platform. Currently I'm only supporting the ActiveState port. 

The MSSQL classes are not available at CPAN; this far I have only glanced
on the red tape to get things going there.

If you have any troubles in retrieving it or any other questions, please mail
me at sommar-perl@algonet.se. 

--
Erland Sommarskog, Stockholm, sommar@algonet.se
F=F6r =F6vrigt anser jag att QP b=F6r f=F6rst=F6ras.
B=65sid=65s, I think QP should b=65 d=65stroy=65d.




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

Date: 11 Feb 1998 22:11:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Creating HTML documentation
Message-Id: <6bt7lu$3s6$2@comdyn.comdyn.com.au>

In article <34E1635A.EBC9FE2F@i3.informatik.rwth-aachen.de>,
	Boris Boehlen <boris@i3.informatik.rwth-aachen.de> writes:
> Hi,
> 
> How can I use `pod2html' to create a HTML documentation for all
> installed Perl modules and pods? 

You mean in one swoop? 

> Or is there another tool to do this?

Have a look at the installhtml script that comes with the source
distribution. That shows you how to use pod2html to do these sorts of
things.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Wed, 11 Feb 1998 22:21:19 GMT
From: mystra@torilmud.com (Eileen Kortright)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <34e1e981.230402470@news.mw.mediaone.net>

On 11 Feb 1998 15:57:49 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>What you have read is the results of that futile foray.  The uncontended
>winner for the most common sort of posting is without doubt those that
>asked QUESTIONS ALREADY ANSWERED in the standard Perl FAQ.  The next most
>common, somewhat down the list but still getting in the way, were those
>postings unrelated to Perl, pertaining instead strictly to matters CGI.

That's because they don't know the difference between CGI and Perl.
They think one is the same as the other. It's a horrible misconception
and as someone already pointed out, blame those "Learn CGI in Seven
Days" books.

>Further investigation revealed a depressing but indisputable correlation:
>nearly all such postings were written by someone using a PC (meaning Mac
>or Windows) system, more often than not using a web browser with a lame,
>patched-together USENET interface rather than a dedicated newsreader tool.

So add me to the list, okay?

Horror! I'm using Windows! Horror! Flee! Run!  It's FREE AGENT, too!

Or do you want me to post from my Linux box? Or telnet to a shell
account and run rtin? Been there, done that. Is that the only way to
get any respect in here? 

>I'll tell you what: *you* go read a few hundred such repeated questions
>from lazy and clueless people who refuse to avail themselves of the
>hundreds of pages of free documentation included with every single Perl
>distribution, work that you have personally devoted untold months of
>your life to, and then then tell me whether you don't find yourself on
>the brusque side.  I'll bet you would.

Now THIS is hilarious. Months? That's it? A few months? Untold months?
I've worked five years in technical support, devoted over seven years
to the Internet thus far,  and have been running a MUD for over five
years now. I've BEEN there, I've done it, and I DO know what you mean,
okay? Yah! It's exasperating, irritating and frustrating as all get
out. 

Guess what? It's human nature! As a rule, most people do NOT read help
files or FAQs. You can coat them in gold and make them blink in the
dark, even make them spin on their ends and shout SEX!!! at the top of
their lungs,  but they will *not* read them. If you don't accept that
fact, it's going to drive you crazy. I kid you not. 

If you feel that strongly about it, then rename this group to
comp.lang.perl.professionals and change your FAQ to reflect it. Just
kick out anyone who asks a non-professional question.

>In short, the following killfile entries are entirely justified.
>
>    /X-Newsreader:.*Win/h:j
>    /X-Mailer:.*Win/h:j
>    /X-Mailer:.*Microsoft/h:j
>    /X-Newsreader:.*Microsoft/h:j
>    /X-Newsreader:.*Agent/h:j

Good! I see I'm in there.

>Then there's the matter of, "I'm not a programmer, but I need to program
>this web page".  If you're not a programmer, don't try to program.

And if I'm not a fish, I shouldn't swim? If man was meant to fly he'd
have wings? C'mon.

Like I can AFFORD to go out and hire someone to program a stupid
script for my PERSONAL non-profit web site? Like I have TIME, with a
husband and a year old baby and a PERSONAL deadline, to sit there and
learn the stuff you are touting? Did you ever stop to THINK that maybe
some people don't HAVE the education or the lifestyle to do what you
are pushing? Did you ever stop to think that maybe some people who
don't have the education HAVE to learn on their own, at their own
pace, in their own way? 

And did you ever stop to think that if it was a perfect world and
everyone did what you said, that it would be very boring indeed?

Did you?
No, I don't think so.

Look, I understand the animosity towards people who don't read the
FAQ, more than you would realize. I'm not even going to bother listing
the number of FAQs, help files and booklets I've written over the
years.  I know how upset one can get about that, but there is no
reason to take it out everyone else, is there?

>the job.  If you won't do that, then you *are* a programmer whether for
>income you pilot aircraft or sweep floors, and you will be held to the
>same rigorous technical standards as any other programmer.

By whom? You? Hah.
Someone who rides trail horses for fun on weekends is not an
equestrian, nor would I expect them to be. Nor would I expect them to
go to a riding school and learn all the basics. Why should they? They
just want to have some fun. What I *would* do is try to teach them a
bit at a  time, hopefully enough so that they just might enrole in
that riding school and learn at least the basics. The rest comes
naturally. 

I am to horsemanship what you are to Perl, kay? All I see you doing is
turning me OFF from learning how to code in Perl.

Gee, thanks.





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

Date: Wed, 11 Feb 1998 14:43:40 -0800
From: Marc Bernstein <mb@cup.hp.com>
Subject: Forked, but do not know how to change a TTY
Message-Id: <34E2299C.7C1EBF84@cup.hp.com>

Define $DB::fork_TTY or get_fork_TTY().
 ..................

I am trying to create a well behaved daemon but cant find a good
discussion explaining how to manage the TTY from Perl or a good module
to use that will provide generic daemon friendly startup - disconnect
from the TTY, etc.

I want to run this from inittab with a respawn attribute.

Could someone explain why I got the above message when in the debugger
but not when running the script separately? Can someone recommend a
Daemon module to use? The script will open a socket connection and
exchange information with yet another Daemon running on another machine.

Any suggestions welcome.

Thanks in advance,

Marc



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

Date: 11 Feb 1998 22:07:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help!  PERL Problem
Message-Id: <6bt7er$3s6$1@comdyn.comdyn.com.au>

In article <34E157D1.1751@sonic.net>,
	aardvark <xyz@sonic.net> writes:

> 	I'm trying to create a guestbook using the following perl script. 
> Currently, it displays each user guestbook entry above earlier
> entries.   Can anyone show me how to modify it so that each user
> guestbook entry will instead be displayed below earlier entries?    

I'll also point out some booboos for you.

> #!/usr/local/bin/perl

no -w flag.
no 'use strict'

And the worst of all:

You are not using CGI.pm! That could have saved you a multitude of
work, and would have prevented a lot of errors you made, make, and
probably will make while working on this script. It would also have
allowed you to run this script from the command line, to debug it. And
much, much more.

Why does everybody insist on reinventing the wheel and implement it in
a square manner, when they can get a very nicely round one for free?

> print "Content-type: text/html\n\n\n";

You only need two \n.

> $directory = $0;
> $directory =~ s#/[^/]*$##;
> $program = $0;
> $program =~ s#^.*/##;

This is a CGI, right? Why would that information be useful? A lot of
servers don't even run your script the way you think it is being run.

> $directory="." if ($directory eq $program);
> unshift(@INC, $directory);

argh.
Why are you doing this anyway? Don't have code in your scripts that
don't do anything. It's bad, and will cause errors.

> $file="/home/WWW_pages/xyz/guestbk.htm";
> 
> $separator="<!--start-->";
> 
> $formdata=<STDIN>;

Your script obviously has no provision whatsoever to deal with errors.
What happens if someone does a GET on this thing?

> $formdata=~s/\s+$//;
> foreach (split(/&/, $formdata))
> {
> ($name, $value)=split(/=/, $_);
> $name=~s/\+/ /g;
> $name=~s/%([0-9|A-F]{2})/pack(C,hex($1))/eg;
> $value=~s/\+/ /g;
> $value=~s/%([0-9|A-F]{2})/pack(C,hex($1))/eg;
> $data{$name}=$value;

CGI.pm would have done that for you, probably safer and better.

> }
> $message=$data{"comments"};
> $new=$separator."\n$data{'name'} <a href=\"mailto:$data{'e_mail'}\">$data{'e_mail'}</a> \n";  
> $new.="$message<br>\n<hr>\n";

Boy.. that's messy.

> unless (open (FILE, "$file"))
> 	{
> 	print "Cannot open $file for reading. The path may be incorrect.";
> 	exit;
> 	}

CGI.pm provides you with functionality to show errors in a nicer way.

On a failure of open(), use the $! variable to find out what went
wrong. This will work on all system calls.

> flock (FILE, 2);

You open just for read here, right? Not really necessary to lock.

> undef ($/);
> $page=<FILE>;
> $page=~s/$separator\s*/$new/;
> close FILE;
> 
> unless (open (FILE, ">$file"))
> 	{
> 	print "Cannot open $file for writing. The permission may be incorrect. 
> It should be 666 (read+write).";
> 	exit;
> 	}

See above.

> print FILE $page;
> flock (FILE, 8);
> close FILE;
> open (FILE, "$file");
> print (<FILE>);

No last close? Might be a good idea, even though it's not required in
this case. What happens if later on you start adding code to the end?

You really really should be doing all your file operations between one
open/close with a flock.

Now, back to the original question: 

> Can anyone show me how to modify it so that each user guestbook
> entry will instead be displayed below earlier entries?    

The stuff you have above (I won't use the word code for it)
deliberately puts the last entry at the front. That is the purpose of
that $separator. If you don't want that, the whole of the aboce stuff
becomes a lot easier. 

1) get the form data
2) open the file for appending and lock
3) write the new entry on a single line
4) close the file

You really should try understanding the code you're working on, before
attempting to alter it.

I could say more, but suddenly I feel tired.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Wed, 11 Feb 1998 14:48:12 -0800
From: Steven Berkson <blazing@teleport.com>
Subject: Installing on win95
Message-Id: <34E22AAC.5DE65676@teleport.com>

I'm trying to install perl 5.004 on a windows 95 system.  I have the
Activeware version.  I think I have it installed (unpacked) alright,
though I don't have it working.  I'm having a hard time finding a hold
your hand resource for setting it up however and it seems like there are
holes in the directions I have.  At this point I mostly want to just run
*.pl/*.cgi files that I am advised will run on both windows and unix.
Any resources outside of the links from activeware would be helpful.  Of
particular note...

The win95.txt file says,

"...HKEY_LOCAL_MACHINE\Software\ActiveWare\Perl5\COMSPEC
 must be set to the full path your shell."

My registry has the activeware\perl5 entry with lib & bin keys, but NO
COMSPEC key.  I can't make heads nor tails of these directions.

Please help the helpless...



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

Date: 11 Feb 1998 21:47:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: link exchange/swap script
Message-Id: <6bt699$3na$1@comdyn.comdyn.com.au>

In article <887178215.1005780999@dejanews.com>,
	Otis Gospodnetic <otis@POPULUS.net> writes:
> does anyone know of any perl scripts that will allow me to create some


You're asking for perl scripts, but your question has nothing to do
with the perl language, which this groups iss meant for. Try
http://www.cgi-resources.com/ for a big heap of CGI scripts. I'm
fairly certain that what you want to have is there.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd.       | why kamikaze pilots wore helmets - Dave
NSW, Australia                      | Edison 


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

Date: 11 Feb 1998 22:05:23 GMT
From: Shimpei Yamashita <shimpei+this+address+is+NOT+munged+.mil+.gov@socrates.caltech.edu>
Subject: Re: Negative of a minus sign is a plus?
Message-Id: <6bt7b3$43d@gap.cco.caltech.edu>

Ronald L. Parker <ron@farmworks.com> writes:
>
>There must be some sane reason why this was done, but could someone
>explain what it is?  This:
>
>perl -e "$x='-1';print -$x;"
>
>prints "+1".  Meanwhile, this:
>
>perl -e "$x='-1';print 0-$x;"
>
>prints the more sane "1".
>
>I understand that the "0-" signals Perl to convert $x to a numeric
>representation, but why doesn't just the "-"?
>
>More interesting ones:
>
>perl -e "$x='-a';print -$x;"   prints "+a"
>
>perl -e "$x='a';print -$x;"    prints "-a"
>
>perl -e "$x='a-b';print -$x;"  prints "-a-b" which wouldn't even be 
>true if this _were_ some kind of attempt at a symbolic math thingy.
>
>perl -e "$x='-';print -$x;"    prints "+"

I'm not completely sure about why, but it *is* documented in
perlop(1):

       Unary "-" performs arithmetic negation if the operand is
       numeric.  If the operand is an identifier, a string
       consisting of a minus sign concatenated with the
       identifier is returned.  Otherwise, if the string starts
       with a plus or minus, a string starting with the opposite
       sign is returned.  One effect of these rules is that
       -bareword is equivalent to "-bareword".

-- 
Shimpei Yamashita               <http://www.patnet.caltech.edu/%7Eshimpei/>
The address I have listed in the headers is a working address. It just
looks like it's an invalid address in order to fool spammers collecting
addresses from newsgroups.


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

Date: Wed, 11 Feb 1998 17:24:16 -0500
From: "David W. Smith" <davidsmith@tidalwave.net>
Subject: Newbie needs HELP
Message-Id: <34E22510.5755@tidalwave.net>

All,

I am new to PERL and need to get up to speed.  I bought the Teach
Yourself PERL in 21 Days book.  I should have checked here first as I
see a number of postings regarding errors.

I wrote a script that creates directories based on input from a web page
form.  The problem I have is that I can't get the directory created
where I want it -- someplace other than the home directory where the
script is run. The chdir command appears to have no effect.

I thought something like:

chdir ("c:\newdir");
mkdir ("newroot", 0755);
chdir (c:\newdir\newroot");
mkdir ("newsubdirectory", 0755);

would create a directory tree where ever I wanted (on the same file
system).  It doesn't.  All I get is "newdir" and "newsubdir" in the
sameplace.  I'm runnning PERL5.000 under Win NT4.0.  Soon I will want to
port to UNIX as well.

What am I missing?

Any help will be greatly appreciated.

David Smith
davidsmith@tidalwave.net


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

Date: 11 Feb 1998 22:19:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Periodically check for lost-carrier (NT4)
Message-Id: <6bt85m$3s6$3@comdyn.comdyn.com.au>

In article <6brqn5$2sm2$1@newssvr08-int.news.prodigy.com>,
	"Jay J" <jaybird612@frootloops.prodigy.net> writes:
> Unfortunately I'm having difficulties getting Apache (RH5 Build) to allow me
> to run CGI, so I opted to install Omni HTTPd for NT after a revelation from
> a NG post that said Perl would read output from an HTML form as <STDOUT>.

Huh? perl won't read from STDOUT. perl can read from STDIN, but that
has nothing to do with web servers or HTML forms.

[Snip of stuff about NT 'system' calls, current IP addresses, and
modem stuff]

> Any ideas?

If you are looking for ways to get your IP address in perl, have a
look at the Net:: modules, and gethostbyname (think 'localhost')

If you are looking for modem stuff: Have a look at CPAN
(http://www.perl.com/CPAN/). If there is anything out here to do
that, it should be there.

To run things periodically, you'll have to choose some NT specific
tool to do that.

> p.s. anyone who takes pity on me for my problems w/Apache, free advice is
> gladly accepted...

You should really take that discussion to the webservers newsgroups.
They'll most likely glady answer your questions.

comp.infosystems.www.servers.ms-windows

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Wed, 11 Feb 1998 16:24:56 -0500
From: Peter Chan <chanp@nortel.ca>
Subject: Perl compiler
Message-Id: <34E21728.37B1@nortel.ca>

I was wondering where I can get a perl compiler.

Thanks!
-- 


=======================================================================

                             PETER CHAN
                          Northern Telecom
                    Incremental Software Delivery

        PHONE: (613) 763-9096  EMAIL: chanp@nortel.ca
          FAX: (613) 763-4408  PCS-ENAIL: 613-277-3837@msg.clearnet.com

=======================================================================


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

Date: 11 Feb 1998 22:28:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl compiler
Message-Id: <6bt8ma$req$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Peter Chan <chanp@nortel.ca> writes:
:I was wondering where I can get a perl compiler.

This is discussed in the FAQ, included standardly with each and every
perl distriubution.  What part of the FAQ did you fail to find the
discussion in?  Did someone delete perlfaq3? Or perhaps something in
Deja News or even Alta Vista has mysteriously deleted all references to
this topic?

You do have a perl compiler: it's called /usr/bin/perl.  Although you
probably don't like calling it a compiler, it is.  The native-code
compiler that exists is guaranteed to disappoint you, because you think
it's something it isn't.  That compiler does not make your program
smaller in size, faster in run-time more portable, more maintainable,
more secure, nor more robust.  In fact, it substantially hurts all
those aspects.  

Also, you used too many lines of signature.  Four is regulation.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
        echo "Hmmm...you don't have Berkeley networking in libc.a..."
        echo "but the Wollongong group seems to have hacked it in."
            --Larry Wall in Configure from the perl distribution


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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