[6391] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 16 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 26 13:27:19 1997

Date: Wed, 26 Feb 97 10:00:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 Feb 1997     Volume: 8 Number: 16

Today's topics:
     'newgrp' within perl script? <Christoph_Marquardt@bbn.hp.com>
     Re: >> processes <rra@cs.stanford.edu>
     [Q] Two pipes <vegardb@knoll.hibu.no>
     A very novice question (Avi)
     build303 ----------------- <C-A-T-S@c-a-t-s.demon.co.uk>
     Re: build303 ----------------- (Nathan V. Patwardhan)
     Re: Calling html page from perl script????? <nw@hydaspes.if.org>
     Re: Can you create file on the fly with perl? (Mike Stok)
     Re: Can you create file on the fly with perl? (Nathan V. Patwardhan)
     CGI.pm and Cookie Retrieval <Paul@aog-design.com>
     Re: compiling perl <seay@absyss.fr>
     Re: difference btw s/// & tr/// (Alan Ezust)
     Re: double fork? <gilh@sysdep.elex.co.il>
     Re: e5 (Steve Ebener)
     Re: Email Problem <rra@cs.stanford.edu>
     Re: File Locking (Jamie Hoglund)
     Forms AHHHH...Help !!! (Mark R Arnold)
     Re: futur de perl et java-script (djf)
     Re: Handling signals without dieing (Tom Grydeland)
     Re: Help with variation of form-mail.pl (Nathan V. Patwardhan)
     help: date to time conversion (Paul Rayson)
     Re: how long before I can put down the books? (Herbert Wollman)
     Re: Install Perl for Win32 (Jarle Aasland)
     Re: Installing Perl modules without write access to Per (Nathan V. Patwardhan)
     Re: Multi-line processing (Georg Wittig)
     multiple mail box mail notification? (Jose Unpingco)
     need help ... make test failed when installing perl (DINESH PUNJABI)
     Re: need help <gilh@sysdep.elex.co.il>
     Need some assistance <ddunks@sw.cybersurf.de>
     Re: Need some assistance (Mike Stok)
     Re: Object Perl Method (Honza Pazdziora)
     Re: Oracle DB Access from PERL 5!! (Mike Stok)
     Re: Overloading perl object methods, Howto ? (Alan Ezust)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Wed, 26 Feb 1997 15:49:40 +0100
From: Christoph Marquardt <Christoph_Marquardt@bbn.hp.com>
Subject: 'newgrp' within perl script?
Message-Id: <33144D84.22C7@bbn.hp.com>

I need to perform a system("...") or a backtick execution from within a
perl script as a member of a different group.

The user the script runs as has 'newgrp' capabilities on the shell.

Anyone?

Please mail to chrism@bbn.hp.com & besi@bbn.hp.com

 Thanks a bundle!

 Christoph

-- 
 Hewlett Packard GmbH       email: Christoph_Marquardt@bbn.hp.com  
     Network & System       voice: (49)7031-147846 (HP: 778-7846)
  Management Division         fax: (49)7031-141388 (HP: 778-1388)
 This message does not necessarily reflect my employer's opinions

   "Talking about music is like dancing about architecture" - FZ


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

Date: 26 Feb 1997 08:11:14 -0800
From: Russ Allbery <rra@cs.stanford.edu>
To: schwyn@amiga.icu.net.ch (Sven Schwyn)
Subject: Re: >> processes
Message-Id: <qumybcby2cd.fsf@cyclone.stanford.edu>

[ Posted and mailed. ]

Sven Schwyn <schwyn@amiga.icu.net.ch> writes:

> I need some Perl-script that invokes a command as a detached process
> (the way nohup does) and then quits, leaving the detached process
> running. Later, another Perl-script should check, whether this detached
> process is still alive. BUT: This second script does NOT know the pid of
> the detached process, it just knows the owner of the process and the
> name of the command running.  (The command mentioned is the mailserver
> itself and is NOT allowed to be running more than once by rule.)

This is an ugly problem, particularly from a portability standpoint.
Basically, you need to do in your script what the command ps does.  The
best bet is probably to just run ps and parse the output, which
unfortunately is rather platform-specific.  You often can't just duplicate
the action of ps in your script because ps often requires special
permissions to run, inspects kernel data structures, or at the least
accesses data structures which are *highly* kernel-dependent.

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


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

Date: Wed, 26 Feb 1997 15:53:06 +0100
From: Vegard Bakke <vegardb@knoll.hibu.no>
Subject: [Q] Two pipes
Message-Id: <33144E52.491F@knoll.hibu.no>

I would like to have two sockets. And I don't know which one
is the next to ask me something.

How do I do that?


Vegard

-- 
                           Vegard Bakke,
                       vegard.bakke@hibu.no
               Kirkegata 9, 3600 Kongsberg, Norway

   "My spelling is Wobbly.  It's good spelling but it Wobbles, 
and the letters get in the wrong places."      --  Winnie the Pooh


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

Date: Wed, 26 Feb 1997 15:59:20 GMT
From: avi@tase.co.il (Avi)
Subject: A very novice question
Message-Id: <33145cbf.8620195@news.ibm.net.il>

Hello !

Here is a very novice question.

I want to remove trailing and leading spaces from a string.

i.e:

"   this is the input   ";

"this is the output";

Just can't figure how to do it... :-(
I will appriciate if you will e-mail the answer as well to
avi@tase.co.il

Thanks !

Avi




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

Date: Wed, 26 Feb 1997 14:09:25 +0000
From: Tony Facey <C-A-T-S@c-a-t-s.demon.co.uk>
Subject: build303 -----------------
Message-Id: <aqY9nLAVQEFzEwdb@c-a-t-s.demon.co.uk>


I have downloaded build303 as suggested ( I take it that it is a stand
alone program ). I have tried running a few scripts, in dos and it seems
to work. (I think).  Upon running script it does not return any errors,
Which i suppose is good. I can't seem to get any output from the
program, as in there is nothing to see when a script is run..

Am i doing somthing wrong?

is there somthing else i should be doing?

I normally type: perl progname.pm

Please help....

it's causing me hell.

Many Thanks.

Please e-mail as i am behind on Newnews


stay happy and in-contact

Pentium 120 / Windows 95 / 1 gig mem / zip drive / umax scanner / Epson color 
500 and i still can't figure out perl :)

http://www.c-a-t-s.demon.co.uk


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

Date: 26 Feb 1997 14:38:27 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: build303 -----------------
Message-Id: <5f1ht3$bf0@fridge-nf0.shore.net>

Tony Facey (C-A-T-S@c-a-t-s.demon.co.uk) wrote:


: I normally type: perl progname.pm

 .pm is usually the extension for Perl modules.  .pl is an extension many
people use for perl scripts.

It would be a bonus if you could post some of your code for us, as your
problem could be anywhere.

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: Wed, 26 Feb 1997 09:45:57 -0600
From: Nathan Wagner <nw@hydaspes.if.org>
Subject: Re: Calling html page from perl script?????
Message-Id: <33145AB5.C47@hydaspes.if.org>

12345678901234567890123456789012345678901234567890123456789012345678901234567890
Daniel DuBois wrote:
> 
> On 13 Feb 1997 09:01:56 -0500, nelson <nmljn@wombat.staff.ichange.com>
> wrote:
> 
> >The reason that is not working is because you are not terminating it
> >with two newlines.  Say this instead:
> >
> >print STDOUT "Location: http://www.axial.co.uk/netx_webx_dnld.html\n\n";
> 
> It's not pragmatically necessary, but to be anal, I believe that should be
> print STDOUT "Location: http://www.axial.co.uk/n...html\r\n\r\n";
> 
> The widely-ignored HTTP specifications indicate that only a CRLF is the
> acceptable header delimiter.  A good web server would intercept the output
> of a script that did the above and translate the lines into CRLFCRLF from
> CRCR, but I highly suspect most web servers aren't that good.
> 
> And since just about everyone ignores the CRLF requirement, pretty much all
> browsers and clients have robust parsers that will handle lone CRs, and
> maybe even lone LFs for some uncompliant Mac servers, so again, it's not
> pragmatically necessary.  (It's just the one thing I have knowledge of that
> I can point out how smart I am and go neener neener every once in a while.
> Yeah, it's pretty pathetic of me.)

I have run across one http proxy server on a firewall that choked on a perl
script that just sent newlines.  It seems it was looking for the CRLF pair
to check the headers, and the server on the outside wasn't translating the
output of the perl script.  We had a hell of a time tracking it down.

-- 
nathan wagner
nw@hydaspes.if.org


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

Date: 26 Feb 1997 12:24:10 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Can you create file on the fly with perl?
Message-Id: <5f1a1a$alv@news-central.tiac.net>

In article <5evc2d$4m0@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>What's wrong with doing:
>
>open(NEWFILE, ">$filename") || die("No: $!\n");
>close(NEWFILE);

The above code is just an example snippet, I know.  But...

Nothing's wrong except for the dubious die.  If you put a \n on the end of
the die then perl doesn't supply any information about file name and line
number to help you track down where the script blew up. 

In general error messages seem aimed at 2 classes of people, developers
who might be interested in file names and line numbers, and users who are
much more interested in what went wrong and not where.

I have come across scripts where pretty much all of the operations which
were tested for failure ended up calling

  die "$!\n";

which made debugging harder than it might have been.

I prefer things like

  open FILE, ">$filename" or die "$0: couldn't open $filename to write ($!)\n";

with or without the \n

Just an opinion,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 26 Feb 1997 14:22:49 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Can you create file on the fly with perl?
Message-Id: <5f1gvp$bf0@fridge-nf0.shore.net>

Mike Stok (mike@stok.co.uk) wrote:

: Nothing's wrong except for the dubious die.  If you put a \n on the end of
: the die then perl doesn't supply any information about file name and line
: number to help you track down where the script blew up. 

True.  All I really want from errors is a basic error message that gives
me an idea where the program failed.  For example, I'll usually mark
the die() with some discerning text:

opendir(DIR, "$thisdir") || die("directory: $thisdir error: $!\n");

open(FILE, "$file") || die("File: $file error: $!\n");

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: Wed, 26 Feb 1997 10:23:07 -0500
From: Paul Hardin <Paul@aog-design.com>
Subject: CGI.pm and Cookie Retrieval
Message-Id: <33145558.6A26@aog-design.com>

Hi,

I am using CGI.pm on a unix box to do work with cookies. I am having the
following problem:

	 Sending cookies works fine, I can see the little buggers in my
Netscape Cookie file after closing Netscape down.
	 Retrieving the cookie doesn't work.

Here is a snippet of my code. I always get a failed check for
'%gotcookie'.

========================Code by the masses=========================
#!/usr/local/bin/perl

use CGI qw(:standard);

$query = new CGI;

# This should return the cookie contents of telecookie2
%gotcookie = cookie(-name=>'telecookie2');

# If there was no cookie, send one up.
if (!%gotcookie){
        $mycookie = cookie(-name=>'telecookie2',
                        -value=>'Have a nice Day',
                        -expires=>'+1d');


        print header(-cookie=>$mycookie,
                -expires=>'now');
        }else {print header(-expires=>'now');}

 ...Do some Important Stuff(tm)...

exit (0);

========================End Code============================

Any help will, of course, be appreciated. 8^)

Paul Hardin
AOG Software
Montreal Quebec


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

Date: Wed, 26 Feb 1997 14:45:12 +0000
From: Douglas Seay <seay@absyss.fr>
To: NT_server <mb420@hi.ft.hse.nl>
Subject: Re: compiling perl
Message-Id: <33144C78.1839@absyss.fr>

NT_server wrote:
> 
> how ?????
> 
> how do you compile perl scripts. Is there a compiler available ?
> 
> Thanks, Allard
> awp@poboxes.com


normally perl is run a load-and-go (compile to memory) system
that scans the input once, builds an internal image and executes
from the image.

a perl compiler does exists that can generate C code. the last
time I checked it was version a3 (alpha).  there is info at
http://mox.perl.com/ about the compiler.  the source is on CPAN.
don't expect any real increase in speed, but the binary should
load a bit faster (no compile time). i don't remember how well
it handles things like eval().

doug seay
seay@absyss.fr


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

Date: 26 Feb 1997 10:21:34 -0500
From: ezust@learnix.ca (Alan Ezust)
Subject: Re: difference btw s/// & tr///
Message-Id: <5f1kdu$31t@sparky.learnix.ca>

In article <adelton.856199138@aisa.fi.muni.cz>,
Honza Pazdziora <adelton@fi.muni.cz> wrote:
>> My first reaction to the tr-function was to try something like this, which
>> would be ideal for a lot of my text work:
>> 
>> tr/(ab)(cd)(ef)(gh)/ijkl/;
>> 
>> The idea was to translate certain character combinations into single
>> characters (ab -> i, cd -> j...). I doesn't work however. :-( I had to use
>> more cumbersome s-functions.
>
>I hope you can still do
>
>tr/abcdefgh/iijjkkll/;

That won't compress two characters into one.

with your approach,
ab maps to ii
cd maps to jj
fe and ef both map to kk

But there is an option for "tr" called I believe "s" which squeezes out
multiple occurances of the substitute characters. So for example,

tr/abcdefgh/iijjkkll/s;

ab maps to i
cd maps to j
ef maps to k

but unfortunately, this also maps permutations of the source characters, so

bb maps to i
aaaa maps to i
abababa maps to i
babbba maps to i

So maybe it's not what you want either.


-- 
Alan Ezust, Senior Instructor      ezust@learnix.ca       Toronto, Canada
(416) 486-0596 x 225 (voice)  http://www.learnix.ca  (416) 486-1754 (fax)
-------------------------------------------------------------------------
          "In cyberspace, no-one can hear you scream" -Zippy


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

Date: Wed, 26 Feb 1997 15:20:35 GMT
From: SHILUV Gil Hirsch 5810 <gilh@sysdep.elex.co.il>
Subject: Re: double fork?
Message-Id: <331454C3.F77@sysdep.elex.co.il>

Kin Cho wrote:
> 
> I'd like to start an xterm via the system() in my perl script
> but I'd like the rest of my perl script to continue without blocking.
> 
> I tried the double fork trick described in FORK in the PERLFUNC online
> reference without success:
> 
> unless ($pid = fork) {
>     unless (fork) {
>        exec 'xterm';
>        die "no exec";
>        exit 0;
>     }
>     exit 0;
> }
> waitpid($pid,0);
> print "hello\n";
> 
> When this script is run, "hello" is printed, but nothing else happens.
> "exec 'xterm';" does work by itself.
> 
> -kin
> 
> --
> Kin Cho, Staff Engineer (408)542-1644 Fax (408)542-1958
> Integrated Systems Inc., 201 Moffett Park Drive, Sunnyvale, CA 94089
> http://www.isi.com
> 
> I'll procrastinate tomorrow
>                                 -- Garfield.

The problem with the above script is that you're 'waiting' for the child
process to finish (as every concerned father should...). The trick is to
initiate the 'wait' only when the child process finishes (and sends the
CHLD/CLD signal to the parent process). In other words, try this:

$SIG{CHLD} = \&killZombie;    #redefine the CHLD signal

if(($pid = fork()) == 0) {
	exec 'xterm';  	      #or system("xterm");
	#REST OF YOUR CODE
	#WITHIN THE FORK SCOPE
	exit 0;        	      #not realy needed, but always good to have
}

sub killZombie { 	      #wait for a child process
        wait;
        $SIG{CLD} = \&killZombie;
}

Hope this helps,
	Gil Hirsch (gilh@sysdep.elex.co.il).


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

Date: Wed, 26 Feb 1997 01:47:47 -0800
From: greyland@continet.com (Steve Ebener)
Subject: Re: e5
Message-Id: <19970226014747621641@dialup008.continet.com>

Russell Leach {78830} <rfl@localhost.enet.dec.com> wrote:

> Hit!
> 
> You sunk my battleship!

  Rats. I was _aiming_ at your sub...  :) 
-- 
Steve Ebener 
Greyland - greyland@continet.com 
541/744-0568  
Macintosh Consulting & Troubleshooting 


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

Date: 26 Feb 1997 07:50:00 -0800
From: Russ Allbery <rra@cs.stanford.edu>
Subject: Re: Email Problem
Message-Id: <qumbu97zhw7.fsf@cyclone.stanford.edu>

Neil S Briscoe <neilb@zetnet.co.uk> writes:

> Yes.  Don't use the mail program to send mail.  Get libnet module from
> your local CPAN site and use Net::SMTP.  Then you can control all the
> headers you put in your mail.

Ugh.  Sending mail through a network SMTP connection when you don't have
to is needless complexity, as is requiring a set of modules to be
installed in order to run your script.

For 99% of the applications in which you want to send e-mail from a Unix
application, all you need to do is just something like:

open (MAIL, '/usr/lib/sendmail -t -oi -oem') or die "can't fork: $!";

and then print the message to MAIL, headers first followed by a blank
line, and let sendmail pick up the recipient from the To: and Cc: headers
in the actual message.  It's safe, it doesn't get confused by weird
characters, and it doesn't require you to deal with finding a mail server
to bounce mail off of or worry about MX hosts.

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


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

Date: 26 Feb 1997 13:26:33 GMT
From: jhoglund@skypoint.com (Jamie Hoglund)
Subject: Re: File Locking
Message-Id: <5f1dm9$13$1@shadow.skypoint.net>

John Boekhout (boekhout@azww.com) wrote:
:      $counter = "/home/shishir/counter.dat";
:      print "Content-type: text/plain", "\n\n";

:      open (FILE, $counter) || die "Cannot read from the
: counter file.\n";
:      flock (FILE, 2);   #step 1
:      $visitors = <FILE>;
:      flock (FILE, 8);  #step 2
:      close (FILE);

:      open (FILE, ">" . $counter) || die "Cannot write to
: counter file.\n";
:      flock (FILE, 2);
:      print FILE $visitors;
:      flock (FILE, 8);
:      close (FILE);

: My question is, what good did it do to lock the file at step
: 1 when it is unlocked at step 2 before writing out the new
: counter value?  Why wasn't the file kept locked before
: reading and then unlocked after writing out the new counter
: value.

: I'm guessing I just don't understand what flock does???

: Also, I spent quite a while searching the Perl web site for
: a clear description of what flock does, and couldn't find
: it.  Any description of flock just said "calls flock(2) on
: filehandle" and "see manual page for flock(2)" neither of
: which could be found (by me).  Any help finding this info
: would be appreciated.

I'll admit, I'm stumped too. :-)

Seems to me it should be something like:

  open(FILE,"+>filename"); 
  flock(FILE,2); 
  $count=<FILE>; 
  chop $count;
  ++$count; 
  seek(FILE,0,0); 
  print FILE,"$counter\n"; 
  flock(FILE,8);
  close(FILE); 

But I don't know, file locking is such a confusing issue, what seems to 
work is always proven not to work later on. I'm stumped too. 

I had a CGI book suggest using lock files, and I posted some stuff about 
it once. Someone reading this newsgroup was nice enough to point out the 
flaw. The above was taken (from memory) out of a web page.

Jamie


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

Date: Wed, 26 Feb 1997 15:10:53 GMT
From: mark@channelzero.demon.co.uk (Mark R Arnold)
Subject: Forms AHHHH...Help !!!
Message-Id: <3315518f.1678832@news.demon.co.uk>

This is rather sad, i need desperate help with creating html forms. I
can create the front end (ie. the actual bit where the user types in
the info.) but i can't get it to process and e-mail the info to the
address that i give it.

Anybody help!
Thanks Mark


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

Date: 26 Feb 1997 06:12:50 GMT
From: djf@bnr.ca (djf)
Subject: Re: futur de perl et java-script
Message-Id: <5f0k92$572@bmerhc5e.bnr.ca>

In article <E64A94.8uE@midway.uchicago.edu>,
Tim Pierce  <twpierce+usenet@mail.bsd.uchicago.edu> wrote:
>... [deletia]
>guest!  In the meantime, I have missed the ``no furriners need
>apply'' sign on the front door.  Had I known, I would not have
>soiled your linens with my mongrel heritage.
>

Strange, can't recall those words in the previous posts...

>...
>Posts in foreign languages are not likely to be of much interest
>to me, but they may motivate me to learn something.  

Hmmm... Voulez-vous faire beaucoup d'argent rapidement...? ;) 

IMNQSVO, these groups have become more than noisy enough.  I know French
well enough to understand the posts, so it's not a personal thing.  The
"Just skip over them" response ultimately applies equally well to the
"Noobie-Doobie-Doo needs CGI help NOW!!!"  "Make Money Fast!!!" and
"XXXXXXXX Red Hot Virgins XXXXXXXXX!!!" posts, no?  

There IS a valid (well, maybe) audience for ALL of them, but they're
*better* posted where reach the widest intended audience, and consume the
least amount of others' resources.  As a last resort, I have no problem
with a foreign language post.  A thread on religious topics like Perl
versus Javascript doesn't fit this bill for me though.

<soapbox off>

Duane Fowler
Nortel Canada


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

Date: 26 Feb 1997 09:08:29 GMT
From: tom@palver.nospam.eiscat.no (Tom Grydeland)
Subject: Re: Handling signals without dieing
Message-Id: <TOM.97Feb26100829@palver.nospam.eiscat.no>

In article <33137024.36DA@fnal.gov> Elliott McCrory <mccrory@fnal.gov> writes:

> I want to set an alarm in perl 5.003, do something and then continue on,
> until the next alarm comes.  I have this snippet:
> 
> while (<>) {
>     print "Line read $_";
>     alarm $sec;			# Wait some more
> }


> Program dies *immediately* after execution of &mysub.

Yes, your <> read is interrupted, and you'll have $! set to
"Interrupted system call" or something similar, while $_ is set to
undef, the loop termination condition.

> How do I return from &mysub without killing the program?

I had a similar problem when using IO::Socket, I went from

while(@ready = $Sel->can_read) {
    # ...
}

to

while () {
    my @ready = $Sel->can_read;
    # ...
}

I suppose you could do something along the same lines, i.e.

while () {
    if (!($_ = <>) && !($!)) {
        # No input and no errors, that means end of input
        last;
    }
    # ...
}


> Elliott S. McCrory, Ph. D.	| mccrory@fnal.gov
-- 
//Tom Grydeland <Tom@nospam.eiscat.no>  # delete 'nospam.' for valid address
                The case of Randal Schwartz - http://www.lightlink.com/fors/


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

Date: 26 Feb 1997 14:26:04 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Help with variation of form-mail.pl
Message-Id: <5f1h5s$bf0@fridge-nf0.shore.net>

Vinh Ha (vha@apc.net) wrote:

: I need to write a script that will allow a user to attach a file within
: a form.  That will then be mailed along with the form input to my
: email...any suggestions?

(1) Check out the LWP MIME modules from http://www.perl.com/CPAN/ in the
    modules/by-module section
(2) CGI questions belong in comp.infosystems.www.authoring.cgi

Best of luck!

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: Wed, 26 Feb 1997 13:26:37 GMT
From: paul@comp.lancs.ac.uk (Paul Rayson)
Subject: help: date to time conversion
Message-Id: <E67pCD.GIH@comp.lancs.ac.uk>


I want to convert a string 'Wed Feb 26 13:17:09 GMT 1997' to a time
stamp (number of seconds since 1970) in order to compare dates. I've
looked at localtime and timelocal and so on, but I think I need the
reverse of ctime. Has this already been done anywhere?

Thanks,
Paul.

-- 
[]EMAIL: paul@comp.lancs.ac.uk [] Post: CSEG Research Centre,  []
[]Phone: +44 1524 65201        []       Computing Department,  []
[]       extension 3262        []       Lancaster University,  []
[]Fax  : +44 1524 593608       []       Lancaster, LA1 4YR, UK.[]


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

Date: 26 Feb 1997 16:32:38 GMT
From: hwollman@mitre.org (Herbert Wollman)
Subject: Re: how long before I can put down the books?
Message-Id: <5f1oj6$ii0@top.mitre.org>

In article <5es4ii$flh@news.interpath.net>,
   softbase@mercury.interpath.com (Scott McMahan - Softbase Systems) wrote:
>Richard Morin (qnc496@joanrich.kite.ml.org) wrote:
>: Hi folks, Sorry for the non-specific question, but I'm kinda 
>: curious about something.  How long before most folks felt even
>: slightly proficient and could take the llama and camel books 
>: off the desk beside them?
>
>We'll let you know if it ever happens.
>
>I use C, Java, JavaScript, perl, several shell languages, and Delphi.
>Now, I'm having to relearn C++. It's almost impossible not to have to
>re-learn any individual language every time you sit down to use it.
>
>Scott
>
Based on 35 years of programming experience, I suspect that you will start 
programming in another language BEFORE that happens.  The cycle repeats, the 
cycle repeats, the cycle repeats, .....


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

Date: Wed, 26 Feb 1997 10:40:38 GMT
From: sajaa@sn.no (Jarle Aasland)
Subject: Re: Install Perl for Win32
Message-Id: <3315124b.15430322@news.eunet.no>

>Any help would be greatly appreciated.
>
At first, it looks as if everything is done correctly. However, take a
look at "Configuring and Testing a PERL Script with IIS" at Microsoft:
http://www.microsoft.com/kb/articles/q150/6/29.htm

Which Perl-version are you using? (I highly recommend the one found at
http://www.activeware.com/) 

I am running it under NT 4.0 and IIS 3.0 without any problems
whatsoever.

Good luck!

Jarle Aasland
NORWAY



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

Date: 26 Feb 1997 14:29:19 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Installing Perl modules without write access to Perl tree.
Message-Id: <5f1hbv$bf0@fridge-nf0.shore.net>

Lloyd Zusman (ljz@asfast.com) wrote:

: Sometimes, we non-sysadmin types find some really neat modules from
: CPAN that we'd like to use.  We know how to download these modules,
: unpack them, and then run the sequence ...

I've usually edited the Makefile after running perl Makefile.PL.  I set
my base directory (/home/whatever) as $(PREFIX).  When I run make install,
the libs go in the place where I want them.

Then, after installing the module/libs, you can do use lib or whatever...

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: 26 Feb 1997 10:24:36 +0100
From: wittig@omega.gmd.de (Georg Wittig)
Subject: Re: Multi-line processing
Message-Id: <5f0vgk$reb@omega.gmd.de>

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

; ; This is included in the perlop man page (surely you read it!?), or just 
; from the command line:
; 
;   perl -0777 -pe 's{/\*.*?\*/}{}gs' foo.c


Sorry to correct a perl GURU  :-)

		printf ("/* abc %s\n", mystring);  /* some comment */
will be translated to
		printf ("

-- 
Georg Wittig	GMD			email:Georg.Wittig@gmd.de
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Vern|nftige Leute verwenden aber sowieso GNU-Tools.	(K. Koehntopp)


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

Date: 26 Feb 1997 15:36:16 GMT
From: u13839@pauline.sdsc.edu (Jose Unpingco)
Subject: multiple mail box mail notification?
Message-Id: <5f1l9g$go6@rosebud.sdsc.edu>


hi,

I use filters to put my mail into many different mailbox files
automatically. What I'd like is to be notified every time I log in of
which mailbox has some new mail. For example, when I log in, I'd like
to see a message like

   You have 5 new messages in ~/Mail/one 
   You have 7 new messages in ~/Mail/two

or something like that. Can anyone give me a hint on how to get
started writing a PERL program to do this?

thanks.


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

Date: 26 Feb 1997 00:53:00 -0700
From: dpunjabi@nyx.cs.du.edu (DINESH PUNJABI)
Subject: need help ... make test failed when installing perl
Message-Id: <5f0q4s$r93@nyx.cs.du.edu>

Greetings,

I am trying to install Perl5.003 on a sun0s
machine.

I get the following 2 erros when running make
test. Can you help ? Your email advice will ebe
highly appreciated.

Rgds

Dinesh

 .
 .
 .
op/glob........ok
op/goto........ok
op/groups......FAILED on test 1
op/index.......ok
op/int.........ok   
 .
 .
lib/gdbm.......ok
lib/ndbm.......ok
lib/odbm.......ok
lib/posix......ld.so: Undefined symbol: _tzname
FAILED on test 0
lib/safe.......ok
lib/sdbm.......ok                                                             
lib/socket.....ok
lib/soundex....ok
Failed 2/94 tests, 97.87% okay.
*** Error code 29 (ignored) 
 .
 .
-- 

Dinesh Punjabi 
dpunjabi@nyx.cs.du.edu                Work: (303)-624-9812


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

Date: Wed, 26 Feb 1997 14:50:08 GMT
From: SHILUV Gil Hirsch 5810 <gilh@sysdep.elex.co.il>
Subject: Re: need help
Message-Id: <33144DA0.2C81@sysdep.elex.co.il>

yncera@ids2.idsonline.com wrote:
> 
> If I put  $Imput=<> it will wait there until I hit any keys follow by
> the enter key. How can I get only just one key without having to use
> the enter key. I am using Perl 5.
> Julio

The function getc should do the trick. Try:
$Input = getc(FILEHANDLE);
or in your case:
$Input = getc;

You can also try the Term::ReadKey module, available at a CPAN near you
(www.perl.com/CPAN).

Hope this helps,
	Gil Hirsch (gilh@sysdep.elex.co.il).


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

Date: 24 Feb 1997 23:31:53 GMT
From: "Douglas Dunks" <ddunks@sw.cybersurf.de>
Subject: Need some assistance
Message-Id: <01bc22aa$f2bba620$890558c3@CYBERsurf>

Hello,

Before I get flamed by everyone on this newsgroup, let me apologize for the
intrusion.  I don't know where else to turn to.

I downloaded the redirect.pl script written by Carlos A. Pero 10/22/95.

But when I run the script I get a response of:

can't find string terminator "EndResponse" anywhere before EOF at line 23

Is there anyone out there who could provide me some assistance, with this
script.

I would appreciate it.

Thanx,

D. Dunks


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

Date: 26 Feb 1997 11:44:47 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Need some assistance
Message-Id: <5f17nf$98s@news-central.tiac.net>

In article <01bc22aa$f2bba620$890558c3@CYBERsurf>,
Douglas Dunks <ddunks@sw.cybersurf.de> wrote:
>Hello,
>
>Before I get flamed by everyone on this newsgroup, let me apologize for the
>intrusion.  I don't know where else to turn to.
>
>I downloaded the redirect.pl script written by Carlos A. Pero 10/22/95.
>
>But when I run the script I get a response of:
>
>can't find string terminator "EndResponse" anywhere before EOF at line 23

This is typically caused by a missing or mangled string which should have
been the marker for the end of a here document.  The following script will
not work as there's a space (well, there should be...) at the end of the
4th line:

#!/usr/local/bin/perl -w

print <<EndResponse ;
Here's a response
EndResponse 
print "all done\n";
__END__

If you remove the space it'll work.  Maybe when you downloaded it you have
some extra whitespace (e.g. ^M characters if you doenloaded an MS-DOS text
file to a unix style system in binary)

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Wed, 26 Feb 1997 12:26:06 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Object Perl Method
Message-Id: <adelton.856959966@aisa.fi.muni.cz>

Ajitesh Das <baku@india.ti.com> writes:

> Can anyboby tell me the exact ( with a eg ) differences 
> between "Class method" and "Instance method"? 

See Programming Perl, pp. 293 and 294.

A class method expects a class (package) name as its first argument.
These methods provide functionality for the class as a whole, not for
any individual object instance belonging to the class ...

An instance method expects an object reference as its first argument.
It uses this reference to access data of one instace of the object.

So class methods do not work on specific (instance) data, even if they
may create one, constructors for example. Instance methods are likely
to do something with the data referenced by the first argument.

Hope this made it clear.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 26 Feb 1997 13:24:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Oracle DB Access from PERL 5!!
Message-Id: <5f1di8$ehk@news-central.tiac.net>

In article <3313741E.799B@lds.com>, Michael Shannon  <mshannon@lds.com> wrote:
>Hi,
>
>I was wondering if anyone knew anything about accessing an Oracle
>database stored procedures from Perl. I know there existed an Oraperl
>for Perl4.0, but apprently this was not updated for Perl 5.

You might be interested at looking at the DBI/DBD work available for perl
5.xxx.  DBI is an abstracted interface to SQL databases, and DBDs are
database drivers which allow the DBI to interact with real databases.
Check out http://www.hermetica.com/ for more information and pointers to
the latest software.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 26 Feb 1997 10:54:13 -0500
From: ezust@learnix.ca (Alan Ezust)
Subject: Re: Overloading perl object methods, Howto ?
Message-Id: <5f1mb5$454@sparky.learnix.ca>

In article <5ecmn2$ns3@news1.ni.net>, Lee Van Dyke <lee@fiji.procom.com> wrote:
>Can't find any info/examples on howto overload perl object methods
>except for math functions. (I'll probably find it after I post :) )
>
>Initially I would like to overload a method based on the number of
>arguments, of which I can probably figure out.
>

inside the method you can figure out how many arguments were passed by
looking at $#_. Then you can do different things depending on the value
you get.

There is no real function overloading in perl, because there is no such
thing as a subroutine prototype.

-- 
Alan Ezust, Senior Instructor      ezust@learnix.ca       Toronto, Canada
(416) 486-0596 x 225 (voice)  http://www.learnix.ca  (416) 486-1754 (fax)
-------------------------------------------------------------------------
          "In cyberspace, no-one can hear you scream" -Zippy


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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

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