[12470] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6069 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 20 20:17:53 1999

Date: Sun, 20 Jun 99 17:00:24 -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           Sun, 20 Jun 1999     Volume: 8 Number: 6069

Today's topics:
    Re: %IS THIS SCRIPT ANY GOOD ?% %IS THIS SCRIPT ANY GOO (Larry Rosler)
    Re: 'Perl core' or 'perl core'? (Abigail)
    Re: About Apache Configuration <gellyfish@gellyfish.com>
    Re: About Apache Configuration <gellyfish@gellyfish.com>
    Re: ActiveState Perl and use of PPM <gellyfish@gellyfish.com>
    Re: Afraid to ask about Y2K! (Abigail)
    Re: Can someone help interpret this code? (Tramm Hudson)
    Re: converting to eps file <gellyfish@gellyfish.com>
    Re: Cure for document deficiency <gellyfish@gellyfish.com>
    Re: Cure for document deficiency <webmaster@chatbase.com>
        dbmopen as opposed to tie -- for a database <aw096@chebucto.ns.ca>
        Examples on using DBM for extracting user/fulename from <linux@worsdall.demon.co.uk>
        re: Examples on using DBM for extracting user/fulename  <aw096@chebucto.ns.ca>
    Re: Fixed format fields: help needed! (Marcel Grunauer)
    Re: Fixed format fields: help needed! (Bob Trieger)
    Re: Fixed format fields: help needed! (Larry Rosler)
    Re: function to read a line & return it (Abigail)
    Re: function to read a line & return it <zjagrantz@znrcanz.gcz.ca>
    Re: function to read a line & return it <zjagrantz@znrcanz.gcz.ca>
    Re: Good reasons for avoiding modules (was: Re: Afraid  (Paul David Fardy)
    Re: HELP! with script PLEASE! (Abigail)
    Re: HOW DO I PAD A STRING IN PERL?? <webmaster@chatbase.com>
    Re: Language choice for high-volume Oracle CGI interfac <gellyfish@gellyfish.com>
    Re: Language choice for high-volume Oracle CGI interfac (Abigail)
    Re: localtime function using Activestates perl on NT4 <rich@mwynhau.demon.co.uk>
        Locking and renameing files from a script vitanut@my-deja.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 20 Jun 1999 16:30:48 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: %IS THIS SCRIPT ANY GOOD ?% %IS THIS SCRIPT ANY GOOD ?%
Message-Id: <MPG.11d719773c186935989c05@nntp.hpl.hp.com>

In article <ebohlmanFDn4pz.339@netcom.com> on Sun, 20 Jun 1999 19:27:35 
GMT, Eric Bohlman <ebohlman@netcom.com> says...
> sam@cheapnet.co.uk (sam@cheapnet.co.uk) wrote:
 ...
> : # File to print the output to
> : $file = "c:\\users.txt";
 ...
> It's generally a good idea to use single quotes rather than double quotes 
> when quoting purely literal strings that don't require variable 
> interpolation.  In this case, using single quotes would avoid the need to 
> double up the backslashes.

    $file = 'c:/users.txt';

avoids the need to worry about backslashes at all.  We should say this 
to any Windows/DOS people who lack awareness of this best-kept secret.  
No one else will tell them.

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


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

Date: 20 Jun 1999 12:10:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <slrn7mq84r.k1b.abigail@alexandra.delanet.com>

Wyzelli (wyzelli@yahoo.com) wrote on MMCXIX September MCMXCIII in
<URL:news:tx0b3.114$E4.55726@vic.nntp.telstra.net>:
%% 
%% It is Perl everywhere else... why would it be perl?


Read the faq. It deals with the difference between 'perl' and 'Perl'.


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 20 Jun 1999 21:49:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: About Apache Configuration
Message-Id: <7kjnl3$6dd$1@gellyfish.btinternet.com>

On Sun, 20 Jun 1999 17:26:37 GMT Marcel Grunauer wrote:
> On Sun, 20 Jun 1999 07:27:05 GMT it came to pass that
> ryanngi@hotmail.com (Ryan Ngi) produced 18 lines that required the
> following response:
> 
>>i'm setting Linux Apache 1.3.6 for runing CGI in the same directory of
>>HTML data: i use
>>
>>Alias /funfunfun "/home/www/funfunfun"
>>
>>ScriptAlias /funfunfun "/home/www/funfunfun"
>>
>>......it's not work!...... it can only show html, but not cgi
>>
>>if use
>>
>>ScriptAlias ..........
>>
>>Alias ...........
>>
>>it can only show cgi but not html
>>
>>please suggest
> 
> I suggest you try a newsgroup that's concerned with Apache, like
> comp.infosystems.www.servers.unix
> 

Actually I would recommed looking in the documentation that ships with
Apache first

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Jun 1999 22:00:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: About Apache Configuration
Message-Id: <7kjoal$6ek$1@gellyfish.btinternet.com>

On Sun, 20 Jun 1999 07:27:05 GMT Ryan Ngi wrote:
> i'm setting Linux Apache 1.3.6 for runing CGI in the same directory of
> HTML data: i use
> 
> Alias /funfunfun "/home/www/funfunfun"
> 
> ScriptAlias /funfunfun "/home/www/funfunfun"
> 
> ......it's not work!...... it can only show html, but not cgi
> 
> if use
> 
> ScriptAlias ..........
> 
> Alias ...........
> 
> it can only show cgi but not html
> 

It appears that you have not read the Apache documentation.

I have a 1.5 MByte tar archive that contains that documentation if you have
in some way managed to mislay it.  Alternatively you might want to browse
the <http://localhost/manual/> documentation available on your own local
server.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Jun 1999 21:30:56 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ActiveState Perl and use of PPM
Message-Id: <7kjmig$6d6$1@gellyfish.btinternet.com>

On Sun, 20 Jun 1999 11:09:46 GMT Erol Bernstein wrote:
> On Sat, 19 Jun 1999 20:51:11 -0400, Bob Walton
> <walton@frontiernet.net> wrote:
> 
> Bob, fine thanks for this hint. 
> It works.
> Last night I was getting gray hairs while trying to work with ppm
> online ... now I'm lucky again :-)
> 
> This should be into the FAQ.
> 

I believe that it is in the FAQ that is specific to the Activestate
distribution.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Jun 1999 12:04:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <slrn7mq7pl.k1b.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCXIX September MCMXCIII in
<URL:news:3772a9f5.2388358@news.skynet.be>:
'' 
'' I also think that for such short scripts, use of a (largish) module can
'' double the total execution time of the scriptlet.


How large do you think this wrapper around localtime() should be?

Also, don't forget, that if you put it in the core *ANY* Perl program 
will suffer a longer startup time, not just the ones that use this
new function.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 20 Jun 1999 16:52:11 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: Can someone help interpret this code?
Message-Id: <7kjrar$jm4@llama.swcp.com>

[posted and cc'd to cited author.  s/PERL/Perl/g, etc]

Marc <marc@infinityinternet.com> wrote (with some changes and additions):
 ...
> package Person;
  use strict;			# Turns on proper rules
  my $Body_Count = 0;		# Declares Body_Count to be file-scoped
				# lexical so that no one else may access it.
> sub population
> {
>     return $Body_Count;
> }
> 
> sub new
> {
>     $Body_Count++;
>     return bless { }, shift;
> }
> 
sub DESTROY 	# Must be in all caps
> {
>     $Body_Count--;
> }
 ....

Just don't count on $Body_Count containing an accurate count of
the objects of type Person.  destroy must be named DESTROY, for one
In addition, the ref counting collection may not immediately
destroy the object -- your destructors should not rely on when
they are called since Perl's notion of the "right time" to call
the destructor is not well defined.

You really should use strict and make the $Body_Count variable a
file-scoped scalar rather than putting it in the symbol table.
Do you want outsiders able to do a $Person::Body_Count = 3.14159?


package main;	# To indicate that we are out of package Person
> use Person;
> 
> for(1 .. 10)
> {
>     push @people;
>     Person->new();
> }

I don't think this does what you think that it does.  You don't push
anything onto the array @people and then discard the newly created
Person object.
	
> printf "There are %d people alive.\n", Person->population();

As discussed earlier, there are Person->population objects that have
not yet been collected.  You may also lose the empty parens if you
like.

> #######
> # EOF
> #######

__END__

is a better way to indicate this.  It makes the interpreter happy.

Good luck with OO design.  At least there weren't any symbolic
references, localt*me calls, or questions about compiling into
executables to hide the source.  Yeah!

Tramm
-- 
  o   hudson@swcp.com                 tbhudso@cs.sandia.gov   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.266.59.96   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.284.24.32   \ \/\_\  
  0                                                            U \_  | 


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

Date: 20 Jun 1999 22:13:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: converting to eps file
Message-Id: <7kjp2c$6eq$1@gellyfish.btinternet.com>

On Sun, 20 Jun 1999 18:30:24 +0200 Anja Krause wrote:
> Hi to all,
> we have read a few weeks ago that it will be possible to convert content of
> a form into eps file automaticly by cgi. Everyone knows this will be true?
> We can't find message again.
> 

You might want to use Dejanews to search for this - 

<http://www.deja,com>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Jun 1999 21:23:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cure for document deficiency
Message-Id: <7kjm4a$6d3$1@gellyfish.btinternet.com>

On Sun, 20 Jun 1999 12:33:21 -0700 Bill wrote:
> In article <x73dzmadbk.fsf@home.sysarch.com>, uri@sysarch.com says...
>> >>>>> "DC" == Dave Cross <dave@dave.org.uk> writes:
>>   DC> Also it's difficult to read the online docs in the bath or on the
>>   DC> train.
>> 
>> then print them out! i first got my perl5 docs before blue camel came
>> out by using a company doublesided laser with 3 hole paper. i printed all
>> the perlpod docs at that time. made for nice reading away from the
>> screen.
> 
> But did you print on water proof paper?
> 
> I'm waiting for the docs to come out on Audio tape.  Perfect for those 
> long family vacations in the car.
> 

This has already been discussed here :

<http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=470300748&fmt=text>

;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 20 Jun 1999 15:19:08 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Cure for document deficiency
Message-Id: <376D68DC.7032EDF7@chatbase.com>

Tom Christiansen wrote:
> 
> I have an idea.  When someone asks a questions that's in the standard
> perl manpages, we'll all simply mail them the complete manpage. :-)

Unfortunately, you still can't make them *read* it in their email,
anymore then you can on their system. People usually skip over reading
help pages, go to the bottom and contact the author and ask what's on
the page anyway. Why waste the bandwidth? :-)

I figure if they aren't going to read it the first time, why go to any
effort and tell them twice? They won't listen any better the second time
and it'll only confuse them and they'll email you back (or post again)
asking what the rest of the information in the man pages mean. :-) Why
not just send them a few 50 MEG files? They won't be posting for a while
I bet. *poor humor*...
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: Sun, 20 Jun 1999 22:18:55 GMT
From: hiro<aw096@chebucto.ns.ca>
Subject: dbmopen as opposed to tie -- for a database
Message-Id: <jNdb3.52$Km.5570@sapphire.mtt.net>


I am creating a program which will needs to load three hashes(this is the
method I've come up with for maintaining some sort of relationship between
name and pass and time out and time in, three hashes name:pass
name:timeout and name:timein stored in three .db files, accessed via
dbmopen in my current copy of the program) from files.
	I am using dbmopen

	dbmopen (%names,"names",0666) || die "error or something : $!";
	
	I have been told that dbmopen is depreciated, and instead to use
tie. I am just learning perl(chapter 4 of the llama book right now) and
the perldoc perltie doccumentation was suffeciently complex enough to
confuse me. 
	dbmopen seems to be a lot simpler in its implementation, and less
typing, is it still good practice to use?
	What is the syntax for opening a file as a hash with tie?

	Thank you for your time,
	Joey
	aw096@chebucto.ns.ca


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

Date: Sun, 20 Jun 1999 23:15:16 +0100
From: Mark Worsdall <linux@worsdall.demon.co.uk>
Subject: Examples on using DBM for extracting user/fulename from passwd file
Message-Id: <uORClEA0fWb3Ew5G@worsdall.demon.co.uk>

Hi,

Has anyone got an example, say, of extracting data from the password
file on UNIX boxes (FBSD) to gain user ID and full name details etc...

M.
-- 
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydee@worsdall.demon.co.uk  WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmaster@shadow.org.uk    WEB site:- http://www.shadow.org.uk
Work:- netman@hinwick.demon.co.uk   WEB site:- http://www.hinwick.demon.co.uk
The network I maintain:- http://www.hinwick.demon.co.uk/computerDept/
Web site Monitoring:- http://www.shadow.org.uk/SiteSight/


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

Date: Sun, 20 Jun 1999 23:40:21 GMT
From: hiro <aw096@chebucto.ns.ca>
Subject: re: Examples on using DBM for extracting user/fulename from passwd
Message-Id: <FZeb3.62$Km.6345@sapphire.mtt.net>


>Hi,

Howdy.

>Has anyone got an example, say, of extracting data from the password
>file on UNIX boxes (FBSD) to gain user ID and full name details etc...


hmn...

You could load the file as a list and then split each element(line) of the
list into an array with the command below
 
@newarray = split(/:/, $element);

I think I'm coming out garbled here... maybe it'd just be easier to stop
talking and write the code.

#!/usr/bin/perl
#Let's hope this works.

print "opening passwd file:\n";
 open (PASSWD,"/etc/passwd") || die "can't open file: $!";

while (defined ($element = <PASSWD>)) {

#
#the defined bit means this loop is repeated until we hit a blank line
# or... undefined line, as they call 'em
#

chomp($element);
#bye bye \n

@newarray = split(/:/, $element);

foreach $i (@newarray){
print "$i\n";
}
}

#end

granted my example doesn't really do anything, you should be able to go
from here. this prints out each element of each line on a newline. You
should be able to distinguish with $newarray[0] or whatever field you want
to look at.

Joey


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

Date: Sun, 20 Jun 1999 22:42:52 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Fixed format fields: help needed!
Message-Id: <37726dfa.46999371@enews.newsguy.com>

On Sun, 20 Jun 1999 23:31:30 +0200 it came to pass that "Juan Riera"
<juanriera@mx3.redestb.es> used an obscure tool Microsoft Outlook
Express 5.00.2014.211 and produced 14 lines that required the
following response:

>Hello,
>I am new to perl. I need to format several spool files coming from an
>AS/400, unhappily the output format shows the minus sign after figures; I
>need to move it before the figures, without changing the figures column
>position (is a fixed field output). I mean, for example, changing
>12     .34-   456.0-   123
>to
>12    -.34   -456.0    123
>I have tried with split and join, but I do not get the result I need.
>I will really appreciate any help.

Try a regular expression:

#!/usr/bin/perl -w

use strict;

while (<DATA>) {
  print "IN : $_";
  s/([\.\d]+)-/-$1/g;
  print "OUT: $_";
}

__DATA__
12     .34-   456.0-   123
12.4-  123    78.9     78-


output:

IN : 12     .34-   456.0-   123
OUT: 12     -.34   -456.0   123
IN : 12.4-  123    78.9     78-
OUT: -12.4  123    78.9     -78


I hope this is what you meant by fixed field output.

Marcel



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

Date: Mon, 21 Jun 1999 00:06:09 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Fixed format fields: help needed!
Message-Id: <7kjtgs$m1b$1@ash.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
"Juan Riera" <juanriera@mx3.redestb.es> wrote:
>Hello,
>I am new to perl. I need to format several spool files coming from an
>AS/400, unhappily the output format shows the minus sign after figures; I
>need to move it before the figures, without changing the figures column
>position (is a fixed field output). I mean, for example, changing
>12     .34-   456.0-   123
>to
>12    -.34   -456.0    123

s/([\d.]+)-/-$1/g;


HTH,
--
Bob Trieger
sowmaster@juicepigs.com



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

Date: Sun, 20 Jun 1999 16:46:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Fixed format fields: help needed!
Message-Id: <MPG.11d71d32753237f3989c06@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7kjmm7$a5k1@SGI3651ef0> on Sun, 20 Jun 1999 23:31:30 +0200, 
Juan Riera <juanriera@mx3.redestb.es> says...
> I am new to perl. I need to format several spool files coming from an
> AS/400, unhappily the output format shows the minus sign after figures; I
> need to move it before the figures, without changing the figures column
> position (is a fixed field output). I mean, for example, changing
> 12     .34-   456.0-   123
> to
> 12    -.34   -456.0    123

s/ (\d*\.\d+)-/-$1 /g;

This deals with the floating-point numbers you have shown.  It would be 
somewhat more complicated to deal with any number.  You can find some 
regexes about that in the FAQ.

perlfaq4:  "How do I determine whether a scalar is a
number/whole/integer/float?"

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


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

Date: 20 Jun 1999 12:31:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: function to read a line & return it
Message-Id: <slrn7mq9c5.k1b.abigail@alexandra.delanet.com>

John A. Grant (zjagrantz@znrcanz.gcz.ca) wrote on MMCXIX September
MCMXCIII in <URL:news:7ki1ra$2ke3@nrn2.NRCan.gc.ca>:
:: 
::     It seems 'fragile' to rely on it getting the proper context to
::     determine what "return;" should actually return.  After all,
::     "sub" doesn't exactly specify the type of the returned value.
::     I'm not used to letting the interpreter make these decisions.


Then please STOP PROGRAMMING PERL!  Perl does it it *ALL* the time.
Please read about "context"; many functions and operators return
different things based on list, scalar or void context.


#!/opt/perl/bin/perl -w

use strict;

my @lc = localtime;
my $lc = localtime;

print "@lc", "\n", $lc, "\n";

my @arr = (4, 5, 6);
my @c   = @arr;
my $c   = @arr;

print "@c", "\n", $c, "\n";

my %hash = (foo => 1, bar => 2, quuz => 3, spam => 4, eggs => 5, ham => 6);
my @k    = %hash;
my $k    = %hash;

print "@k", "\n", $k, "\n";

__END__


5 30 13 20 5 99 0 170 1
Sun Jun 20 13:30:05 1999
4 5 6
3
spam 4 foo 1 quuz 3 bar 2 ham 6 eggs 5
4/8




Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 20 Jun 1999 19:25:59 -0400
From: "John A. Grant" <zjagrantz@znrcanz.gcz.ca>
Subject: Re: function to read a line & return it
Message-Id: <7kjtd3$2kd7@nrn2.NRCan.gc.ca>

Abigail wrote in message ...
>John A. Grant (zjagrantz@znrcanz.gcz.ca) wrote on MMCXIX September
>MCMXCIII in <URL:news:7ki1ra$2ke3@nrn2.NRCan.gc.ca>:
>::
>::     It seems 'fragile' to rely on it getting the proper context to
>::     determine what "return;" should actually return.  After all,
>::     "sub" doesn't exactly specify the type of the returned value.
>::     I'm not used to letting the interpreter make these decisions.
>
>Then please STOP PROGRAMMING PERL!
    Ok.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here





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

Date: Sun, 20 Jun 1999 19:32:30 -0400
From: "John A. Grant" <zjagrantz@znrcanz.gcz.ca>
Subject: Re: function to read a line & return it
Message-Id: <7kjtpa$2kf5@nrn2.NRCan.gc.ca>

Larry Rosler wrote in message ...
>In article <7ki1ra$2ke3@nrn2.NRCan.gc.ca> on Sun, 20 Jun 1999 02:29:33 -
>0400, John A. Grant <zjagrantz@znrcanz.gcz.ca> says...
[...]
>>     Also, if the caller is explicitly testing for "eq undef" or if using
>>     defined(), I would think that the function should do an explicit
>>     "return undef" to match the explicitness of the test. Less prone
>>     to breakage?
>
>In list context, 'return undef;' returns a list with one element, the
>value of which is undef.  'return;' returns a list with no elements,
>which is usually more appropriate.
    So if 'success' returns "$_", is a list with no elements
    appropriate for the converse case (failure)?

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here





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

Date: 20 Jun 1999 23:49:37 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Good reasons for avoiding modules (was: Re: Afraid to ask about Y2K!)
Message-Id: <7kjumh$n1c$1@coranto.ucs.mun.ca>

abigail@delanet.com (Abigail) writes:
>>> What's the fear for a module?

Paul David Fardy wrote:
>>  If it's in Perl's core modules, no fear.  Elsewise, the trouble I
>>  have is with portability.  I'll have to distribute a growing list
>>  of modules with my programs.  And is the module up-to-date?

Tom Phoenix <rootbeer@redcat.com> writes:
>   In what way is implementing the equivalent of a well-written module's
>   code within your own programs more portable, easier to distribute, or
>   easier to keep up-to-date?

I wasn't talking about platform portability, but system by system
portability.  If the I rely only on the core modules, I can run the
program on any system running perl5 (sometimes more specifically
perl5.00x or better).  If it's not in the core, then that's additional
work.

I manage most of the systems I use and I'll install the modules I
require.  But I also run some programs on systems I don't manage,
I don't want to manage, and I don't really want make a ritual of
of mirroring the modules I need on these other systems.

Some programs being useful, I'd like to give them to other sys
admins.  "Have you upgraded to Perl5.004 or better?" is a simple
question.  Keeping a list of required modules is not as simple.
I'm not saying that I don't use modules; I do, and I do use CPAN
modules and I recommend them.  Other Sys Admins install some or no
modules, mine or otherwise.  Perhaps you see that as "their
problem", as I often do, but we should both accept that it is _a_
problem.

Remember we aren't talking about a large or specialized module
here.  It's actually just one function that's intended to replace,
for some programmer(s), a core function, localtime.  If this
"humantime" function were in the core, one could simply decide
never to use localtime again.  One could decide that now, but only
be reproducing the code in every program or distributing the
module with every program.

Actually, I've had problems with the core modules, too.
Sys::Syslog on Perl5.005_0[23] doesn't work on Digital UNIX
(V4.0D).  I have a workaround (editting sys/syslog.pl and adding a
setlogsock() to my programs).  But maintaining that on my systems
and requiring such patches on other systems is a problem.
Forgetting that Sys::Syslog has changed, I've redistributed a
program overwriting working older versions that worked.

"Well, that's your problem: you aren't keeping the environment
up to date."  That's precisely what I am saying: I have a problem
with adding maintenance of every Perl environment to my program
distribution.

I sometimes feel that I _have_ to--in a weak sense--maintain the
Perl environment if I want to program in it.  The GNU C compiler
was sometimes the same, but I never felt that way about sh, awk,
or Fortran.  I'd rather just be a programmer, but not so much
so that I'd go back to working in Fortran again. :-)

But with Java, ah Java, we'll never have to worry about that again. :-)

Paul Fardy


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

Date: 20 Jun 1999 12:33:50 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HELP! with script PLEASE!
Message-Id: <slrn7mq9fq.k1b.abigail@alexandra.delanet.com>

Benny Fragomeli (benser@earthlink.net) wrote on MMCXIV September MCMXCIII
in <URL:news:7k4icl$egc$1@ash.prod.itd.earthlink.net>:
|| Is it possible to have a perl script that generates an HTML "order page" and
|| before the perl script ends goto a different server "secure server" Giving
|| the appearance that the order form was fetched from the secure server?


Yes. But you have to drive fast.


Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 20 Jun 1999 15:28:03 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: HOW DO I PAD A STRING IN PERL??
Message-Id: <376D6AF3.BD7E81A@chatbase.com>

Jonathan Stowe wrote:
> 
> On Sun, 20 Jun 1999 06:23:19 GMT Perry Fecteau wrote:
> > Tad McClellan wrote:
> >>
> >> Perry Fecteau (perfecto@ct2.nai.net) wrote:
> >> : for example, i want 23 to look like 00023...
> >>
> >> : how do i do that??
> >>
> >>    $num = '000' . $num if $num == 23;
> >>
> > wrong.  i want fixed length padding.  ie, i want a 5 digit number zero
> > fill if the number is less than 5 digits.

And I think that was mean as either sarcasm, or humor, or both. He could
have just as easily said $num = '00023';

Did you read the docs?
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: 20 Jun 1999 21:44:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <7kjnbn$6d9$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Rene Pijlman <R.Pijlman@applinet.nl> wrote:
> abigail@delanet.com (Abigail) wrote:
>>You must be years behind in your literature. Apache with mod_perl won't
>>spawn processes.
> 
> The question was about CGI, not mod_perl.
> 

I thought the question was about the best way to deal with a high volume of
traffic on a Web based database application - the fact that the original 
poster had mentioned CGI in his subject shouldnt preclude anyone making
other suggestions - if all he had wanted was 'CGI can do that' he would
have posted into another bunch of groups altogether.

Apache with mod_perl can emulate the CGI environment and won't spawn
(other than those the server would do) processes.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Jun 1999 12:06:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <slrn7mq7sh.k1b.abigail@alexandra.delanet.com>

Rene Pijlman (R.Pijlman@applinet.nl) wrote on MMCXIX September MCMXCIII
in <URL:news:376ce6ca.105405925@news.xs4all.nl>:
 .. abigail@delanet.com (Abigail) wrote:
 .. >You must be years behind in your literature. Apache with mod_perl won't
 .. >spawn processes.
 .. 
 .. The question was about CGI, not mod_perl.


Your point being?



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 20 Jun 1999 16:17:47 +0100
From: "Richard Huxton" <rich@mwynhau.demon.co.uk>
Subject: Re: localtime function using Activestates perl on NT4
Message-Id: <929897293.28786.0.nnrp-06.c1edba60@news.demon.co.uk>


Garth Cunningham <garth.cunningham@nz.eds.com> wrote in message
news:7ka0si$99q$1@hermes.nz.eds.com...
[snip]
>
> On my unix system with perl 5.004_04 and the TZ environment variable set
> this returns the correct local date and time.
> Running this code on an NT4 workstation with Activestates perl ( build
509 )
> it returns a time that is an hour fast. The system is set at the correct
> time ( ie type time at the command prompt ).
> Do I need to set or pick up some timezone info ?

This might be a unix/Windows issue. I've noticed somthing similar on my
dual-booting linux/95 system. Unix seems to assume the BIOS clock is left
running on GMT and adjusts it in the OS. I've got a feeling Windows adjusts
the BIOS clock by an hour when you flip into summer-time.

--
Richard Huxton
www.mwynhau.demon.co.uk


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

Date: Sun, 20 Jun 1999 22:40:03 GMT
From: vitanut@my-deja.com
Subject: Locking and renameing files from a script
Message-Id: <7kjqk2$qhr$1@nnrp1.deja.com>

I would like to know how I can, from a script, lock a file, move it to
a new directory, then unlock that file. I have tried to use the
functions flock and rename, but I am not sure how to use them. Any help
would be greatly appreciated.

Thanks


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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