[8348] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1965 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 24 15:13:26 1998

Date: Tue, 24 Feb 98 12:00:29 -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           Tue, 24 Feb 1998     Volume: 8 Number: 1965

Today's topics:
    Re: <META HTTP-EQUIV="Refresh: QUESTION (at)dciem.dnd.ca (A. P. Beaudoin)
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <keithmur@mindspring.com>
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et (Craig Keefner)
        calling C++ from Perl <bg250@city.ac.uk>
    Re: calling C++ from Perl (Nathan V. Patwardhan)
    Re: calling C++ from Perl uri@sysarch.com
    Re: Can't find label "START"--aborting at (Joe McMahon)
    Re: Database Recommendation Anyone? <zenin@best.com>
    Re: errors compiling sybperl 2.07 mpeppler@mbay.net
    Re: factorial function? (Andy Lester)
        Finding logical cwd vs physical cwd (Albert W. Dorrington)
        freshly installed perl...now it won't run (MICHELLE MARIE HANKINS)
        Graphic manipulation with GD.pm <lkl@mail.oph.rwth-aachen.de>
    Re: Graphic manipulation with GD.pm (Nathan V. Patwardhan)
    Re: HELP Please - DLL Function <zenin@best.com>
    Re: help with matching strings (Joe McMahon)
        HELP: Modules load as root, not user. (Adam Donahue)
    Re: Home Page Click. (Andy Lester)
    Re: How can i add users to the passwd file in unix with (Brett Slocum)
        HP-UX compile failure <mcevoy@pubtool.com>
    Re: musings on autoincrement <dboorstein@shopcfn.com>
    Re: musings on autoincrement (Kevin B Cohen)
        Perl & Sockets <hsommer@micro.ti.com>
    Re: Perl & Sockets (Nathan V. Patwardhan)
        Perl5.004 and DBM on HPUX 9.05 and 10.2 <andrewm@sdl.ug.eds.com>
    Re: Phantom Write Operation (Nathan V. Patwardhan)
        Please Help: File search with wildcarded filenames (Jay Yang)
    Re: split and push (Joe McMahon)
    Re: String Extraction and checkup (Craig Berry)
        ts: double vs single quotes tsatan@hotmail.com
        ts: multiple keys for same value? tsatan@hotmail.com
        ts: ts: how to parse embedded commas tsatan@hotmail.com
    Re: why no Case statment? (Michael J Gebis)
    Re: why no Case statment? <doug@weboneinc.com>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl lvirden@cas.org
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 24 Feb 1998 18:37:09 GMT
From: my.addy.is@abeaudoi(at)dciem.dnd.ca (A. P. Beaudoin)
Subject: Re: <META HTTP-EQUIV="Refresh: QUESTION
Message-Id: <34f312bd.19341788@news.drenet.dnd.ca>

On 9 Feb 98 00:24:34 GMT, "Charles Wilkins" <thehelm@ibm.net> wrote:


>Is there an equivalent to <META HTTP-EQUIV="Refresh"
>Content="10;URL=http://www.anywhere.com"> that
>will work in the perl script.

for(;;)
{
	sleep(10);
	print "Location:http://www.anywhere.com\n\n";
}


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

Date: Tue, 24 Feb 1998 12:49:43 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <34F31647.2A2D733A@mindspring.com>

John Porter wrote:
> 
> Bart Lateur wrote:
> >
> > Why not create a censored version. Something like
> >
> >         RT*M
> 
> Sometimes * (star) is used to mean "*ssh*le", so you would
> still have a good acronym: Read The *ssh*le Manual.
> 
Shouldn't those last two words be reversed?  :-)


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

Date: Tue, 24 Feb 1998 19:11:39 GMT
From: keefner@kinetic.com (Craig Keefner)
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <34f3174a.3929920@news.visi.com>

On 23 Feb 1998 00:57:08 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, Richard Caley <spt@cstr.ed.ac.uk> writes:
>:Well, I suppose if the FSF ...
>
>And we all remember what "FSF" *really* stands for, right? :-)
>
>--tom
>-- 
>	Tom Christiansen	tchrist@jhereg.perl.com


Hi Mr. Christiansen...

I keep seeing posts from people asking for help
and then the range of responses they get etc..

It's no doubt been suggested before but why not
have a separate area under perl.com where  the newsgroup
postings are stripped out and savedin an index and used
in conjunction with a customizable search engine.
Is there an AI engine that could be used?
Almost another site could be considered...
I'm glad Dejanews is around but its not the answer.

FAQs make a lot of sense to people who understand
but they aren't the people needing help much of the
time. They are useful but not an end all. 

Being a neophyte myself at perl, I confess that 
I can understand the idiots most of the time better
than the supersharp gurus. Understanding them
makes it a lot easier to understand the guru's
response.

Thanks for everything you do with Perl!

Regards

Craig




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

Date: Tue, 24 Feb 1998 17:09:11 +0000
From: Locatelli A <bg250@city.ac.uk>
Subject: calling C++ from Perl
Message-Id: <34F2FEB7.2CEA@city.ac.uk>

Hi all I have got this problem:

I am trying to call a C++ program from a perl script and want to use the
output of this program in the script.
I use the following statement to call the program and catch its output:

$whatever = `programpath | parameters`;

What I can`t do is :

1) use values stored in perl variables as parameters to call the C++
programs (don`t know     how to bring them into the above statement)

2) Catching the output of the C++ program in a different way then
through its standard        output --> If I make the C++ program return
some values I don`t get them, it works only   if I send them to std
output.

 Any help is appreciated 

thanks

Andrea Locatelli

       bg250@city.ac.uk


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

Date: 24 Feb 1998 17:54:29 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: calling C++ from Perl
Message-Id: <6cv1gl$mfk@fridge.shore.net>

Locatelli A (bg250@city.ac.uk) wrote:

: I am trying to call a C++ program from a perl script and want to use the
: output of this program in the script.

You could always use C++ with XS.  I've just been working up some
examples based on Dean Rohrich's (sp?) XS tutorial; these examples let
you call Class::function from a Perl script.  Therefore, you don't
have to employ backticks, et al.  If you've got a compiler that's
supported by Perl (if you're on Win32) and a Perl that's bundled with
h2xs, then you should be able to make this work.

You can also find an example of this in Sriram's _Advanced Perl
Programming_ and the perlxs (NOT perlxstut) manpage.  And of course,
don't forget Dean's tutorial that's mentioned above; you can find it
in the authors area on CPAN.

--
Nathan V. Patwardhan



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

Date: 24 Feb 1998 13:09:23 -0500
From: uri@sysarch.com
Subject: Re: calling C++ from Perl
Message-Id: <x7g1l83mek.fsf@sysarch.com>

Locatelli A <bg250@city.ac.uk> writes:

> Hi all I have got this problem:
> 
> I am trying to call a C++ program from a perl script and want to use the
> output of this program in the script.
> I use the following statement to call the program and catch its output:
> 
> $whatever = `programpath | parameters`;
                           ^
what is the pipe for? programpath can't get parameters, rather it feeds
its stdout into the program parameters.

> 
> What I can`t do is :
> 
> 1) use values stored in perl variables as parameters to call the C++
> programs (don`t know     how to bring them into the above statement)

the string in the `` (backticks) is double-quotish like "" strings. you
can just build any string with perl variables and call it. 

> 2) Catching the output of the C++ program in a different way then
> through its standard        output --> If I make the C++ program return
> some values I don`t get them, it works only   if I send them to std
> output.

what do you mean by 'return some values'? is that the exit code? then
use $? after the backticks. otherwise what other kind of output is there
other than files and stdout? how would you return values to any other
program or user? if they can get at the output, perl can (and so can any
other program).

hope this helps,

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Tue, 24 Feb 1998 13:38:34 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: Can't find label "START"--aborting at
Message-Id: <joe.mcmahon-2402981338340001@prtims.stx.com>

In article <jouI.1$le6.48850@news.sgi.net>, testwv@wv.usaor.net (Mark
Kogan) wrote:

>I am getting a problem when I move a working perl program to another server 
>(both are bsdi), when I run the program, labels inside subroutines are not 
>seen, here is an example:  Can't find label "START"--aborting at (filename), 
>even after I rewrote it to not call labels, it still opens files within 
>subroutines, and then gets an error when trying to use the filehandle, so it 
>is a larger problem,  Does anyone know anything which will solve this problem, 
>it seems like a path issue, and I would like to avoid reinstalling perl, 
>because I don't have easy access to the server.
>
Show Us The Code. We can't tell if it's your code or what from a
description like this. I think you may not have a concept or two right,
but I don't know for sure from this.

 --- Joe M.


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

Date: 24 Feb 1998 17:38:34 GMT
From: Zenin <zenin@best.com>
Subject: Re: Database Recommendation Anyone?
Message-Id: <888342150.926147@thrush.omix.com>

RDSchramm <schramm@one.net> wrote:
: There is a company called Intersolv that creates ODBC drivers from Unix.

	3k records?  It's probably overkill, but I do not know the full
	details either.

	Anyway, if you do want to go with DB_File, I think there is a binary
	distribution for Win32 hiding at:

	http://www-personal.umich.edu/~gsar/

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 24 Feb 1998 12:14:52 -0600
From: mpeppler@mbay.net
Subject: Re: errors compiling sybperl 2.07
Message-Id: <6cv2mr$uae$1@nnrp1.dejanews.com>

In article <01bd40a0$86b07c20$6b01a8c0@pperroud.interlog.com>,
  "Patrick Perroud" <pperroud@interlog.com> wrote:
>
> I've compiled and installed perl5.004_04-trial on a sun sparc running sunos
> 4.1.2.
> All works fine.
>
> I wanted to install sybperl 2.07 to acces my Sybase server running 4.0
> DBlib.
> During compile of the DBlib package I get errors indicating a type
> DBDATEREC is undefined.  I can't seem to locate this defn. anywhere and was
> wondering if someone might indicate where I'm going wrong.  Do I need to
> add this typedef to sybfront.h.
> The following is the errors encountered.

The problem is that I implemented some stuff that is not available in the
old version of DBlibrary that you are running.

Try getting sybperl 2.09 (from CPAN/authors/Michael_Peppler) and see if
that works - I added some #ifdefs for DBlibrary 4.0 in there.

Michael
--
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
International Sybase    -||-  http://www.isug.com
User Group

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 24 Feb 1998 18:25:26 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: factorial function?
Message-Id: <6cv3am$lvp$1@usenet48.supernews.com>

: Is there a recommended library to handle factorial implementations?

How many different implementations of factorials would you like?  

xoxo,
Andy

--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: 24 Feb 1998 14:27:19 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
Subject: Finding logical cwd vs physical cwd
Message-Id: <6cv6un$322@ws051eng.ictest.delcoelect.com>


Hi All,

	I am looking for a way to find the logical current
working directory instead of the physical working directory.

The easiest way I've found so far is to do something like:

$log_cwd = `ksh -c pwd`;

I was hoping there might be a better way to do this. Any
ideas?

I'm looking for a way to do this as I (and my users) would
rather see:
	/users/username
instead of:
	/tmp_mnt/users/username/username

Thanks!

- Al
-- 
Al Dorrington                                      
FIRMS & Web Admin, Oracle DBA                     Phone: 765-451-9655 
IC-DELCO CIM, Delphi Delco Electronics Systems    Fax:   765-451-8230 


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

Date: 24 Feb 1998 18:10:45 GMT
From: mmhankin@ouray.cudenver.edu (MICHELLE MARIE HANKINS)
Subject: freshly installed perl...now it won't run
Message-Id: <6cv2f5$iva$1@news.cudenver.edu>

I just installed perl 5.003 on my DEC Alpha (OSF/1).  Ran the configure
program & pretty much acccepted the defaults.  

The good news is that i have a man page.

The better news is that I have the Learning Perl camel book.

I'm very excited about this..

The bad news is that I put in the very first program in the very first
camel book, (the "Hello, World" thingy on page 5) and nothing happens.

Tried the one on page 7 and nothing.  My syntax is correct, tried sticking
white space in everywhere, nothing.  I must not have installed it correclty.
I type: perl at my ksh, and it hangs.  I type in print commands, and it will
tell me when I make an error mesage, but nothing happens when I don't.

Did I not install something right?  (Forgive me, I'm used to shell scripts
with immediate responses.)

Pls email me with response, as this newsreader is hellacious (and it's not
my system to toy with.)
--
Michelle Hankins,
realemail: michelle_hankins@polk.com  
playemail: mmhankin@ouray.cudenver.edu 

Trephination procedures should be a corporate benefit.


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

Date: Tue, 24 Feb 1998 18:33:37 +0100
From: "MIGHTY OWL" <lkl@mail.oph.rwth-aachen.de>
Subject: Graphic manipulation with GD.pm
Message-Id: <6cv0qo$37j$1@nets3.rz.RWTH-Aachen.DE>

Hello,

I need to work on some graphics with GD.pm and I've been trying in vain to
find some documentations/tuitorials on this module.

I would appreciate if anyone has any suggestions.

Thanks.






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

Date: 24 Feb 1998 17:56:02 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Graphic manipulation with GD.pm
Message-Id: <6cv1ji$mfk@fridge.shore.net>

MIGHTY OWL (lkl@mail.oph.rwth-aachen.de) wrote:

: I need to work on some graphics with GD.pm and I've been trying in vain to
: find some documentations/tuitorials on this module.

Have you read the POD that comes with GD?  Have you checked out
Boutell's site?  http://www.boutell.com/

--
Nathan V. Patwardhan



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

Date: 24 Feb 1998 17:16:38 GMT
From: Zenin <zenin@best.com>
Subject: Re: HELP Please - DLL Function
Message-Id: <888340835.136668@thrush.omix.com>

Matt Bieber <mattdb@syntrillium.com> wrote:
: I'm sure this question has been answered before, but I cannot find info
: anywhere. On one of our machines I'm using Perl for Win32 on NT and would
: like to call a function from a custom DLL. But I cannot find out how to do
: so. Does anyone know of a module or way of importing a function from a DLL
: in Perl?

	You'll probably have to wrap it in an xsub.  Check out the
	perlxstut, perlxs, and perlguts man pages.

	BTW, what are you trying to do?  It may already be done.

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 24 Feb 1998 13:41:06 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: help with matching strings
Message-Id: <joe.mcmahon-2402981341060001@prtims.stx.com>

In article <6cucmk$80g$1@m1.cs.man.ac.uk>, chiut5@cs.man.ac.uk wrote:

>Here is my code which is quite vague as I don't know the syntax properly:
>
Could you tell us what you think you want to do first? It's hard to debug
code that isn't functioning right when you don't know what right
functioning *is*.

 --- Joe M.


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

Date: 24 Feb 1998 17:03:35 GMT
From: donahue@acf2.nyu.edu (Adam Donahue)
Subject: HELP: Modules load as root, not user.
Message-Id: <6cuuh7$b17$1@news.nyu.edu>

Hi,

I'm having a problem running various modules as a regular user, but they
run fine as superuser.  For example:

If I run this trivial Perl script:

#!/usr/bin/perl
use GD;

as root, it does what it's supposed to.  (Well, assume I actually make an
image using the GD functions.)  However, if I run it as a regular user, I
get an error:

Can't locate loadable object for module GD in @INC (@INC contains:
/usr/local/lib/perl5/sun4-solaris/5.00404 /usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/sun4-solaris/usr/local/lib/perl5/site_perl .) at - line 1
BEGIN failed--compilation aborted at - line 1.

Now, I thought it might be the root path, but @INC is the same for both
root and the regular user.  I usually "su" and then "csh; source ~/.cshrc"
to load my defaults anyhow.  But I've made sure that any environment
variables in the root account are present in the user account.  So I
thought it might be a wacky permissions setting.  But as far as I can
tell, the permissions line up for both root and other users.  (root has
write access to various Perl directories, but usually all three classes 
either have r access or rx access.)

Anyhow, I'm stumped.  How do I fix this?  It's not just GD;  it's
happening with other modules as well.  And it's always in loading an
object module, not the module itself.  (That would result in a different
error.)

Any ideas?

Thanks,
Adam



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

Date: 24 Feb 1998 18:37:33 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Home Page Click.
Message-Id: <6cv41d$lvp$3@usenet48.supernews.com>

: Does anyone know how to add an element to a page so that when the user
: clicks on it, it becomes their home page?

1) You can't.

2) Your question has nothing to do with Perl.

xoxo,
Andy








--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Tue, 24 Feb 1998 17:10:26 GMT
From: slocum@io.NOSPAM.com (Brett Slocum)
Subject: Re: How can i add users to the passwd file in unix with Perl?
Message-Id: <34f2fed7.955694595@news.io.com>

On 23 Feb 1998 00:30:37 GMT, mgjv@comdyn.com.au (Martien Verbruggen)
wrote:

>In article <eK$cKh#P9GA.267@upnetnews03>,
>	"Hagen" <insel@msn.com> writes:
>> How can i add users to the passwd file in unix?
>
>Open up the file in your favourite editor, and add a line. Or, use one
>of your system specific admin tools. Or go and ask on a unix group.
>This has nothing to do with perl.

Actually, if you read the Subject header, he wants to know how to do
this in Perl.

Brett Slocum, slocum AT io DOT com, unSPAM address to reply
http://www.io.com/~slocum/
Tekumel Home Page: www.io.com/~slocum/tekumel.html
GURPS Home Page: www.io.com/~slocum/gurps.html


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

Date: 24 Feb 1998 12:34:57 -0600
From: Micheal Mc Evoy <mcevoy@pubtool.com>
Subject: HP-UX compile failure
Message-Id: <m3zpjgrgvi.fsf@mcevoy.pubtool.com>

I'm trying to build perl 5.004_04 on a HP-UX 10.20 server, using the same 
source as I used to build it on a Linux box and on an AIX server.

I get the following output from make:

# make
        `sh  cflags libperl.a miniperlmain.o`  miniperlmain.c
          CCCMD =  gcc -DPERL_CORE -c -D_HPUX_SOURCE -O   
as: "/var/tmp/cca06179.s", line 93: error 1052: Directive name not recognized - PARAM
*** Error exit code 1
Stop.

Configure worked and didn't show any problems, make depend also worked with no
errors or problems.

Anyone have any ideas ?

Slan,
  Micheal
-- 
Micheal Mc Evoy Webmaster/DBA
email: mcevoy@artville.com 
voice: 608.243.5927


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

Date: Tue, 24 Feb 1998 12:09:45 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: musings on autoincrement
Message-Id: <34F2FED9.69E70402@shopcfn.com>

Kevin B Cohen wrote:

[snip]

> this is not a complaint---rather, an observation.  in the past i have
> been very happy to take advantage of perl's laid-back attitude towards
> accepting character-containing strings and treating them like numbers.
> (for instance, in perl you can have a scalar containing something like
> 
>      $scalar = "5-year-old male asthmatic"
> 
> and if you then evaluate it in a conditional, e.g.
> 
>    if ($scalar < 18) { $age = "pediatric"}
>    elsif ($scalar >= 18) {$age = "adult"}
> 
> you'll get the Right Thing, i.e. $age = adult.)

well, i get 'pediatric' from this example, but not after a warning:
  
  Argument "5-year-old male asthmatic" isn't numeric in lt at...

which, in general, means that i would not use this method. though
i do take advantage of these subtleties in quickie one-off scripts;
for something that i intend to revisit, or pass along to someone
else, i try to be a bit more traditional, or at least more explicit.

out of curiosity, why does the above code (once compilable) only 
generate a single warning (for 'lt' but not 'ge')? can only a single
comparison operator warn at any given time?

thanks,

-- 
dan boorstein <dboorstein@shopcfn.com>


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

Date: 24 Feb 1998 13:35:00 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: Re: musings on autoincrement
Message-Id: <6cv3sk$mqi@julius.ling.ohio-state.edu>

In article <34F2FED9.69E70402@shopcfn.com>,
Dan Boorstein  <dboorstein@shopcfn.com> wrote:
>> and if you then evaluate it in a conditional, e.g.
>> 
>>    if ($scalar < 18) { $age = "pediatric"}
>>    elsif ($scalar >= 18) {$age = "adult"}
>> 
>> you'll get the Right Thing, i.e. $age = adult.)
>
>well, i get 'pediatric' from this example, but not after a warning:
>  
>  Argument "5-year-old male asthmatic" isn't numeric in lt at...

i've never gotten that warning.  maybe this is a difference between
unix (presumably yours) and win32 (my) implementations of perl?
that's my only guess.

>out of curiosity, why does the above code (once compilable) only 
>generate a single warning (for 'lt' but not 'ge')? can only a single
>comparison operator warn at any given time?


i would guess that this is because only one part of the conditional is
being reached?  does it act as if the first part is evaluating to T?

kevin





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

Date: Tue, 24 Feb 1998 10:58:06 -0600
From: Holly Sommer <hsommer@micro.ti.com>
Subject: Perl & Sockets
Message-Id: <34F2FC1E.A3F97B4C@micro.ti.com>

So, I know there are mods like LWP for sockets handling, but I was
wondering if perl is necessarily be most ideal choice in languages for a
fairly simple sockets-based program I am looking to set up.

The scenario is this:

I have an Ethernet connection, and am offering my machine to some
friends to use, for some things, remotely, if they need to. Primarily,
the machine resides in LinuxLand, but occasionally, I need to do some
work under the W95 partition (Photoshop and some other commercial s/w
that does not exist for Linux), and I wanted to provide my friends with
another means of knowing that the machine is in W95, aside from a
"Connection refused" message when they try to telnet in.

I figured the best way to go would be some little server listening on
port 23, and sending a message to anything attempting to connect there
that "This machine is currently in Windows 95, please try later." Fairly
simple, and I have the choice of a couple different languages, so
thought I'd ask the advice of those here, as to whether y'all think perl
would be the "best" choice for this (obviously, it is suitable, since it
supports sockets).

-Holly, uses whatever OS is needed at the time


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

Date: 24 Feb 1998 18:01:21 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl & Sockets
Message-Id: <6cv1th$mfk@fridge.shore.net>

Holly Sommer (hsommer@micro.ti.com) wrote:
: So, I know there are mods like LWP for sockets handling, but I was
: wondering if perl is necessarily be most ideal choice in languages for a

Yes, Perl can do this job for you nicely.

--
Nathan V. Patwardhan


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

Date: Tue, 24 Feb 1998 19:00:59 +0000
From: Andrew Maguire <andrewm@sdl.ug.eds.com>
Subject: Perl5.004 and DBM on HPUX 9.05 and 10.2
Message-Id: <34F318EA.3700@sdl.ug.eds.com>

I have been trying to build perl5.004_4 on HPUX.
My only stumbling block has been getting the DBM file support working
on both HPUX 9.05 and 10.2.

 I have tried building perl under 9.05 with each of GDBM, NDBM 
or ODBM support. However the dbm file only seems to read back in
correctly, on the OS version it was created under.

The database file must contain several hundred keys to provoke this.

Other than specifying which modules you want loaded and which libraries
you want to build with are there any possible configuration
options that I may have missed?

Otherwise could someone point me in the direction of where
to look in the code or a patch if this has been spotted before.

Thanks for listening...
Andrew


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

Date: 24 Feb 1998 17:59:44 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Phantom Write Operation
Message-Id: <6cv1qg$mfk@fridge.shore.net>

Dale Chavez (dchavez@horizonint.com) wrote:

: I'm  using the following code to read variables from a form and then write
: them out to an ASCII file.  Everything works great, except that if the user

Homebrewing is okay if you're making your own beer, but not for stuff
like this.  ;-)

(1) You should be using CGI.pm.
(2) You should be posting to comp.infosystems.www.authoring.cgi

Followups set.

--
Nathan V. Patwardhan


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

Date: Tue, 24 Feb 1998 18:23:06 GMT
From: fihserman1234@hotmail.com (Jay Yang)
Subject: Please Help: File search with wildcarded filenames
Message-Id: <34f40c2b.5637373@news.supernews.com>

I am a newbie Perl user. The problem is about file search with
wildcarded filenames.  For example,
to search 'abc.*' in /home/1234/,

I tried

$name = 'abc.*';
@files = $name;

and it didn't work. I also tried 'glob' function but it may not be
supported in the UNIX system (Unix system V Release 4) I'm using.
However, it works on my Linux system by modifying as follows:

@files = glob ($name);

Is there any way to do it properly on Unix V R4? 

Thanks in Advance.

Jay


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

Date: Tue, 24 Feb 1998 13:01:06 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: split and push
Message-Id: <joe.mcmahon-2402981301060001@prtims.stx.com>

In article <34ED4C8B.4ECF@unibest.ru>, ok <ok@unibest.ru> wrote:

>There are two examples:
>
> 1) @a=split(/,/,"")
Split a null string on commas. Nothing results - not even a null string,
no items at all; nothing is assigned to @a, highest used index is no index
at all (nothing assigned to @a), so by definition, $#a = -1.
>
> 2) push @b,""
One item, a null string, is added to @b. Ergo, highest used index is 0, so
$#b = 0.
>
> Why $#a==-1 but $#b==0?
>
> P.S. I think, that in case 1) the result must be the same as in case
>2).
The results are definitely not the same. Reread the split documentation and
the $# documentation.

 --- Joe M.


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

Date: 22 Feb 1998 18:07:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: String Extraction and checkup
Message-Id: <6cppgp$ri6$1@marina.cinenet.net>

Glenn West (westxga@ptsc.slg.eds.com) wrote:
: Evert Smit wrote:
: > i am looking for a piece of perl script, that will look at a string, rip
: > it appart, check if it is 8 digits long and make sure that there are 2
: > numbers in it. I am sure someone has this one already and would be
: > eternally thankful, if i could use it.
: 
: I assume you mean at least 8 characters long and contains at least 2
: digits (password validation?):
: 
[snip]
:         if (! /^(\D*\d){2,}\D*$/) {                               

An easier way to test for two or more digits:

  if (tr/0-9// >= 2) {

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 24 Feb 1998 19:38:26 GMT
From: tsatan@hotmail.com
Subject: ts: double vs single quotes
Message-Id: <6cv7ji$o2h$1@orthanc.reference.com>

As a C programmer I am in the habit of using only double-quoted
strings in perl. Such strings are subject to variable interpolation
and backslash interpretation. Is there enough of a performance
penalty here that I should consider using single-quoted strings
by default?

--ts


  -------------------------------------------------------------------- 
  Posted using Reference.COM                  http://WWW.Reference.COM 
  FREE Usenet and Mailing list archive, directory and clipping service 
  -------------------------------------------------------------------- 


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

Date: 24 Feb 1998 19:51:51 GMT
From: tsatan@hotmail.com
Subject: ts: multiple keys for same value?
Message-Id: <6cv8cn$obf$1@orthanc.reference.com>

Is it possible in a DBM file to have more than one key per
value? Suppose you want to be able to key off of SSN or
driver's license number. Right now I have something like:
   $h{"D4902432"} = "222-22-2222";
   $h{"222-22-2222"} = "Simpson, Orenthal";

but this approach requires two lookups if the DL number is
used instead of the SSN:

   $id = $h{$id} if $id =~ /^D/;
   $name = $h{$id};

Does anyone have any better ideas? Is it possible to use
references in a DBM?
--ts


  -------------------------------------------------------------------- 
  Posted using Reference.COM                  http://WWW.Reference.COM 
  FREE Usenet and Mailing list archive, directory and clipping service 
  -------------------------------------------------------------------- 


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

Date: 24 Feb 1998 19:33:37 GMT
From: tsatan@hotmail.com
Subject: ts: ts: how to parse embedded commas
Message-Id: <6cv7ah$o1t$1@orthanc.reference.com>

>From the keyboard of Bryan Wilkinson <nardo@pobox.com>:
| >    $x= "var1,var2, sum(sum(i,j), sum(k, sum(l, m))) as var3";
|
| you should be able to do something like:
|
| while($x =~ s/sum\(([^()]*)\)/&sum($1)/e) {}
|
| sub sum
|  {
|    my ($v1, $v2) = split(/\s*,\s*/, $_[0]);
|    return $v1 + $v2;
|  }
Thanks for the info. Unfortunately there *are* other functions
besides "sum", possibly hundreds of them. I know I could change
the regex to \w+ but I decided to use an array reference instead (1 var per element). --ts


  -------------------------------------------------------------------- 
  Posted using Reference.COM                  http://WWW.Reference.COM 
  FREE Usenet and Mailing list archive, directory and clipping service 
  -------------------------------------------------------------------- 


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

Date: 24 Feb 1998 18:23:26 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: why no Case statment?
Message-Id: <6cv36u$gsu@mozo.cc.purdue.edu>

mgjv@comdyn.com.au (Martien Verbruggen) writes:

}In article <34F1B90F.5709@netvision.net.il>,
}	Tzadik Vanderhoof <stvhoof@netvision.net.il> writes:
}> Why doesn't Perl have a real Case statement? 

}The man pages say:
}	There is no official switch statement in Perl, because there
}	are already several ways to write the equivalent.

Hardly a convincing argument when Perl's motto is "There's more than
one way to do it." :)

}The perl FAQ (section 7) has this to say:

}	Briefly, there's no official case statement, because of the
}	variety of tests possible in Perl (numeric comparison,
}	string comparison, glob comparison, regexp matching,
}	overloaded comparisons, ...).  Larry couldn't decide how
}	best to do this, so he left it out, even though it's been on
}	the wish list since perl1.

How about requiring a block which describes the test (as in sort):
switch { $a == $b} {
	case 7:
	case 99:
}

switch { $a =~ m/$b/; } {
	case "hello" :
	case "goodbye":
	case "foo":
}

Of course, you have to define behaviour when more than one "case"
matches, but I'd say "the cases are tried in the order they appear".

}So, basically, it was too hard to implement without losing the
}flexibility, and it wasn't worth it, because there already was a
}satisfactory alternative :)

Of course, as you pointed out, you can pretty much whip this one up
yourself anyway, so it's not really that big of a gain.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Tue, 24 Feb 1998 14:12:19 -0500
From: Douglas Clifton <doug@weboneinc.com>
Subject: Re: why no Case statment?
Message-Id: <34F31B93.218E236A@weboneinc.com>

Randal Schwartz wrote:
> 
> >>>>> "Jarkko" == Jarkko Hietaniemi <jhi@alpha.hut.fi> writes:
> 
> Jarkko> If you can answer these questions, well, then you can write the
> Jarkko> if-elseif-else.
> 
> What's "elseif" ?

shouldn't that be ``elsif''

-- 
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer
doug@weboneinc.com

===================
Web One Inc.
Website Development
Phone: 888-699-WEB1
Phone: 616-552-9999
Fax:   616-552-9920
sales@weboneinc.com
www.weboneinc.com
===================


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

Date: 24 Feb 1998 18:47:55 GMT
From: lvirden@cas.org
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6cv4kr$dui$1@srv38s4u.cas.org>


According to Colin Dooley  <colin@medit3d.com>:
:In a billion years the Sun will explode and you won't need to

Hey - have they issued a hardware alert on that one?  Which specific
server or desktop machine - or do you mean all of them....




;-)

-- 
Larry W. Virden <URL:mailto:lvirden@cas.org> ICQ: 5744965
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

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

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