[6665] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 290 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 12 22:07:12 1997

Date: Sat, 12 Apr 97 19:00: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           Sat, 12 Apr 1997     Volume: 8 Number: 290

Today's topics:
     CGI Module - I have a syntax problem. (George Henry C. Daswani)
     Getting single keystroke (root)
     Getting TCP info for a tty <yyz@hooked.net>
     Re: Help on integer segmenting into an Array <dbenhur@egames.com>
     Re: HELP: Convert dates to system time (Tim Gim Yee)
     Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc) <dbenhur@egames.com>
     Newbie: Webify A Program? <jeffo@execpc.com>
     Re: No GUI environment for Perl? (Joel Potischman)
     Re: Perl NT problems <dbenhur@egames.com>
     Re: Perl precompiled for Solaris 2.5 (Eric D. Friedman)
     Re: Perl precompiled for Solaris 2.5 (Brooks Davis)
     Re: Perl-Books. (Eric D. Friedman)
     Re: Question on Strings [HELP] (Laurel Shimer)
     reading from *two* sockets: how ? (Giovanni Gigante)
     Re: reading from *two* sockets: how ? <rra@stanford.edu>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Mark A Harrison)
     Re: security without a secure server (Joel Potischman)
     Re: Splitting Hairs, or strings, rather <dbenhur@egames.com>
     Unexpected Behavior using open () <bobmi@digital-cafe.com>
     Re: Unexpected Behavior using open () (Nathan V. Patwardhan)
     Re: Unix and ease of use (WAS: Who makes more ...) (Ottavio G. Rizzo)
     Re: Unix and ease of use (WAS: Who makes more ...) (M-P)
     Re: Win32::ODBC  : need help! <dbenhur@egames.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 13 Apr 1997 01:14:06 GMT
From: gdaswani@mail.odc.net (George Henry C. Daswani)
Subject: CGI Module - I have a syntax problem.
Message-Id: <5ipc0u$44j@holocron.odc.net>

Hello,

	Was wondering if somebody can help me with my perl syntax.

I'm doing something stupid and can't quite figure it out.

Here's the example code.

Perl is 5.003 and newest CGI.pm

------ START HERE ---------
#!/usr/bin/perl

use CGI;
$cgi_query = new CGI;

print $cgi_query->header();



print $cgi_query->start_html(-title=>'Registration Status',
                             -author=>'nobody@nobody.net',
                             -base=>'true',
                             -BGCOLOR=>'white');

print &CheckIfNull("first_name","last_name");


print $cgi_query->end_html;

#### SUBROUTINES


sub CheckIfNull {

    local (@checklist) = @_;
    local ($item);

    foreach $item (@checklist) {
         if ( $cgi_query->param('$item') eq "" ){
            return ($item);
         }
    }
 
    return (1);

}
------- END HERE ----


Problem is with the

   foreach $item (@checklist) {
         if ( $cgi_query->param('$item') eq "" ){
                               ^^^^^^^^^
                               This doesn't seem to work properly.
                               even though at that loop $item = "first_name".                              
                               $cgi_query->param('$item') returns a NULL
  
                               while
 
                               $cgi_query->param('first_name') returns 
                               first name from the form properly.

I'm pretty sure this is just a weird variable subtitution syntax
problem on my end.

How does one fix it?

George Daswani 
gdaswani@odc.net
 
                   


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

Date: 12 Apr 1997 22:29:01 GMT
From: root@localhost.localdomain (root)
Subject: Getting single keystroke
Message-Id: <5ip2bd$njk@argentina.earthlink.net>

It's outrageous that perl doesn't have a built-in function to get  single 
keystroke input from the keyboard.  Thompson Automation's awk compiler 
(TAWK) has getkey() and even QBasic has inkey$ to do the trick.

I've wasted the last few hours downloading, installing, and trying to 
figure out how to use the term::ReadKey perl module from CPAN.  If someone 
could explain this to an irritated newbie, I give my thanks in advance.

And why *isn't* this part of the standard perl distribution?    



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

Date: 12 Apr 1997 00:29:31 GMT
From: "Paul Pieralde" <yyz@hooked.net>
Subject: Getting TCP info for a tty
Message-Id: <01bc46d9$46913420$490e50ce@get.hooked.net>

Hi.

Does anyone know a good method to find the current IP address for a rlogin
session. I am rlogin from a CISCO 2511 router to a NCR MP-RAS 3.01 Unix
System. 

When I get the login, I would like to write a small program to find the IP
address and TCP port number of the router I am rlogin'd from.

I can use netstat to find the foreign addresses of all connections, but
that does not tell me much as to which tty they are using on my Unix
system.

Thanks for the help.

-- 
-----
Paul Pieralde
Modulus Data Systems
(408) 773-8686
(408) 732-0487 (Fax)


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

Date: Thu, 10 Apr 1997 15:50:15 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: leonstep@cedep.com
Subject: Re: Help on integer segmenting into an Array
Message-Id: <334D6EA6.46D0@egames.com>

[mail&post]
Leon Stepanian wrote:
> I have to get integer values held in $hold into an array under their
> seperate digits such as:
>                 for     for     for     for
>                 8       16      134     2567
> 
> @array[0]       0       0       0       2
> @array[1]       0       0       1       5
> @array[2]       0       1       3       6
> @array[3]       8       6       4       7

There are many ways, but this should do it:
  @array = unpack('A'x4, sprintf('%04d', $hold) );

The sprintf formats the number as a zero-filled 4 digit 
string, the unpack splits that into a list of four 
one-character strings.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"




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

Date: Sun, 13 Apr 1997 01:22:58 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: HELP: Convert dates to system time
Message-Id: <335034c3.26298164@news.seanet.com>

On 12 Apr 97 07:01:48 GMT, "Mike Straw" <thestraws@usa.net> wrote:

>I'm looking for the builtin function that converts an array/string to
>system time format (like what's returned from time()).  The array is year,
>month, day, etc. I'm pretty sure it's out there, but can't locate it in the
>Camel book or manpages.  Anyone know what it is?

Not a builtin function, but a builtin module...

use Time::Local;
$time = timelocal($sec,$min,$hours,$mday,$mon,$year);


-- Tim Gim Yee             tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"


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

Date: Thu, 10 Apr 1997 15:59:09 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
Subject: Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc)
Message-Id: <334D70BD.1263@egames.com>

Digital Psychosis wrote:
> Jason C Austin (jason@quake.cs.odu.edu) wrote:
> : Unix is better than Windows in some applications and Windows is better
> : that Unix in others.  Why argue and block out all the real questions?
> 
> name one thing windows is better thanunix in?

Heheh,
  Selling bigger hard disks and more DRAM!

But seriously,
  Windows is much better at allowing non-technical users
to install and run their software.

--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



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

Date: 13 Apr 1997 01:53:11 GMT
From: "Jeff Oien" <jeffo@execpc.com>
Subject: Newbie: Webify A Program?
Message-Id: <01bc47ae$804c58e0$4642cfa9@Pjeffo.execpc.com>

Hi,
Here is a program based on one of the exercises in 
the Llama book. I have two questions. 
1. How can I get this to work within a browser 
environment either on the same page if possible or with 
the answer being stated in a new page. I'm familiar with
the Content-type...print etc. but not sure how to put it
in a form and run it.
2. Why doesn't this work when I eliminate the spaces
in the $ax$b=$c so that it prints 3x2=6 (or whatever)? 
--------------
print "I am a multiplication robot.\nPlease type in any number, then
press Enter: ";
chomp($a = <STDIN>);
print "Please type in another number: ";
chomp($b = <STDIN>);
$c = $a * $b;
print "$a x $b = $c\n";
print "Yay!";
-------------
(I'm not going to actually use this program. It's just an
exercise for myself.)  :)

Thanks,
-- 
Jeff Oien, WebDesigns
http://www.execpc.com/webdesigns/
jeffo@execpc.com


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

Date: Sat, 12 Apr 1997 21:07:15 GMT
From: joel@zeptosoft.com (Joel Potischman)
Subject: Re: No GUI environment for Perl?
Message-Id: <334ff8e2.58587651@news2.cnct.com>

>maybe I should have an open house and invite people to
>come watch me develop software or something.

Shall we say 7:00?

-joel

p.s. Please be sure to buy Cheetos. I love those things.


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

Date: Fri, 11 Apr 1997 02:02:44 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Yuri Shtil <shtil@netcom.com>
Subject: Re: Perl NT problems
Message-Id: <334DFE34.72E0@egames.com>

[mail&post]
Yuri Shtil wrote:
> I have downloaded and installed the latest Perl for Windows NT (it is
> something  004 as I recall).
> 
> I am confused because it does not seem to work. For examplethe command:
> 
> perl -e 'print "foo\n"' fails with error message like:
> 
>     cannot see "'" before EOF (I have the exact message on an another site).

This not so much a perl problem as a shell problem.

The NT DOS-compatibility box runs a very primitive command 
shell.  The default shell doesn't understand that 'print "foo\n"'
is supposed to be one argument, so what perl tries to execute is
just the first space-delimited token from that command line:
   'print
and so it complains about not finding a "'" before the
end of the program.  The DOS command shell does understand
that "..." is one argument, but has no mechanism for
escaping embedded double-quotes.

So, you'll either need to avoid command-line one-liners which
use double-quote, or find yourself a better shell to run in the
DOS box (4DOS/4NT is an extended DOS-flavored shell which will
do the trick, and there are various flavors of unix shell
ports available.  Or you could just install linux and shine M$
on entirely).

> Also I tried to use the registry package and it failed miserably on the very
> first call to $LOCAL_MACHINE->open with an error when trying to goto to a 
> nonexisting label.

You don't show us any code, so it's rather hard to say what's
wrong.  (Not that I've messed with any of the Win32 registry
parts of Perl/NT anyway).  You might want to go to
<URL:http://www.activeware.com/> and read some FAQs and sign
up for the Perl-Win32-Users mailing list.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



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

Date: 12 Apr 1997 22:20:30 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: Perl precompiled for Solaris 2.5
Message-Id: <5ip1re$2ul@news.service.uci.edu>

[mailed, posted]

In article <334FDF68.4BA6@ea.oac.uci.edu>,
Ricardo Antuna  <riantuna@ea.oac.uci.edu> wrote:
>Is it possible to obtain this from somewhere?
>My systems does not have a c compiler and I can't get gcc installed on
>it.
>
>Thanks for any response,

Ricardo, what are you talking about? You're writing from
ea.oac.uci.edu, and yet on that system we have:

ea> uname -a
SunOS taurus.oac.uci.edu 5.5.1 Generic sun4u sparc SUNW,Ultra-2
ea> which perl5
/dcs/bin/perl5
ea> which cc
/opt/SUNWspro/bin/cc
ea> which gcc
/dcs/bin/gcc

What gives?
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: 12 Apr 1997 21:51:34 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Perl precompiled for Solaris 2.5
Message-Id: <5ip056$ltm$1@cinenews.claremont.edu>

Ricardo Antuna (riantuna@ea.oac.uci.edu) wrote:
: Is it possible to obtain this from somewhere?
: My systems does not have a c compiler and I can't get gcc installed on
: it.

http://smc.vnet.net/solaris_2.5.html

This site has a Solaris pkgadd format binary  of perl.  However, it also
has a pkgadd format copy of gcc-2.7.2.2 which is the latest version of
gcc so I'd recomend installing that and using it to compile anything
you need.  I usually get it, then use it to bootstrap a clean copy of
gcc, but you probably don't need to do that.  I mostly do it because
I don't like the place they install in (/opt/<something>) and becuase
it takes less then an hour to run configure and "make bootstrap" on
the Ultra2s I've been working on.

-- Brooks

--
Brooks Davis            +------------------------------------------------+
brdavis@hmc.edu         | "_Slackware_ [Linux] is the MacOS of UNIXes."  |
Harvey Mudd College     |                    -- Richard Garnish          |
340 E. Foothill Blvd.   |                       on alt.sysadmin.recovery |
Claremont, CA 91711     +------------------------------------------------+


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

Date: 12 Apr 1997 22:10:15 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: Perl-Books.
Message-Id: <5ip187$2kn@news.service.uci.edu>

[mailed, posted]

In article <8chghc1iuo.fsf@gadget.cscaper.com>,
Randal Schwartz  <merlyn@stonehenge.com> wrote:

>As much as I'd like that to be true, that's not the case.  The llama
>does *not* teach fundamental programming concepts, such as "what is a
>variable", "what is an array", and "why would I need a subroutine".

Just out of curiosity, what book >would< you (collectively) recommend
for this purpose?

Best,
Eric

-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Sat, 12 Apr 1997 17:28:30 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: Question on Strings [HELP]
Message-Id: <autopen-1204971728300001@l12.d22.quake.net>

Brett

I'm sure I'll be embarassed again for responding with much more simplistic
answers than the poster is looking for .... but why do you have to convert
your string of numbers to an integer?

shellx 30% shellx 30% perl5
$string_o_numbers = "12345";
$new_number = $string_o_numbers + 4;
print "Your new value is $new_number\n";
Your new value is 12349
shellx 31%

 For sorting or something?

shellx 34% perl5
@array = ("1", "2", "3", "20");
print sort(@array);
12203shellx
   . . . But no... you'd do something like this
      . .. . .
shellx 39% perl5
@array = ("1", "2", "3", "20");
sub numerically {$a<=> $b;}
print sort numerically @array;
print "\n";
12320
shellx 40%

I looked at 'int' but that doesn't seem like the right thing. Again I'm
probably missing the whole point. I thought perlies generally avoided  
data type'ing.

Laurel

p.s. Nice thing about the virtual community - I can feel dumb but you
never see me feelin' dumb.

In article <19970331040100.XAA10181@ladder01.news.aol.com>,
bretth3522@aol.com (BrettH3522) wrote:

> Is there any way to convert a string (of numbers to an integer).  If not,
> is there a way to convert an integer into a string?
>  Also, one last question. I am running Windows NT 4.0 with IIs server.  I
> can go into the registry and add a value in
> /System/Services/W3SVC/Parameters/ScriptMap to make perl.exe execute
> everytime a script is called.  I heard using the perlis.dll is better, but
> when I change the value to point to perlis.dll, it does not work.  I
> restart the server and go into netscape navigator 3.0 on another computer,
> instead of calling the perl script, it thinks I want to download it.  Any
> suggestions?  I would appreciate it if you could e-mail me at
> bretth3522@aol.com
> 
> Thank You, Brett Hamlin

-- 
        The Reader's Corner: Mystery, Romance, Fantasy 
         http://www.autopen.com/index.shtml 
     Subscribe to our free StoryBytes publication
 New: Fashion Challenges for the Time Traveling Heroine     http://www.autopen.com/romance.well.dressed.shtml


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

Date: Sat, 12 Apr 1997 21:08:18 GMT
From: giov@cidoc.iuav.unive.it (Giovanni Gigante)
Subject: reading from *two* sockets: how ?
Message-Id: <334ff866.1259389@news.vol.it>

I need to read from two different sockets at one time. But

$in = <SOCKET> ;

stops there on one socket until something appears. Is there any way to
avoid this block? Can I check if the socket has something for me
before actually reading from it?

Or any other way to work around this problem?

---
* Giovanni Gigante * IUAV Laboratory on Simulation    *
*                  * http://www.iuav.unive.it/~giovan *
* IRC: deepsky     * mail://giov@cidoc.iuav.unive.it  *


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

Date: 12 Apr 1997 16:15:00 -0700
From: Russ Allbery <rra@stanford.edu>
To: giov@cidoc.iuav.unive.it (Giovanni Gigante)
Subject: Re: reading from *two* sockets: how ?
Message-Id: <qumafn3kf4b.fsf@cyclone.stanford.edu>

[ Posted and mailed. ]

Giovanni Gigante <giov@cidoc.iuav.unive.it> writes:

> I need to read from two different sockets at one time. But

> $in = <SOCKET> ;

You've reached the point where you're going to have to bypass stdio.
You'll want to switch to sysread() and syswrite().

> stops there on one socket until something appears. Is there any way to
> avoid this block? Can I check if the socket has something for me before
> actually reading from it?

Yes.  See man perfunc, under select, and the examples in man perlipc.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>


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

Date: 12 Apr 1997 23:25:10 GMT
From: mharriso@utdallas.edu (Mark A Harrison)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5ip5km$qhh$1@news.utdallas.edu>

Henry Baker (hbaker@netcom.com) wrote:
: You make a good point about the importance of environments.  That's precisely
: the advantage of Lisp.  You get a uniform picture of the world -- everything
: is Lisp.  You don't have to know anything about machine language, assemblers,
: linkers, and all plethora of itty bitty 'tools' with <3-character names.
: You have the same language for writing macros, the same language for writing
: system code, the same language for writing scripts, the same language for
: writing editor extensions, the same language for interacting with windows,
: etc.

I think this is what was responsible for the diminishing influence
of Lisp... It's all-or-nothing, violating the principle "interoperate
or die."

Mark.

(PS, I like lisp)


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

Date: Sat, 12 Apr 1997 21:01:40 GMT
From: joel@zeptosoft.com (Joel Potischman)
Subject: Re: security without a secure server
Message-Id: <334ff4fb.57588937@news2.cnct.com>

(I missed the original post but I saw a reply. My apologies if this
has been discussed already.)

Any Perl script you write wouldn't be called until all the form data
was sent from the browser to the server. If you don't use SSL (Secure
Sockets Layer, aka https://whatever.com instead of
http://whatever.com), your data is not secure, no matter what your
Perl script does.

If you wrote your own Java/JavaScript/ActiveX encryption routine and
embedded it in the web page you could theoretically secure your credit
card data without an SSL server, but:

a) you'd have to do a LOT of work (I doubt anybody else has done such
a thing)
b) it probably wouldn't be as secure as SSL. In the case of
JavaScript, everybody would have your source code, which would make
hacking considerably easier.
c) if it *was* as secure as SSL, it might be illegal, since the applet
or script on your page would be considered strong encryption, which as
we all know is currently illegal to export due to stupid US laws.
Unless you could be sure you had prevented users from outside the US
and Canada from viewing your page, you would legally be considered an
arms smuggler!

If you need to secure credit card data, you really should use SSL. If
your server doesn't support it, find one that does. Once the data gets
securely to the server, you could write a script that calls PGP before
emailing the credit card data to you (I've seen public-domain scripts
that do that.) That would keep the data secure.

-joel

Russ Allbery <rra@stanford.edu> wrote:

>> Can I encrypt all or part of the form data from a credit card
>> transaction?
>
>> Are there scripts designed for this purpose?  
>
>> It would seem that even a simple encryption method were used, the
>> transaction would be far more secure than plain text.
>
>Any encryption scheme has to be supported by both the server (your CGI
>script and web server) *and* the client (the user's browser).  You're
>therefore limited to the security methods supported by common browsers
>such as Netscape, all of which to my knowledge require security to be
>implemented at the web server level.
>
>-- 
>Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>



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

Date: Fri, 11 Apr 1997 15:22:44 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Laurel Shimer <autopen@quake.net>
Subject: Re: Splitting Hairs, or strings, rather
Message-Id: <334EB9B4.6E87@egames.com>

[mail&post]
Laurel Shimer wrote:
> In article <3346dc89.16327060@news.inreach.com>, jkugler@inreach.com
> (Joshua J. Kugler) wrote:
> > Hi.  I am looking for some efficient code to split strings in to 100
> > character sub strings.  I was given some, and have been concocting
[snip]
> > @arr = &splitter($var)

> Been trying to figure out how to do Joshua's 'break a string into chunks
> of 100'  and so far having no luck.
[snip rampling about methods]
> But am I on the right track with this?

A concise way to do this would be:
  @arr = $var =~ /(.{1,100})/gs;

In an array context the /g modifier makes the match operator
return a list of all (...) enclosed matching subexpressions.
The /s just makes . also match newlines.  So /.{1,100}/
matches 1 to 100 of any character.  Because of regex greediness,
this will match 100 character chunks for each iteration of
the /g except for at the end of the string if its length
is not a multiple of 100.

However, any method using regular expressions is probably 
going to be slower than using substr or unpack.  Here's two
reasonbly efficient solutions:

sub splitter1 {
  my $str = shift;	# string to split
  my $size = shift;	# size of chunks
  my $l = length $str;
  my @result = ();
  for ($i=0; $i < $l; $i += $size) {
    push(@result, substr($str,$i,$size));
  }
  return @result;
}

sub splitter2 {
  my $str = shift;
  my $size = shift;
  return unpack("A$size"x(length($str)/$size).'A*', $str);
}

Feel free to benchmark them yourself (see Benchmark.pm) 
to figure out what's fastest.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"




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

Date: Sat, 12 Apr 1997 16:45:36 -1000
From: Bob Minnick <bobmi@digital-cafe.com>
Subject: Unexpected Behavior using open ()
Message-Id: <33503AC0.7EE2@digital-cafe.com>

Geetings,
 Can someone explain this behavior to me? It was unexpected to say the
least.

 Considering the following code fragment;

 if (open (FILE, "filename.dat)) ----> this works fine, opens the file
for reading.

 But when I wanted to open the file for reading & writing;

 if (open (FILE, "+>filename.dat))

 This statement allowed me to read the file, but it also emptied the
file! Can someone tell me why it emptied the file?

 Also, does anyone have any thoughts on file locking to prevent
concurrency problems? I am assembling a system which may require
multiple users to be accessing the same data file at the same time.
 If I can't get this thing to allow me to read a multiline file, and
rewrite a single line without having to rewrite the entire file, it's
going to be a nightmare. (ie file semaphoring)

 Any ideas, hints, thoughts would be appreciated.

	Thanks

-- 
Bob Minnick, President of Northern Webs (bobmi@digital-cafe.com)
Northern Webs, North Idaho's Web Design Studio/Presence Provider
     MEMBER OF THE INTERNET DEVELOPERS ASSOCIATION
     *** DEVELOPER OF FIVE NETGUIDE GOLD SITES ***
-------------------------------------------------------------------
http://www.digital-cafe.com/~webmaster/norweb01.htm (our home)
http://www.digital-cafe.com/~webmaster/webdir.shtml (our directory)
http://www.digital-cafe.com/~webmaster/webhome.html (our emall)


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

Date: 13 Apr 1997 01:38:51 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Unexpected Behavior using open ()
Message-Id: <5ipdfb$clr@fridge-nf0.shore.net>

Bob Minnick (bobmi@digital-cafe.com) wrote:

:  if (open (FILE, "+>filename.dat))

:  This statement allowed me to read the file, but it also emptied the
: file! Can someone tell me why it emptied the file?

Of course.  +> tells open to create/read the file, so you're probably
looking for +<, which can read/write a file, but will fail if the
file doesn't exist.  You'll read (in the FAQ) and other Perl
documentation that it might be best to read from fileA, write to fileB,
then rename fileB to fileA.

:  Also, does anyone have any thoughts on file locking to prevent
: concurrency problems? I am assembling a system which may require
: multiple users to be accessing the same data file at the same time.

Definitely review some documentation about flock().

:  If I can't get this thing to allow me to read a multiline file, and
: rewrite a single line without having to rewrite the entire file, it's
: going to be a nightmare. (ie file semaphoring)

Sure, you can use +< and output a single line, but writing to a new
file and renaming is preferable.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 12 Apr 1997 17:49:11 -0400
From: otto@gauss.math.brown.edu (Ottavio G. Rizzo)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <sflo6n29pk.fsf@gauss.math.brown.edu>

"Tim Behrendsen" <tim@a-sis.com> writes:

> And what makes you think that "hard work" and a "worthwhile and
> happy life" are unrelated?  Hard work is what *makes* life
> worthwhile.  The most miserable people I know are the ones who
> just float through life without any making any contributions or
> doing anything constructive.

Ah, the old good protestant work ethic... 
"hard work" and "life" are certainly related: they exclude each other :-)

Why is this on comp.os.linux.advocacy?!?

-- 
Ottavio G. Rizzo                          diceno `e nuje ca nun c'e' maje
Dep. of Maths, box 1917                   piaciuto `e fatica' \\ pecche' `o
Brown University, Providence RI USA       tiempo e' vita e vulimmo campa'
Phone +401 863 7957 Fax: +401 863 9013                    Almamegretta
otto@math.brown.edu                 


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

Date: Sat, 12 Apr 1997 16:53:58 GMT
From: mdplumber@jax.mindspring.com (M-P)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <3355be1e.29821190@news.jax.mindspring.com>

otto@gauss.math.brown.edu (Ottavio G. Rizzo) wrote:

>"Tim Behrendsen" <tim@a-sis.com> writes:
>
>> And what makes you think that "hard work" and a "worthwhile and
>> happy life" are unrelated?  Hard work is what *makes* life
>> worthwhile.  The most miserable people I know are the ones who
>> just float through life without any making any contributions or
>> doing anything constructive.
>
>Ah, the old good protestant work ethic... 
>"hard work" and "life" are certainly related: they exclude each other :-)
>
>Why is this on comp.os.linux.advocacy?!?
>
>-- 
>Ottavio G. Rizzo                          diceno `e nuje ca nun c'e' maje
>Dep. of Maths, box 1917                   piaciuto `e fatica' \\ pecche' `o
>Brown University, Providence RI USA       tiempo e' vita e vulimmo campa'
>Phone +401 863 7957 Fax: +401 863 9013                    Almamegretta
>otto@math.brown.edu                 


ME TOO!


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

Date: Fri, 11 Apr 1997 15:31:02 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Laurent_Filhol@HP-France-om8.om.hp.com
Subject: Re: Win32::ODBC  : need help!
Message-Id: <334EBBA6.49D8@egames.com>

[mail&post]
Laurent_Filhol@HP-France-om8.om.hp.com wrote:
> I've just downloaded  Win32::ODBC and I have followed the instruction to
> install it
> so, the ODBC.pm and the odbc.pll are in the right place
> But when I write a simple Perl Script, the compilation aborted on the
> line:
> use Win32::ODBC
> 
> I have this:
> Can't locate Win32/ODBC.pm in @INC at C:\dbWeb\NTCCdata\script\form1.pl
> line 15.

The message says that perl can't find the module anywhere in the
list of paths it knows to look for modules.  This tells me
that you have not put ODBC.pm in the correct place when you
installed it.  It belongs in the Win32 subdirectory of the
default perl /lib directory -- if you installed perl in
C:\perl, ODBC.pm should be in c:\perl\lib\win32\.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



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

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

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