[10037] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3630 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 3 20:05:34 1998

Date: Thu, 3 Sep 98 17:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 3 Sep 1998     Volume: 8 Number: 3630

Today's topics:
    Re: Cookies? <estabroo@ispn.com>
        Denver/Boulder Perl Mongers cfedde@my-dejanews.com
        Does open() lock the file? smitzla@uswest.com
    Re: Does open() lock the file? (Craig Berry)
    Re: Does open() lock the file? <upsetter@ziplink.net>
    Re: Does open() lock the file? (Ilya Zakharevich)
    Re: Encryption & File Locking <eashton@bbnplanet.com>
    Re: HELP ! Compile/Link error for PERL on Solaris <eashton@bbnplanet.com>
    Re: How do you pass quotes to the command line? (Matthew Bafford)
    Re: How to remove the file's extention using perl (David A. Black)
    Re: In search of Intellegint Life... HELP!! <upsetter@ziplink.net>
    Re: In search of Intellegint Life... HELP!! (Larry Rosler)
    Re: Is perl millennium compliant ? (Craig Berry)
    Re: Is Perl5.004 Year 2000 compilant? <melinda@acm.org>
        ODBC DBD Module (Paul Mahoney)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (David Hawker)
    Re: PerlScript: reading/writing files? (Jonathan Stowe)
    Re: Polling a socket <aqumsieh@tigre.matrox.com>
    Re: problem evaluating hash using symbolic reference (Sean McAfee)
    Re: problem evaluating hash using symbolic reference (Andrew M. Langmead)
        Sorting a simple database list <INFO@ARKSON.COM>
    Re: Sorting a simple database list (Maurice Aubrey)
    Re: Sorting a simple database list (Larry Rosler)
        Trolls bitnut1@my-dejanews.com
        UN-INSTALLING Perl: How can I un-install old versions? <quinn@computer.oorg>
    Re: UN-INSTALLING Perl: How can I un-install old versio (Alastair)
    Re: Using API's from 3rd party dlls [Newie question] <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Weird problem - can you help? <estabroo@ispn.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 03 Sep 1998 15:53:02 -0500
From: Eric Estabrooks <estabroo@ispn.com>
Subject: Re: Cookies?
Message-Id: <35EF01AE.2A2E358E@ispn.com>

Felix Tarnarider wrote:
> 
> How do you set a cookie in Perl(Win32)? I tried to set an environment
> variable but the next .pl file could not get the value from the variable. Is
> there any way to pass a variable without a post or get with the value in the
> url?
> 
> felix

If you have a form on the page you can use hidden values in the form to
carry information from one connection to the next.


Hope this helps,

Eric
 estabroo@ispn.com


-- 
Change is inevitable, except from a vending machine.
 -- Author Unknown --


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

Date: Thu, 03 Sep 1998 21:57:17 GMT
From: cfedde@my-dejanews.com
Subject: Denver/Boulder Perl Mongers
Message-Id: <6sn3bs$hhf$1@nnrp1.dejanews.com>

The first meeting of the Denver/Boulder Perl Mongers group
will be held at:

    Wynkoop Brewing Co.
    1634 18th, DENVER CO
    Monday, Sept 14 1998
    6:30PM

There is a table reserved for us under my name.

Thanks
Chris Fedde

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


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

Date: Thu, 03 Sep 1998 20:12:29 GMT
From: smitzla@uswest.com
Subject: Does open() lock the file?
Message-Id: <6smt7d$9km$1@nnrp1.dejanews.com>

When I do an open() on a file for writing, is the file that is opened locked
in any way that would prevent other processes from writing to this file or
otherwise manipulating it? I've looked for the answer and can't find it but
from what I've read, my guess would be NO, judging by what I've read in the
flock() documentation.

I know these questions have more to do with UNIX implementation rather than
Perl, and I should know the answer already, but for some reason I find myself
drawing a blank.

Thanks to someone who has the answer right on the tip of their tongue.

Sid Mitzlaff



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


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

Date: 3 Sep 1998 20:32:32 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Does open() lock the file?
Message-Id: <6smud0$q9v$4@marina.cinenet.net>

smitzla@uswest.com wrote:
: When I do an open() on a file for writing, is the file that is opened locked
: in any way that would prevent other processes from writing to this file or
: otherwise manipulating it?

Nope.  That's what flock() is for.

: I've looked for the answer and can't find it but from what I've read, 
: my guess would be NO, judging by what I've read in the flock()
: documentation.

You interpret correctly.

: I know these questions have more to do with UNIX implementation rather
: than Perl,

Not really; open and flock behave quite similarly across platforms, and
Perl would have been free to make open-for-read imply a shared lock, and
open-for-write and exclusive one, if Larry Wall et al had decided to do it
that way (which I'm glad they didn't).  It is true that the underlying OS
open and locking mechanisms are distinct, but again, that's true on many
OSs besides Unix.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Thu, 03 Sep 1998 20:49:55 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Does open() lock the file?
Message-Id: <ThDH1.52$k6.330658@news.shore.net>

smitzla@uswest.com wrote:
: When I do an open() on a file for writing, is the file that is opened locked
: in any way that would prevent other processes from writing to this file or
: otherwise manipulating it? I've looked for the answer and can't find it but
: from what I've read, my guess would be NO, judging by what I've read in the
: flock() documentation.

You are correct. Check out Randal Schwartz's columns at
http://www.stonehenge.com/merlyn/WebTechniques/ for plenty of info on
flock.

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: 3 Sep 1998 20:51:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Does open() lock the file?
Message-Id: <6smvg8$9ir$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<smitzla@uswest.com>],
who wrote in article <6smt7d$9km$1@nnrp1.dejanews.com>:
> When I do an open() on a file for writing, is the file that is opened locked
> in any way that would prevent other processes from writing to this file or
> otherwise manipulating it? I've looked for the answer and can't find it but
> from what I've read, my guess would be NO, judging by what I've read in the
> flock() documentation.
> 
> I know these questions have more to do with UNIX implementation rather than
> Perl, and I should know the answer already, but for some reason I find myself
> drawing a blank.

I cannot see where is Unix in this equation.

The answer on your question is: it depends.  On older systems. like
Unix, where file locking was added as an afterthought, opening the
file for write will not lock it.  Moreover, you have no mandatory
locks.

On newer systems (I checked OS/2) doing open() for write *will* lock
the file (mandatory).  I do not know whether sysopen() can open for
write without locking.  

I would expect that Win* behaves similarly.

Ilya


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

Date: Thu, 03 Sep 1998 20:00:08 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Encryption & File Locking
Message-Id: <35EEF2F2.79A7E768@bbnplanet.com>

> I don't have a problem with the above where $(SOURCE) might be zero or
> more files.  I just think it's *extremely* silly, demonstrates
> cluelessness, and is a tiny bit inefficient when there is clearly only
> *one* file to "cat".  How can you "con-cat-enate" *one* file?

without digressing into the philosophy of cat usage i might mention here
that concatenate can address one or many files. also as abs mentioned,
its handier for scaling. and cat can do a lot more than just cat. it may
be inefficient but sometimes function beats form. especially when you
need a fast solution and aren't terribly concerned with semantics.
cluelessness? probably not. laziness? you betcha.

e.


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

Date: Thu, 03 Sep 1998 20:05:07 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: HELP ! Compile/Link error for PERL on Solaris
Message-Id: <35EEF41D.B21812D0@bbnplanet.com>

Jonathan Stowe wrote:
> 
> On Wed, 02 Sep 1998 19:58:33 -0700, Mohan Mandava wrote :
> Missing libm.a  - the library is either missing (look in
> /opt/GCC2723/lib ) in which case you will need to get hold or
> reinstall your compiler or you will need to specify -lm when Configure
> asks for any additional libraries.  However you compiler is relatively

on 2.6, the default configs work right out of the box. if not, youve got
problems which could be as simple as a path or as painful as a mungled
compiler. but it should compile like cake. 

e.


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

Date: Thu, 3 Sep 1998 16:46:48 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: How do you pass quotes to the command line?
Message-Id: <MPG.1058ca10f784fe98968a@news.south-carolina.net>

In article <35EEEC83.3D0A@loc.gov> on Thu, 03 Sep 1998 15:22:43 -
0400, Dick Thaxter (rtha@loc.gov) pounded in the following text:
=> Using back ticks I am able to capture the output of a grep command
=> containing a scalar variables as the search argument and the filename:
=> 
=>   @hits = `grep -i ^$query  $fname`;
=> 
=> I can't figure out how to pass a multiple word query with quotes; i.e.,
=> I want to execute:
=> 
=>   grep -i -e 'word1 word2' filename
=> 
=> What is the correct syntax to send the quotes with the expanded variable
=> inside?
=> 
=> Dick Thaxter
=> rtha@loc.gov
=> 

@hits = `grep -i '^$query' $fname`;

:)

Hope This Helps!

--Matthew


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

Date: Thu,  3 Sep 1998 15:39:19 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: How to remove the file's extention using perl
Message-Id: <6smr97$8rh$1@earth.superlink.net>

Hello -

Josh Freeman <frejos@cswnet.com> writes:

><HTML>
>Be careful you can use the split, but don't forget that long filenames
>are in use almost everywhere now (they can have more than one .).

><P>Try this:

><P>$filename="index.mydocs.html";
><BR>$outname = ""; #initialize

><P>@name = split (/\./, $filename); #you have to escape the period '\.'
>it is a special character

><P>$numsplits = @name; #this puts number of splits intp numsplits
><BR>$numsplits --; #subtract one from numsplits (we don't want the last
>one, the extension)

><P>for ($i = 0;$i &lt; $numsplits;$i++) {
><BR>&nbsp;&nbsp;&nbsp; $outname .= $name[$i];
><BR>}

><P>That should work for ya.


Oy vey.  What's with the HTML?  Moving right along....


Another and less cumbersome approach would be:

my ($newname) = $filename =~ /^(.*?)(\.[^.]*)?$/;

or something along those lines.  (Refinements to handle, e.g., names
ending with a '.' would be possible, if desired.)


David Black
dblack@saturn.superlink.net



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

Date: Thu, 03 Sep 1998 20:45:17 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: In search of Intellegint Life... HELP!!
Message-Id: <xdDH1.51$k6.330658@news.shore.net>

Alan Barclay <gorilla@elaine.drink.com> wrote:
: In article <ELdH1.108$kE2.957302@news.shore.net>,
: Scratchie  <upsetter@ziplink.net> wrote:
:>
:>Interesting that two people in a row posted the same thing. The semicolon
:>is unnecessary. Only really a concern for those who obsess over very
:>"wasted" keystroke, but I just thought I'd point it out in the interest of

: Many of us are used to putting in 'unneccessary' ;'s so that when we
: change the structure around they are there. 

[reasonable example snipped]

I'm all in favor of putting "useless" semicolons before braces (and
"useless" commas at the end of long array/hash declarations) but I think
that the comma after the "1" in an include file is going a little far.
There's no reason not to put the "1" at the end of your file, and no
reason (I can think of) to add any code after it at a later date.

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Thu, 3 Sep 1998 14:01:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: In search of Intellegint Life... HELP!!
Message-Id: <MPG.1058a39c89f31fce98978f@nntp.hpl.hp.com>

In article <xdDH1.51$k6.330658@news.shore.net> on Thu, 03 Sep 1998 
20:45:17 GMT, Scratchie <upsetter@ziplink.net> says...
> Alan Barclay <gorilla@elaine.drink.com> wrote:
 ...
> : Many of us are used to putting in 'unneccessary' ;'s so that when we
> : change the structure around they are there. 
 ...
> I'm all in favor of putting "useless" semicolons before braces (and
> "useless" commas at the end of long array/hash declarations) but I think
> that the comma after the "1" in an include file is going a little far.
     --> semicolon <--
> There's no reason not to put the "1" at the end of your file, and no
> reason (I can think of) to add any code after it at a later date.

I think that applies to all "bare" return values, specifically the last 
expression evaluated in a subroutine before the closing brace.  By 
leaving off the semicolon, one ensures that inadvertantly adding 
statements after that will cause syntax errors.  There is also extra 
mnemonic value in the bare return value, differentiating it from merely 
being the last statement executed in the subroutine.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 3 Sep 1998 19:15:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Is perl millennium compliant ?
Message-Id: <6smpt5$q9v$2@marina.cinenet.net>

Les George (georgelj@boat.bt.com) wrote:
: Does snybody knwo if the current releases of perl have been certified
: for millennium compliance ?

No, nobody has any idea whatsoever.  Disregard all the information you'll
find out about Perl Y2K issues at (e.g.) www.perl.com or by searching
Dejanews; it's all a vast disinformation campaign.  Quite frankly, when
the year 9,000 hits, the Perl community is toast.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Thu, 03 Sep 1998 15:03:06 -0500
From: "Quinn,M" <melinda@acm.org>
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <35EEF5FA.9B66546F@acm.org>

I just came across a great answer to that question under one of the Perl
FAQs"
==================
   Quoted:
    Does Perl have a year 2000 problem?
      Not unless you use Perl to create one....

M.Quinn   melinda@acm.org
==================
Jeff Gao wrote:
> 
> Does anybody know that whether perl 5.004 is y2k compilant?
> 
> Thanks
> 
> --
> Jeff Gao


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

Date: 3 Sep 1998 21:22:18 +0100
From: ptm@xact.xact.co.uk (Paul Mahoney)
Subject: ODBC DBD Module
Message-Id: <6smtpq$1to$1@xact.xact.co.uk>

I got this working. However, when a call fails, I get error messages
even though I havn't asked for them to be printed.

Eg:
   [OpenLink][ODBC][Informix Server]Error 135515176
     (-1006 (SQL-S1000)(DBD: st_execute/SQLExecute err=-1) at ./ttt.pl line 27.

The error message is correct.
This is the content of DBI::errstr ... I didn't print it, so who did?



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

Date: Thu, 03 Sep 1998 21:00:06 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35f0fd28.19231453@news.cableol.net>

On Sun, 30 Aug 1998 00:14:59 GMT, Gellyfish@btinternet.com (Jonathan Stowe)
felt the need to post:

>On Sat, 29 Aug 1998 14:43:32 GMT, David Hawker wrote :
>
>>On 23 Aug 1998 23:00:15 GMT, abigail@fnx.com (Abigail) felt the need to
>>post:
>>>
>>>If you're that afraid of spam, don't post to Usenet.
>>
>>The benefits are too great.
>>
>>>Better weld your mailbox shut too.
>>
>>Oh?
>>
>Well for myself I find that I get more paper Junk mail through the
>letter box than I do spam.  Infact I have had no spam all week but
>have had several offers of cheaper credit cards/cheap airfares/save my
>soul for a donation to some charity/ etc etc.  And I take no
>precautions whatsoever against spam - and obviously one cant put a
>false name and address when applying for bank account/credit card or
>whatever and it is a real pain in the butt to go the office of the
>data protection registrar to complain every time I get a bit of
>unsolicited mail.  Maybe I should get the Postman to sue for an
>industrial injury.

I'm always pleased to receive paper mail. It's different than email - for
one thing you don't get "get rich quick by sending us $5" sort of things by
post. Unsolicited postal mail can be good - it can inform you of proper
services you never knew existed, and you could benefit.

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Thu, 03 Sep 1998 21:01:24 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35f9039c.20884388@news.cableol.net>

On 23 Aug 1998 18:28:42 GMT, cberry@cinenet.net (Craig Berry) felt the need
to post:

>David Hawker (dhawker@removethis.bigfoot.com) wrote:
>: >David Hawker (dhawker@removethis.bigfoot.com) wrote:
>: >: 1. Why is for/foreach/etc never included in the perl docs?
>: >
>: >/usr2/people/cberry > perldoc perlsyn | grep foreach            
>: >         LABEL foreach VAR (LIST) BLOCK                         
>[snipped: Many more matching lines]
>: >     subroutine or a foreach loop.  It also can't be used to go 
>: >
>: >And that's just perlsyn; it may well pop up elsewhere.
>: 
>: There was no big sign saying 'you can find out about foreach in perlsyn' -
>
>I'm sorry, and I've tried to find a better way to phrase this, but this
>isn't nursery school.  Perl is a complex, powerful, potentially dangerous
>*tool*, and it well within the bounds of reasonable expectation that those
>desiring to use this tool will first familiarize themselves with the
>documentations on how to use it.  I knew to look in perlsyn because I read
>(or at least skimmed) the entire perl online doc shortly after becoming
>interested in the language, and thereby built up a mental map of what's
>where, a map which I have been reinforcing and extending through nearly
>daily use of the perl doc ever since.  There's no magic road to
>familiarity with perl and its doc; you need to study it and use it.

Maybe so, but I do know one easy way to find what I'm looking for:
searching. In UNIX you call it "grep"

>: the obvious place that struck me was perlfunc, as these (for/foreach) are
>: words and can be misinterpreted as functions by people who aren't as expert
>: on perl as those who make it or write the manuals.
>
>I'm sorry, but that's silly.  

Is it?

>CGI is a 'word' (at least as much as foreach
>is), yet I wouldn't expect you'd look for that in perlfunc.  And let me

You're right I wouldn't - "cgi" is not part of the perl language. I'm not
that stupid :)

>assure you that I have had nothing to do with either making or documenting
>perl.  I've simply studied and used it. 

Good for you - you've obviously spent too much time at it and know all
there is to know about it...

>: I regard syntax as the way perl is written - not the function of the words
>: "for/foreach"
>
>So you don't know the difference between statements and functions?  I lay

I wouldn't say that. A statement is something like
$a = 1;
A function is like
$result = socket(S,AF_INET,SOCK_STREAM,$proto);

>this problem in your lap, not that of the Perl documenters.  For that
>matter, if both functions and statements are covered by perlfunc, what's
>left to be handled in perlsyn?  What is there to say about 'the way perl
>is written' beyond talking about statements (including declarations, of
>course)?

I dunno, I use perl, I don't write it.

>: >: 2. I'm after a complete documentation in one package. One thing that annoys
>: >: me is when the perl docs just say 'does the same thing as the system call'
>: >: and i have no idea what the system call does.
>: >
>: >  perldoc -f system
>: 
>: What's that supposed to do? Tell you how to invoke system calls? But it has
>: no information on what those system calls do.
>
>As I already posted in a followup, my bad.  I misunderstood the level of
>doc you were after, here.

Forgiven.

>: The MS-DOS modifier "|more" doesn't seem to work on my system and so most
>: of the output scrolled up too fast to read. :-)
>
>That's not a modifier; that's a pipe to a separate program, 'more'.  And
>if it doesn't work, you have *serious* problems with your system.

Either it's been removed in win95 DOS (as I understand it's not a proper
implementation?) or you're right, I have problems.



































--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Thu, 03 Sep 1998 21:00:58 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35f70381.20857333@news.cableol.net>

On Sun, 30 Aug 1998 01:10:19 GMT, sowmaster@juicepigs.com (Bob Trieger)
felt the need to post:

>[ posted to usenet and courtesy e-mail sent to Gellyfish@btinternet.com]
>Gellyfish@btinternet.com (Jonathan Stowe) wrote:
>-> On Sat, 29 Aug 1998 14:43:32 GMT, David Hawker wrote :
>-> 
>-> >On 23 Aug 1998 23:00:15 GMT, abigail@fnx.com (Abigail) felt the need to
>-> >post:
>-> >>
>-> >>If you're that afraid of spam, don't post to Usenet.
>-> >
>-> >The benefits are too great.
>-> >
>-> >>Better weld your mailbox shut too.
>-> >
>-> >Oh?
>-> >
>-> Well for myself I find that I get more paper Junk mail through the
>-> letter box than I do spam.  Infact I have had no spam all week but
>-> have had several offers of cheaper credit cards/cheap airfares/save my
>-> soul for a donation to some charity/ etc etc.  And I take no
>-> precautions whatsoever against spam - and obviously one cant put a
>-> false name and address when applying for bank account/credit card or
>-> whatever and it is a real pain in the butt to go the office of the
>-> data protection registrar to complain every time I get a bit of
>-> unsolicited mail.  Maybe I should get the Postman to sue for an
>-> industrial injury.
>
>Perhaps you could just munge you mailing address and make the bill 
>collectors and friend figure out how to unmunge it in order to send you 
>mail.
>
>Who cares if it screws up everyone elses postal service as well as 
>yours? You will get less junk mail.

If this is an attack on corrupting the email address when posting to usenet
- it can't take a genius to figure out you need to remove the bit that says
"removethis"






























--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Thu, 03 Sep 1998 22:11:25 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: PerlScript: reading/writing files?
Message-Id: <35ef0edb.3293522@news.btinternet.com>

On Thu, 03 Sep 1998 14:28:12 -0500, Matt Kruse wrote :

>Using the latest PerlScript with IIS4 in ASP, I cannot open files
>for reading or writing.
>
>I haven't found any documentation on this.
>Is this a known problem/bug? 
>Or is it intentional for some reason?
>

The thing about PerlScript is that you have to read the documentation
for VBScript or JScript to understand certain things Unfortunately.
You should search the documentation on www.microsoft.com for
"FileSystemObject" - the following is an example I have inferred from
that documentation which may be totally incorrect and I cant test
right now:

          $fs = CreateObject("Scripting.FileSystemObject");
          $a = $fs->CreateTextFile("c:\\testfile.txt", 1);
          $a->WriteLine("This is a test.");
          $a->Close;

You get the idea dont you ?

/J\
-- 
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 03 Sep 1998 11:26:15 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Polling a socket
Message-Id: <x3ysoi98bfs.fsf@tigre.matrox.com>


Morten Simonsen <mortensi@idt.ntnu.no> writes:

> The question is:
> 
> How can I find out if a socket contains data without halting the
> execution?
> 
> Thanks for any help
> 
> Morten Simonsen

Your friend is the select() function. Read some documentation on that.

Hope this helps,
-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Thu, 03 Sep 1998 21:27:47 GMT
From: mcafee@choplifter.rs.itd.umich.edu (Sean McAfee)
Subject: Re: problem evaluating hash using symbolic reference
Message-Id: <nRDH1.883$F7.3787577@news.itd.umich.edu>

In article <6smnvb$34t$1@nnrp1.dejanews.com>,  <slussier@bigfoot.com> wrote:
>I've been programming Perl 5 on and off for a while, but
>I'm still no expert at it.  Here's my problem:

>I need to do this:
>	$report{client}{project}{total} = $time;

>Except that, in my program, for some reasons I won't explain,
>'{client}{project}' is a string:
>	$args = '{client}{project};

>So I can set my value using:
>	eval ('$report'.$args."{total} = $time");

>But I read this is an obsolete way to procede (and for other reasons),
>so I'd like to do it using symbolic references.

Why not use regular references instead?

$args = "{client}{project}";
$hashref = \%report;
$hashref = $hashref->{$1} ||= { } while $args =~ /{(.+?)}/g;
$hashref->{"total"} = $time;

If you do it a lot, you could make it a subroutine, like so:

sub hash_chain {
	my ($hash, $args) = @_;
	$hash = $hash->{$1} ||= { } while $args =~ /{(.+?)}/g;
	$hash;
}

$args = "{client}{project}";
hash_chain(\%report, $args)->{"total"} = $time;

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Thu, 3 Sep 1998 20:27:31 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: problem evaluating hash using symbolic reference
Message-Id: <Eyq65v.JM8@world.std.com>

slussier@bigfoot.com writes:

>	$report{client}{project}{total} = $time;

>Except that, in my program, for some reasons I won't explain,
>'{client}{project}' is a string:

>	$args = '{client}{project};


How about if you tranverse your way through each step of the chain of
hashes containing references to hashes. Are your hash keys all
alphnumerics? If not at least are they guaranteed not to contain curly
brackets? (if so, adjust the regex accordingly)

#!/usr/bin/perl -w

my %report;
my $time = time;
my $args = '{client}{project}';
my @fields = ($args =~ /{(\w+)}/g);

my $hashref = \%report; # start with a ref to the top level hash.
while(@fields) {        # for each key, get a ref to the its dimentions hash.
  my $field = shift @fields;
  $hashref = \%{$hashref->{$field}};
}

# now you have a reference to the largest dimention hash.
$hashref->{total} = $time;
-- 
Andrew Langmead


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

Date: Thu, 03 Sep 1998 19:52:17 GMT
From: "Brendan Murphy" <INFO@ARKSON.COM>
Subject: Sorting a simple database list
Message-Id: <RrCH1.1958$c_3.5006441@news.inreach.com>

Hello:

I need some help... any input will be greatly appreciated.

I am using a list of name in a text file which is call by a cgi to be used
in a <select> list:

orange
apple
lemon

I want the cgi to sort the list and only then print on a html page as
follow:

<option>apple
<option>lemon
<option>orange

I have use print sort (<FILE>) but I could not include the <option> tag in
between each word...

I have tried different things without success.... I am stuck on this and I
am sure it should be very easy.... shame on me!

Thanks in advance.

Brendan
info@arkson.com




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

Date: Thu, 03 Sep 1998 20:45:46 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Sorting a simple database list
Message-Id: <slrn6utvvr.676.maurice@we-24-130-48-83.we.mediaone.net>

On Thu, 03 Sep 1998 19:52:17 GMT, Brendan Murphy <INFO@ARKSON.COM> wrote:
>Hello:
>
>I need some help... any input will be greatly appreciated.
>
>I am using a list of name in a text file which is call by a cgi to be used
>in a <select> list:
>
>orange
>apple
>lemon
>
>I want the cgi to sort the list and only then print on a html page as
>follow:
>
><option>apple
><option>lemon
><option>orange

print map { "<option>$_" } sort <FILE>; 

-- 
Maurice Aubrey <maurice@hevanet.com>

The worst thing that can happen to a good cause is, not to be 
skillfully attacked, but to be ineptly defended. 
  - Frederic Bastiat


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

Date: Thu, 3 Sep 1998 13:49:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Sorting a simple database list
Message-Id: <MPG.1058a094a7a05d2b98978e@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <RrCH1.1958$c_3.5006441@news.inreach.com> on Thu, 03 Sep 1998 
19:52:17 GMT, Brendan Murphy <INFO@ARKSON.COM> says...
 ...
> I want the cgi to sort the list and only then print on a html page as
> follow:
> 
> <option>apple
> <option>lemon
> <option>orange
> 
> I have use print sort (<FILE>) but I could not include the <option> tag in
> between each word...
> 
> I have tried different things without success.... I am stuck on this and I
> am sure it should be very easy.... shame on me!

It is.  TMTOWTDI.  You can loop using 'foreach' or 'map', you can prepend 
using a regex or concatenation.  Here is "the best" way :-):

print map "<option>$_", sort @in_list;

HTH.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 03 Sep 1998 19:31:50 GMT
From: bitnut1@my-dejanews.com
Subject: Trolls
Message-Id: <6smqr6$6ji$1@nnrp1.dejanews.com>



s/anyone criticizing any(one|thing) related to Perl/troll/g

print 'Grok, oink!';

exit -1;

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


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

Date: Thu, 03 Sep 1998 15:53:33 -0500
From: "Quinn,M" <quinn@computer.oorg>
Subject: UN-INSTALLING Perl: How can I un-install old versions?
Message-Id: <35EF01CD.E4B7AC55@computer.oorg>

I'm new to Perl and new to Linux.  I've searched FAQs
and "Learning Perl" and "Programming in Perl".  Perhaps
I just overlooked the answer to the following questions:

1.  How can I UN-INSTALL Perl 3 and/or Perl 4
    from several Linux computers?  Some do not have
    very much space.

2.  How can I avoid installing Perl man pages on
    Linux computers with tiny hard disks?

Please reply by e-mail as well as replying to newsgroup.

Thank you,  Melinda Quinn    quinn@computer.org


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

Date: Thu, 03 Sep 1998 23:38:14 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: UN-INSTALLING Perl: How can I un-install old versions?
Message-Id: <slrn6uudpk.59.alastair@calliope.demon.co.uk>

Quinn,M <quinn@computer.oorg> wrote:
>I'm new to Perl and new to Linux.  I've searched FAQs
>and "Learning Perl" and "Programming in Perl".  Perhaps
>I just overlooked the answer to the following questions:
>
>1.  How can I UN-INSTALL Perl 3 and/or Perl 4
>    from several Linux computers?  Some do not have
>    very much space.

I've never un-installed Perl, just upgraded. There isn't really an 'un-install'
program - you could search for any file/directory with 'perl' in it e.g. this
should work ;

find / -name '*perl*' -print

You could even automatically remove these files (but you should read the man
page for that ;) - 'man find'). 

If you don't want to install man pages with Perl, answer 'none' when the
'Configure' script asks you if you want them.

HTH.

-- 

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


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

Date: Thu, 03 Sep 1998 21:34:20 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Using API's from 3rd party dlls [Newie question]
Message-Id: <35EF6DCC.36BC@comenius.ms.mff.cuni.cz>

Paul Southway wrote:
> 
> Under Delphi, Wordbasic, C etc it is possible to call a function in a
> vendor's dll (if you know the details).  Is this possible in Perl ?

Yes. See Win32::API http://www.divinf.it/dada/perl

If you are using ActivePerl you may install it with PPM :

 c:\> perl -S PPM.pl
 ... blah blah

 ppm> install Win32-API
	realy ? y

 ... blah blah

 ppm> ^Z

finished.

Ask if you have problems.

HTH, Jenda
http://jenda.krynicky.cz Win32::FileOp, Win32::Registry2, Mail::Sender,
 ...


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

Date: Thu, 03 Sep 1998 16:11:51 -0500
From: Eric Estabrooks <estabroo@ispn.com>
To: Raj Subramani <raj.subramani@citicorp.com>
Subject: Re: Weird problem - can you help?
Message-Id: <35EF0617.B664C661@ispn.com>

Raj Subramani wrote:
> 
> Please look at this ftp script that I wrote:
> 
> (NOTE: Please put in a suitable IP adress or hostname
> if you are going to run it).
> 
> --------------------start---------------------
> #!/usr/local/bin/perl
> 
> use Net::FTP;
> 
> #-CHANGE THESE VARIABLES TO SUIT YOU-
> $hostname = "Your_IP_Address";
> $loginName = "anonymous";
> $password = "foo\@bar";
> $remoteDir = "/";
> #-CHANGE THESE VARIABLES TO SUIT YOU-
> 
> $attemptFtp = 1;
> 
> $ftp = Net::FTP->new($hostname);
> if (!$ftp) {
>   die "failed to create object, stopped";
> }
> print("created ftp object\n");
> 
> getPasswd($attemptFtp, $hostname, $loginName);
> 
> if (!$ftp->login($loginName, $password)) {
>   die "failed to login, stopped";
> }
> print("login successful\n");
> 
> if (!$ftp->cwd($remoteDir)) {
>   die "failed to cwd, stopped";
> }
> print("cwd succeeded\n");
> 
> sub getPasswd {
>   my($attempt) = @_[0];
>   my($host) = @_[1];
>   my($loginName) = @_[2];
>     print("[attempt $attempt] enter password for $loginName on $host:");
>   #NOTE: THIS 'system' COMMAND WILL APPLY FOR UNIX ONLY
>   system "stty -echo";
>   $password = <STDIN>;
>   #NOTE: THIS 'system' COMMAND WILL APPLY FOR UNIX ONLY
>   system "stty echo";
>   print("\n");
> }
> 

add 

chomp($password);

> -raj

Eric
  estabroo@ispn.com

-- 
Change is inevitable, except from a vending machine.
 -- Author Unknown --


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

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

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