[9608] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3202 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 20 09:18:40 1998

Date: Mon, 20 Jul 98 06:01:20 -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           Mon, 20 Jul 1998     Volume: 8 Number: 3202

Today's topics:
        A simple question about sub routines <webmaster@acidhouse.com>
    Re: A simple question about sub routines <chris.wareham@blackwell.co.uk>
    Re: A simple question about sub routines (Bob Trieger)
    Re: A simple question about sub routines <zenin@bawdycaste.org>
    Re: A simple question about sub routines <tchrist@mox.perl.com>
    Re: A simple question about sub routines <tchrist@mox.perl.com>
        a simple search algorithm (Sascha Kerschhofer)
    Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. p (Fraggle)
    Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. p (Jens M. Felderhoff)
    Re: compare arrays (Dominic Dunlop)
        Compile problem on AIX 4.1 .. sh ./makedepend <dfisher@adc.metrica.co.uk>
    Re: Compile problem on AIX 4.1 .. sh ./makedepend (Jeffrey R. Drumm)
        converting html to latex using Perl. <jkinoshi@pcs.usp.br>
        Help!!: using foreach in 2 Dimension Hash... <yroh@samsung.co.kr>
        How to connect to a socket ? <grahamc@phsc.unp.ac.za>
    Re: How to connect to a socket ? <tchrist@mox.perl.com>
    Re: How to connect to a socket ? <zenin@bawdycaste.org>
        HTTP::Request not requesting <joe@rhein.to>
    Re: join and warnings on undef values <zenin@bawdycaste.org>
    Re: locale setting under Linux (bakki kudva)
        making a (perl)* database ...?? <koen.vandenbergh@a1.tminet.net>
    Re: Perl Beautifier Home Page (Abigail)
    Re: Perl Beautifier Home Page <rra@stanford.edu>
    Re: Perl Beautifier Home Page <zenin@bawdycaste.org>
    Re: Perl Beautifier Home Page <zenin@bawdycaste.org>
    Re: Perl Beautifier Home Page (Bart Lateur)
    Re: Perl Beautifier Home Page <zenin@bawdycaste.org>
    Re: Perl Beautifier Home Page <tchrist@mox.perl.com>
    Re: Perl Beautifier Home Page <adward@nortel.com>
    Re: Perl Beautifier Home Page <rra@stanford.edu>
    Re: Perl commands in NT Q's:  (was Re: Win32 install pr <clint@netcomuk.co.ukXX>
        Perl for IIS4 <mwesol@hacm.org>
    Re: Perl script to POP3 <pgunn01@ibm.net>
        Regex: operand could be empty dan@nospam.org
        return values for $^O <REPLY_TO_damonbrent@earthlink.net>
    Re: sub's and rsh rlogin <nospam@nospam.com>
        SysLogScan::SendmailLineTo <gking@c-com.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 20 Jul 1998 12:12:23 +0200
From: Nico van Leeuwen <webmaster@acidhouse.com>
Subject: A simple question about sub routines
Message-Id: <35B31805.990E9AF4@acidhouse.com>

Hi,

I have been spending some time learning perl for the past few weeks. I
just encounterd a problem with a program that I did not expect, infact I
doubt that the conclusion I have drawn from the mistake is correct.

My question is as follows:

If a subroutine is not called does perl ignore the code or does it try
to see if it works anyway?

I would expect that if you don't call a sub-routine then it won't be
proccessed however I just solved a problem I had with a program by
removing a not-used sub-routine.

Any clarifications would be welcome :o)

Nico van Leeuwen



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

Date: Mon, 20 Jul 1998 10:47:39 GMT
From: Chris Wareham <chris.wareham@blackwell.co.uk>
Subject: Re: A simple question about sub routines
Message-Id: <35B320E8.3150F14B@blackwell.co.uk>

Nico van Leeuwen wrote:
> 
> If a subroutine is not called does perl ignore the code or does it try
> to see if it works anyway?
> 

The interpreter parses and compiles all the code in your program prior to
running it. Unlike BASIC interpreters and older versions of Tcl, which
compile your program line by line as it is being run. This is one reason
why Perl is so quick once the initial compilation is done.

This means that your unused sub is parsed prior to compilation. One
exception to this is if you `require' the sub from another package.
According to `Advanced Perl Programming' (p.87), it will only be parsed
when it is invoked.

>
> I would expect that if you don't call a sub-routine then it won't be
> proccessed however I just solved a problem I had with a program by
> removing a not-used sub-routine.
> 

For a definitive answer, you're best bet is to post the code  that
reproduces the problem. If possible pare the code down to the bare
minimum.

Chris
-- 
chris.wareham@blackwell.co.uk
+44 (0)1865 792792 ext. 3381
http://www.killingmiranda.pair.com/


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

Date: Mon, 20 Jul 1998 10:44:27 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: A simple question about sub routines
Message-Id: <6ov770$l8c$1@ligarius.ultra.net>

[ posted and mailed ]

webmaster@acidhouse.com wrote:

-> If a subroutine is not called does perl ignore the code or does it try
-> to see if it works anyway?

Whether you call the sub or not, it is compiled by the interpretor. If it 
pukes during compiling, the whole program pukes.

-> I would expect that if you don't call a sub-routine then it won't be
-> proccessed however I just solved a problem I had with a program by
-> removing a not-used sub-routine.

The whole program is compiled before running, not each statement or subroutine 
as they are used.


HTH

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: 20 Jul 1998 11:11:05 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: A simple question about sub routines
Message-Id: <900933652.626261@thrush.omix.com>

Nico van Leeuwen <webmaster@acidhouse.com> wrote:
	>snip<
: My question is as follows:
: If a subroutine is not called does perl ignore the code or does it try
: to see if it works anyway?

	Yes.  Your entire program is parsed, compiled, and checked for
	syntax errors before it ever starts running. -Note there are
	exceptions to this, but don't worry about them right now as
	they are a little more advanced of an issue.

: I would expect that if you don't call a sub-routine then it won't be
: proccessed however I just solved a problem I had with a program by
: removing a not-used sub-routine.
: Any clarifications would be welcome :o)

	The code may not be run, but it will get parsed and compiled.

	This is considered a Good Thing by most actually.  Lack of compile
	time syntax checking is something that can make shell scripts
	very unreliable.  In a shell script, you won't know about simple
	syntax typo in a piece of code until your program gets to that
	location when actually running, causing random error conditions
	to occur that never should have.  Perl can (and will, as you've
	seen) tell you that any piece of code is invalid before it runs
	the first statement.  There are ways (the -w option, and "use
	strict") to make similar checks much, much stricter infact, which
	is invaluable when debugging.

-- 
-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: 20 Jul 1998 12:16:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A simple question about sub routines
Message-Id: <6ovce9$kcc$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    sowmaster@juicepigs.com (Bob Trieger) writes:
:Whether you call the sub or not, it is compiled by the interpretor. If it 
:pukes during compiling, the whole program pukes.

The interpreter compiles nothing.  That's the compiler's job.  When
compilation is complete, this then hands off the parse trees to
some backend, whether it be the interpreter or the code generator.

--tom
-- 
If you take Fred Cohen's definition of virus, then Unix itself is
one of the most successful viruses ever written, since it tends to
result in the creation of modified versions of itself on other
computer systems!  -- Gene Spafford


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

Date: 20 Jul 1998 12:17:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A simple question about sub routines
Message-Id: <6ovcg9$kcc$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Chris Wareham <chris.wareham@blackwell.co.uk> writes:
:The interpreter parses and compiles all the code in your program prior to
:running it. 

Why do people keep saying this?  Don't you know a compiler
from an interpeter?  Sheesh. :-(

The compiler compiles and provides the result to a backend,
like the interpreter or code generator.

--tom
-- 
                /* And you'll never guess what the dog had */
                /*   in its mouth... */
        --Larry Wall in stab.c from the v4.0 perl source code


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

Date: Mon, 20 Jul 1998 14:28:09 +0200
From: e9127005@stud1.tuwien.ac.at (Sascha Kerschhofer)
Subject: a simple search algorithm
Message-Id: <e9127005-2007981428090001@sozgr.htu.tuwien.ac.at>

im trying to implement a simple serchalgorithm, which is searching line of
a file. the thing is, that the whole stuff is behaving strange, so i was
testing
the out- and input.

&search;

sub search {
  local($lien, $name, $found);
  $name = "any_string";
  $found = 0;
  open(FILE, "orte2.txt");
  while (($found == 0) && ($line = <FILE>)) {
    chop($line);
    if ($name eq $line) {
     $found = 1;
     print $name." was found\n";
     } else {
     print $name." was not found but ".$line."\n";
     }
  }
  close(FILE);
}

anyway this doesnt work. the output is:

any_string was not found but 1st_string
any_string was not found but any_string
any_string was not found but 2nd_string

but the strange thing is, that if i change the else section to...
print $name." was not found but *".$line."*\n";
 ...the output is

*any_string was not found but *1st_string
*any_string was not found but *any_string
*any_string was not found but *2nd_string

it seems that the * and the \n were switched. maybe this ist the reason
why the serch does not work. what am i doing wrong?
It is perl, version 5.002 on UNIX.
any help is apreciated.

Sascha Kerschhofer


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

Date: 20 Jul 1998 08:23:47 GMT
From: Fraggle@ThePentagon.comNOSPAM (Fraggle)
Subject: Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. print)
Message-Id: <slrn6r5vpr.hoa.Fraggle@pulpy.dyn.ml.org>

On 18 Jul 1998 22:49:55 GMT, Fraggle <Fraggle@ThePentagon.comNOSPAM> wrote:
>On 17 Jul 1998 00:27:01 -0400, Uri Guttman <uri@sysarch.com> wrote:

>>Bonus: What is the OPPOSITE of spaghetti code?
>
>Dough code.

I'll change that to Morse Code.

-- 
hard, adj.:
	The quality of your own data; also how it is to believe those
	of other people.


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

Date: Mon, 20 Jul 1998 12:18:22 GMT
From: fe@hpley2.col.sw-ley.de (Jens M. Felderhoff)
Subject: Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. print)
Message-Id: <pb4swc7m29.fsf@HPLEY2.col.sw-ley.de>

Uri Guttman <uri@sysarch.com> writes:

> 1. Who is main the PERSON you should think about while you are writing code?

The next coder.

> 2. Other than comments, what is the most important HUMAN aspect of code?

Layout.

> 3. What is the main PURPOSE of comments?

Clarification.

> Bonus: What is the OPPOSITE of spaghetti code?

Modules.




Tschuess

Jens
-- 
Jens M. Felderhoff -- COSA Solutions GmbH

email: fe@cosa.de 		phone: +49-2238-9660711
home : j.m.f@netcologne.de	fido : 2:2454/95.10


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

Date: Mon, 20 Jul 1998 09:57:51 +0000
From: domo@tcp.ip.lu (Dominic Dunlop)
Subject: Re: compare arrays
Message-Id: <1dcgl3r.1phnkhx1dygi6aN@ppp82.vo.lu>

Stale thread, but WTH, I'll jump in anyway...

Craig Berry <cberry@cinenet.net> wrote in respose to a question from
Alberto Brosich <brosich@univ.trieste.it>:
> 
> : How can i compare two arrays other then with a loop?
> 
> Short answer: You can't do it without looping.

Umm, yes you can.  For a straight equality check of two arrays, @x and
@y, 

        "@x" eq "@y"

works fine -- provided that you consider the two arrays to be equal if
their joined stringified values are equal.  (You don't always: ('5.0',
'6.0', '7.0') is not equal to (5..7) with this test, although you might
consider that it should be.  To get the "right" answer here, you must
code a loop which compares pairs of elements numerically.)

With similar caveats, any string comparison operator can be applied
between "@x" and "@x".

Efficiency is another issue: perl stringifies very fast, but it's not a
cheap operation, either in terms of CPU cycles or memory usage.  If the
arrays you're comparing are large, but are likely to differ in early
elements when unequal, a loop will be much more efficient than
stringifying.

One other thing: string comparison may slow down if "use locale" is in
effect: if your script needs "use locale", put the check in a "no
locale" block for speed.

(Sorry, no benchmark data for any of this: anybody feel like filling the
void?)
-- 
Dominic Dunlop


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

Date: Mon, 20 Jul 1998 09:34:50 +0100
From: "D F" <dfisher@adc.metrica.co.uk>
Subject: Compile problem on AIX 4.1 .. sh ./makedepend
Message-Id: <900923524.23756.0.nnrp-03.c246a746@news.demon.co.uk>


I'm having problems compiling perl on AIX 4.1, the command sh ./make isn't
working, all I get is make depend MAKEDEPEND=

Very urgent, help please!!

D.




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

Date: Mon, 20 Jul 1998 11:43:05 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Compile problem on AIX 4.1 .. sh ./makedepend
Message-Id: <35b326b7.261212964@news.mmc.org>

[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]

On Mon, 20 Jul 1998 09:34:50 +0100, "D F" <dfisher@adc.metrica.co.uk> wrote:

>
>I'm having problems compiling perl on AIX 4.1, the command sh ./make isn't
>working, all I get is make depend MAKEDEPEND=

Wow. Where did you find that syntax?

>Very urgent, help please!!

If you follow the instructions in the ./INSTALL file, you shouldn't have
anything like the above.

In a nutshell:

$ gunzip -c latest.tar.gz | tar xf -
$ cd 5.004_04 (assuming 5.004_04 release, of course)
$ make realclean (only useful if previous failed 'make' attempts)
$ bsh ./Configure (or ./configure, which uses defaults for all the answers)
$ make
$ make test
$ make install

This will normally work pretty painlessly if your AIX system is up to snuff.
Since IBM unbundled the C compiler after AIX 3.2.5, you'll obviously need to
make sure you've either purchased and installed xlC, or downloaded and
installed gcc or egcs from one of the AIX freeware web sites (www-frec.bull.com
is quite comprehensive and up-to-date). You'll also need to make sure you've
installed bos.adt.* and bos.compat.* from the AIX 4.1 installation media.

Finally, if you're compiling with gcc or egcs, you may need to explicitly tell
Configure/configure that you're doing so with the command-line option -Dcc=gcc.

Good Luck!
-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Mon, 20 Jul 1998 00:48:37 -0400
From: Jorge Kinoshita <jkinoshi@pcs.usp.br>
Subject: converting html to latex using Perl.
Message-Id: <35B2CC24.D637AFBD@pcs.usp.br>

Hello everybody,
    I would like to know if exists a program that converts html to latex
(and/or vice-versa), free of charge , and in Perl by preference.
    Thanks for any help.
            Jorge K.
ps: if possible, cc -me the answer.




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

Date: 20 Jul 1998 12:10:30 GMT
From: yroh <yroh@samsung.co.kr>
Subject: Help!!: using foreach in 2 Dimension Hash...
Message-Id: <6ovc3m$msn$1@news.att.co.kr>

See below code...

$B{"QQQ"}{"QE"} = 11.23;
$B{"QQQ"}{"QR"} = 33.33;
$B{"AAA"}{"AW"} = 23.1;
$B{"AAA"}{"AE"} = 23.2;
$B{"AAA"}{"AR"} = 23.3;

foreach $i (keys %B) {
	foreach $j (keys %B{"$i"} ) {
	.....
	}
}

It has syntax error...
How do I look up values from 2 dim hash???
Please Help me!!!!

Thanks.



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

Date: Mon, 20 Jul 1998 12:43:58 +0000
From: Prof C Graham <grahamc@phsc.unp.ac.za>
Subject: How to connect to a socket ?
Message-Id: <35B32D7E.149B@phsc.unp.ac.za>

Hi!

How do you use "socket" to open a socket correctly, and then read from
or write to it?  Here is the code we have been using :

-----------------------
#!/usr/bin/perl

socket (SOCK, PF_INET, SOCK_STREAM, TCP) || die "socket: $!";
bind (SOCK, 'localhost') || die "bind: $!";
connect (SOCK, 'localhost') || die "connect: $!";
-----------------------
 It crashes with this error message:
socket: Protocol not supported at ./testsock.pl line 3.

We have tried using getprotobyname in various forms instead of "TCP" but
nothing seems to work.  We have also looked through socket.ph and the
man pages without success.

Could someone please explain to us how to use "socket" properly?  Thanks
in advance!

Alex and Karsten
Email return address :  harding@roger.phy.unp.ac.za


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

Date: 20 Jul 1998 12:18:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to connect to a socket ?
Message-Id: <6ovcjc$kcc$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, grahamc@phsc.unp.ac.za writes:
:How do you use "socket" to open a socket correctly, and then read from
:or write to it?  Here is the code we have been using :
:
:-----------------------
:#!/usr/bin/perl
:socket (SOCK, PF_INET, SOCK_STREAM, TCP) || die "socket: $!";
:bind (SOCK, 'localhost') || die "bind: $!";
:connect (SOCK, 'localhost') || die "connect: $!";
:-----------------------
: It crashes with this error message:
:socket: Protocol not supported at ./testsock.pl line 3.

You didn't use the strict pragma.
You didn't use the Socket module.
You didn't use the -w flag.

And I don't think you read the perlipc(1) manpage,
which answers this question in exhaustive detail.

--tom
-- 
	    "Perl is to sed as C is to assembly language."  -me


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

Date: 20 Jul 1998 12:16:27 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: How to connect to a socket ?
Message-Id: <900937574.383317@thrush.omix.com>

[posted & mailed]


Prof C Graham <grahamc@phsc.unp.ac.za> wrote:
: How do you use "socket" to open a socket correctly, and then read from
: or write to it?  Here is the code we have been using :
	>snip<

	Take a look at the perlipc manpage, as well as the IO::Socket
	module, which can make socket programming much more abstracted
	and simpler then the raw perl interface can.  Lots of great
	example code in both, much if not all of which is easily cut
	and pasted into your own apps verbatim.

-- 
-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: Mon, 20 Jul 1998 13:12:22 +0200
From: "joe" <joe@rhein.to>
Subject: HTTP::Request not requesting
Message-Id: <6ov8ik$5k4$1@usenet36.supernews.com>

hey,

Can anyone give me a hint why this is not posting this... $r gets the value
" HTTP::Request=HASH(0x813e9ac) "

Thanks
Joe

#!/usr/bin/perl -w
use HTTP::Request::Common;
use diagnostics;
use strict;
my($r);
print "start\n";
$r= new HTTP::Request POST 'http://www.siteshack.com/add.phtml', [title =>
'dafhjskdllll', url => 'http://www.asdffh.com', email => 'joe@rhein.to',
descrp => 'zuwehja', key => 'jaskd', pass => 'test'];
print "ok";




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

Date: 20 Jul 1998 08:08:14 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: join and warnings on undef values
Message-Id: <900922681.785786@thrush.omix.com>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
	>snip<
: Perhaps it's a bug in dbi/dbd that it returns undef instead of the null
: string for null fields...

	No, it's not.  Most databases make a clear distinction between
	undef and a null length string.  Undef is the cleanest way to
	pass that info into Perl land.  Null length strings will be returned
	as such.  If you want to convert real nulls to null length strings
	without a warning, it's quite easy:

		for (@row) { $_='' if !defined }

-- 
-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: 20 Jul 1998 12:33:54 GMT
From: bakki@ncinter.net (bakki kudva)
Subject: Re: locale setting under Linux
Message-Id: <6ovdfi$ali$1@news12.ispnews.com>

>Hi,
>
>A newbie question. When I run Perl under Linux I get...
>
>perl: warning: Setting locale failed.
>perl: warning: Please check that your locale settings:
>        LC_ALL = (unset),
>        LANG = "EN"
>    are supported and installed on your system.
>perl: warning: Falling back to the standard locale ("C").
>
>I have read the locale man pages and the perllocale pages etc but still at a 
>loss what exactly I need to do. Do I set these variables in my .bashrc? How do 
>I set the LC_ALL and LANG settings?
>
>Any help will be greatly appreciated
>
>-Bakki
>

A bit further investigation revealed..

When I type locale at the command line I do see that all the locale variables 
exist and are set to the proper values.
For example...
LC_ALL = 
LANG = "EN"

locale -a gives me a long list of locales. So it appears that I do have locales 
setup correctly. Now the question is why is perl having trouble making the 
setlocale() call. Is there a clib incompatibility? Please help!

-bakki



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

Date: Mon, 20 Jul 1998 14:33:42 +0200
From: "Koen Van den Bergh" <koen.vandenbergh@a1.tminet.net>
Subject: making a (perl)* database ...??
Message-Id: <1444AC8765DFD111B76B00805FAF707A8EB3E9@news.acil.tminet.net>

Hello all,
i'm wondering what would be the best, easiest, and most easy to manage
database system. I'll give a short description what we are doing at the
moment:
I have to maintain a list with b-be numbers (just a number we give in the
compagny to trace items). The list contains serial numbers, product id's,
billing information, suppliers,...  For the moment we do that in excell, but
the file is a little big, and doesn't give a proper and easy overvieuw.
If some item is shipped from one site to another, we make up an tranfer form
to give to the various departments (just a sheet of paper, no software copy
is used in any way)

This is what i would like to do instead:
I would like to set up a database with perl programming (search engines,...)
and eventualy a web interface (if necesary, not defined yet).
It would be very nice if i could easily enter a new item shipped to us
(assing a B-BE number), if it would be possible to trace an item (see a
little overvieuw of the wearabouts of the item, according to the transfer
forms, ....

I working on a Wincrash machine, but if necesary i can switch to a linux
machine (if verry necesary). A user interface in Acces seems to be easy as
wel.

Can anyone inform me about what type of structure, programming,... to use?
Can i stick with the excell file (or make a txt, csv,.. of it) if the file
is about 2Mb (800K in txt :)  All the programming will be done by me, but i
have to make sure that anyone is able to put in the data and trace the
items...

Thanks in advice!!
Koen Van den Bergh





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

Date: 20 Jul 1998 08:12:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Beautifier Home Page
Message-Id: <6ouu65$8mv$1@client3.news.psi.net>

Zenin (zenin@bawdycaste.org) wrote on MDCCLXXXIV September MCMXCIII in
<URL: news:900906331.646167@thrush.omix.com>:
++ Abigail <abigail@fnx.com> wrote:
++ 	>snip<
++ : I tend to use:
++ : ($VERSION) = '$Revision: 1.2 $' =~ /([\d.]+)/;
++ 
++ 	This limits you to a maximum of 10 minor revision numbers
++ 	before it causes serious problems.
++ 
++ 	If you don't check in your code often, this works fine.  But if you
++ 	do then you'll need something that can at least get you past the
++ 	1.9 to 1.10 step or perl will think you just jumped back quite a
++ 	few revisions.	Thus, if 1.2 is installed, and a program asks for
++ 	1.10 perl will not complain.  Similarly, if the program asks for
++ 	1.9 and 1.10 is installed, perl will complain incorrectly.

Am I missing something?

($VERSION) = '$Revision: 1.9 $' =~ /([\d.]+)/;     print $VERSION, "\n";
($VERSION) = '$Revision: 1.10 $' =~ /([\d.]+)/;    print $VERSION, "\n";
($VERSION) = '$Revision: 1.1.1.1 $' =~ /([\d.]+)/; print $VERSION, "\n";

prints

1.9
1.10
1.1.1.1


Or are you suggesting Exporter can't deal with such numbers correctly?

In that case, fixing Exporter is the appropriate action, coding around
bugs seldom is correct.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 20 Jul 1998 01:17:51 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl Beautifier Home Page
Message-Id: <m3ww99szps.fsf@windlord.Stanford.EDU>

Abigail <abigail@fnx.com> writes:

> Am I missing something?

> ($VERSION) = '$Revision: 1.9 $' =~ /([\d.]+)/;     print $VERSION, "\n";
> ($VERSION) = '$Revision: 1.10 $' =~ /([\d.]+)/;    print $VERSION, "\n";
> ($VERSION) = '$Revision: 1.1.1.1 $' =~ /([\d.]+)/; print $VERSION, "\n";

> prints

> 1.9
> 1.10
> 1.1.1.1

> Or are you suggesting Exporter can't deal with such numbers correctly?

Exporter treats numbers as numbers, and sorts them in numerical order.  It
will quite correctly decide that 1.10 < 1.9, because it is.  I suppose one
could argue that Exporter really *should* use RCS version sort order
rather than numerical sort order, but the latter is honestly simpler.
Therefore most of us who use RCS versions have tricks to convert them into
something that sorts correctly mathematically.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 20 Jul 1998 09:41:39 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl Beautifier Home Page
Message-Id: <900928286.838979@thrush.omix.com>

Abigail <abigail@fnx.com> wrote:
	>snip<
: Am I missing something?
:
: ($VERSION) = '$Revision: 1.9 $' =~ /([\d.]+)/;     print $VERSION, "\n";
: ($VERSION) = '$Revision: 1.10 $' =~ /([\d.]+)/;    print $VERSION, "\n";
: ($VERSION) = '$Revision: 1.1.1.1 $' =~ /([\d.]+)/; print $VERSION, "\n";
: prints
: 1.9
: 1.10
: 1.1.1.1

	1.9 is mathematically greater then 1.10, so this won't work.

: Or are you suggesting Exporter can't deal with such numbers correctly?
:
: In that case, fixing Exporter is the appropriate action, coding around
: bugs seldom is correct.

	This isn't an Exporter problem, it's UNIVERSAL::VERSION() that
	does the version check when someone calls.  Exporter never sees
	the version number when a module is loaded like this:

		use Foo 1.9;

	You can override the VERSION() method of course, but to make it
	useful the user must quote the version:

		use Foo '1.10';

	This is because before VERSION() gets it, perl does.  If it's
	a bare number it has already been optimized to a float (the trailing
	'0' removed) before it ever gets passed to VERSION().  The only
	way to "fix" this would be to special case "use Foo 1.10" to be
	parsed as "use Foo '1.10'" implicitly in the tokenizer.  Even then
	you'd still need to override VERSION() to handle this correctly.

	Most of us that use RCS have found it easier to just zero pad
	our minor revision numbers and remove all extra decimal points
	to make it VERSION Happy.

-- 
-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: 20 Jul 1998 09:45:23 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl Beautifier Home Page
Message-Id: <900928511.181531@thrush.omix.com>

Zenin <zenin@bawdycaste.org> wrote:
: Abigail <abigail@fnx.com> wrote:
: : 1.10
: : 1.1.1.1
: 	1.9 is mathematically greater then 1.10, so this won't work.

	I forgot to mention, 1.10 and 1.1.1.1 both look like 1.1 to Perl.

-- 
-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: Mon, 20 Jul 1998 11:02:51 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl Beautifier Home Page
Message-Id: <35b51b75.8733020@news.tornado.be>

Eli the Bearded wrote:

>I could have the comment text indented to match the code.

>I like one or two column indentation. It works.

Only if you use a fixed pitch font. I don't.

	Bart.


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

Date: 20 Jul 1998 11:02:02 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl Beautifier Home Page
Message-Id: <900933109.706019@thrush.omix.com>

Bart Lateur <bart.mediamind@tornado.be> wrote:
: Only if you use a fixed pitch font. I don't.

	...you're kidding, right? I didn't see a smily, so I though I'd
	ask.

	Fixed width fonts for coding are more common sense then anything
	else.  I don't think I've even seen an code editor that supported
	variable width fonts at all, for good reason.
-- 
-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: 20 Jul 1998 12:10:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Beautifier Home Page
Message-Id: <6ovc3h$kcc$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Zenin <zenin@bawdycaste.org> writes:
:: 	1.9 is mathematically greater then 1.10, so this won't work.
:	I forgot to mention, 1.10 and 1.1.1.1 both look like 1.1 to Perl.

    DB<1> print 1.1.1.1
    1.11.1
    DB<2> print 1.1.1.1 + 0
    1.11

-t-om
-- 
The correct way of pronouncing (well, spelling) the name of LA is
"La Ciudad de nuestra Sen~ora la Reina de los A'ngeles de Porciu'ncula".
                    Good luck. :-)


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

Date: Mon, 20 Jul 1998 07:17:40 -0500
From: "Andrew Ward" <adward@nortel.com>
Subject: Re: Perl Beautifier Home Page
Message-Id: <6ovcit$kb5@nrtphc11.bnr.ca>


Tim Maher wrote in message <35B05FE9.AC8A3717@halcyon.com>...
>Andrew Ward wrote:
>
>> Maybe I'm evil for doing this, but it turned
>
>Yes, you are  . . .
>
>> split(/;/);
>>
>> into
>>
>> split(/;
>>                                             /);
>>
>> which is noticeably wrong.  I also tried
>>
>> split(/\;/);
>>
>> which didn't help.
>
>If you had left out the () in the first place, and inserted a space after
>split,
>all would have been fine.

I tried
   split /;/;
-and-
   split /;/ ;
-and-
   split /\;/;

and the beautifier returned two lines on every one.  I was unable to keep it
from breaking the line.  Am I missing something?

-----------------
Andrew Ward
Northern Telecom
adward@nortel.com




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

Date: 20 Jul 1998 05:32:12 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl Beautifier Home Page
Message-Id: <m3n2a4r9df.fsf@windlord.Stanford.EDU>

Tom Christiansen <tchrist@mox.perl.com> writes:

>     DB<1> print 1.1.1.1
>     1.11.1
>     DB<2> print 1.1.1.1 + 0
>     1.11

That's... um... weird.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Mon, 20 Jul 1998 08:57:40 +0100
From: "Clinton Gormley" <clint@netcomuk.co.ukXX>
Subject: Re: Perl commands in NT Q's:  (was Re: Win32 install prob--another idiot)
Message-Id: <6outa7$91a$1@taliesin.netcom.net.uk>

>1.  Do I need to have the trailing "?" when calling the script?  (eg
>http://www.xyz.com/scripts/test.pl?.)  Seems like it's not necessary.


Not necessary

>2.  Is there a equivalent "date" command under NT.
I've just used localtime without any problem -> extract the date from that.

>3.  What about "pwd"?  Any NT command line equivalent?
Don't know

>4.  Would like to use the date and time functions to create an unique
>number to build data file names.  Any easy way to grab these in NT?
With localtime or gmtime above.

Good luck

Clint





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

Date: Mon, 20 Jul 1998 07:23:55 -0500
From: "Mike Wesolowski" <mwesol@hacm.org>
Subject: Perl for IIS4
Message-Id: <6ovcle$ga8$1@news3.alpha.net>

Has anybody gotten I/O redirection working in Perl for IIS4 running on a NT
box?

I am having trouble passing webform data back to perl to process.  My
webform ask for info and I want to store that info in a file on the NT box
but it seems the the i/o direction isn't being passed back as the values are
null.

Can anyone help me out?

Thanks

Mike Wesolowski
Systems Admin
Milwaukee Housing Authority
mwesol@hacm.org





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

Date: Mon, 20 Jul 1998 08:42:46 -0400
From: Pat Gunn <pgunn01@ibm.net>
Subject: Re: Perl script to POP3
Message-Id: <35B33B46.4EB6@ibm.net>

Raymond Ip wrote:
> 
> Can I use Mail::POP3Client to check the status (Read or Unread) of each
> message ? and can I update the status (mark unread to read) ? If yes,
> how
> can I do ?
> 
> Best Regards
> 
> Raymond Ip

Most POP3 implementations lack any kind of flags on the server
that would let you do this, and so don't keep track of a read or
unread status. 

-- 
---------------------------------------------------
Pat Gunn, moderator:comp.sys.newton.announce
comoderator:comp.os.os2.moderated
"You can always judge a man by the quality of his enemies." -- Dr Who
http://junior.apk.net/~qc
------------------------------------------------


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

Date: Mon, 20 Jul 1998 09:47:52 GMT
From: dan@nospam.org
Subject: Regex: operand could be empty
Message-Id: <35b311ff.13629015@news2.nyct.net>

Hi,

I'm string to read in a text file, and split it into paragraphs - i.e.
text separated by one or more blank lines.

Here's a quick test program I wrote:

#!/usr/local/bin/perl

#
# Test of splitting input file by one or more blank lines
#

$i=0; @para=();
undef $/;	# so files are read in as one string

open (IN, "<splitlines.dat") or die "Can't open splitlines.dat: $!\n";

@para = split(/(^\s*$)+/mg, <IN>);

foreach $x (@para) {
	print "(", ++$i, ")\n$x\n";
}

close (IN);
exit;

Depending on the version of Perl I use, I get either of these two
errors on: @para = split(/(^\s*$)+/mg, <IN>);

/(^\s*$)+/: regexp *+ operand could be empty at ./splitlines.pl line
12. 

(^\s*$)+ matches null string many times at ./splitlines.pl line 12.

It compiles if I leave out the +, but then it doesn't treat two or
more consecutive blank lines as a single paragraph separator, which is
what I want it to do.

Can anyone tell me the correct regex I should use?

Thanks.



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

Date: Mon, 20 Jul 1998 02:58:27 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: return values for $^O
Message-Id: <6oupob$fjl$1@holly.prod.itd.earthlink.net>

could anyone out there tell me, in particular, the $^O values for operating
systems that use \r\n as record separators such as NT.  i'm on linux, so
that is the only $^O that i can see.

thanks much,

brent



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

Date: Mon, 20 Jul 1998 12:57:04 +0000
From: me <nospam@nospam.com>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: sub's and rsh rlogin
Message-Id: <35B33EA0.69A7BB9E@nospam.com>

Thanks for the quick and very helpful response Martien.

> Please, set up your news reader correclty, so that it wraps lines at a
> reasonable length.

Sorry about the non-wraped lines, I'm using Netscape and I don't know
how to set the default "word wrap" variable.  But I'll look into it.


> This is a question about rsh, not about perl. Please consult your
> local rsh and rlogin documentation. (did you set up a .rhosts file?)

Figured out the .rhosts after I sent the message.  I looked into before
I sent the message, the answer just didn't seem to be there at the time.

I'll look into your suggestions.

Thanks again!


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

Date: Mon, 20 Jul 1998 12:19:59 GMT
From: "Greg" <gking@c-com.net>
Subject: SysLogScan::SendmailLineTo
Message-Id: <PBGs1.2$K4.126931@news.giganews.com>

I am having trouble getting the following to work and was wondering if
anyone had some sample code (there wasnt much in the Perl Ref guid, just the
description)

I would like to parse the maillog file for only entries in relation to
SendmailLineTo using SysLogScan (if I can get that working, I can do the
from ones as well).

The following code handles a single syslogentry, but I need to be able to
differentiate from and to lines, how do I do that? :

thnks, Greg King (gking@c-com.net)

#!/usr/local/bin/perl

use SyslogScan::SyslogEntry;

open (FH,"maillog.7");

my $entry;

while ($entry = new SyslogScan::SyslogEntry (\*FH))
{
    #do something
}




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

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

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