[7616] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1242 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 29 04:07:11 1997

Date: Wed, 29 Oct 97 01:00:39 -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, 29 Oct 1997     Volume: 8 Number: 1242

Today's topics:
     Re: Adding names to a list :-( (Martien Verbruggen)
     Re: ARGV question <rjk@coos.dartmouth.edu>
     Re: ARGV question <rjk@coos.dartmouth.edu>
     Re: Can for loop be condensed using map()? (Abigail)
     Re: Can for loop be condensed using map()? <qdtcall@esb.ericsson.se>
     Can I use Perl IIS 3.0 & SSI on Microsoft's Personal We <jrcruto@bechtel.com>
     Csh to Perl converter ? <markh@manhatten.prestel.co.uk>
     Re: DBD-Oracle-0.47.tar.gz corrupted? (Faust Gertz)
     Environment <patseal@hyperhost.net>
     Re: Environment (brian d foy)
     Re: Has Perl gone off the deep end or is it me??? <tarkus@dim.ANTISPAM.com>
     Help - PERL for WINDOWS 3.11 smurali@thiru.vetri.com
     Re: help for perl NT4.0 <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     Re: Help me optimize this functionality? (Mike Heins)
     NEWBIE QUESTION <shard@*REMOVE*free.xtel.com>
     Re: NEWBIE QUESTION (brian d foy)
     No value for $OSNAME under Windows <rjk@coos.dartmouth.edu>
     Re: perl and pgp (Casper K. Clausen)
     Re: perl and pgp (brian d foy)
     Re: Perl Suffix (Was: Can perl be maken to Compiler ins (Casper K. Clausen)
     QUESTION: Perl, Selena Sol's db_Search, Netware Web Ser (Cliff Campbell)
     Re: return question (Faust Gertz)
     Re: shtlm problem though perl works (Troy Denkinger)
     Re: Sybperl dbuse closing STDOUT? <ghost@ghost.neosoft.com>
     Re: Using Perl Modules (Martien Verbruggen)
     Re: Year2000 problem with localtime(); <rra@stanford.edu>
     Re: Your opinion on The Perl Journal (TPJ) ? <vpbolt@pixi.com>
     Re: Your opinion on The Perl Journal (TPJ) ? <mark@pla.to>
     Re: Your opinion on The Perl Journal (TPJ) ? (brian d foy)
     Re: Zipping files on a UNIX system, with a cgi Perl scr juhan@avalon.nf.ca
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 29 Oct 1997 01:51:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Adding names to a list :-(
Message-Id: <6364r5$f5c$3@comdyn.comdyn.com.au>

In article <345676D5.4AE5FB91@lp-llc.com>,
	Matt McLaughlin <raven@lp-llc.com> writes:

> When running perl-w on my shell, everything checks out.  When running it
> from the web, I get an ERROR 500.

perldoc perlfaq9
/My CGI script runs from the command line but not the
browser.  Can you help me fix it?

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Tue, 28 Oct 1997 22:32:59 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: ARGV question
Message-Id: <3456AE6A.3465@coos.dartmouth.edu>

brian d foy wrote:
> 
> In article <3452742E.50BC@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:
> 
> >Nem W Schlecht wrote:
> >>
> >> $len = scalar @ARGV;    # using '$len = @ARGV' is bad, because if @ARGV
> >>                         # contains only one element, $len will be set to
> >>                         # that instead of '1'
> >
> >Whereever did you get that crazy idea from?
> >
> >Using '$len = @ARGV' already puts @ARGV in a scalar context.
> >In this case, specifying scalar() explicitly doesn't accomplish
> >anything.
> 
> sure it does.  imagine reading through someone else's code and not
> understanding a section like
> 
>    my @x;
> 
>    $x = @ARGV;

Good point.  I meant it doesn't accomplish anything in terms of
execution.
In terms of readability and maintainability, however, you are absolutely
right.

> if you really want to pick nits, you should demonstrate that the
> text in the comment is incorrect.

I did.  You just didn't quote that part of my message:

~> perl -e '$a = @ARGV; print "$a\n";' hi there
2
~> perl -e '$a = @ARGV; print "$a\n";' hi
1

As you can see, when @ARGV contains one element, the scalar variables is
still
set to '1', and not the single element, contrary to the original
author's
comments.

Chipmunk


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

Date: Tue, 28 Oct 1997 22:36:30 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: ARGV question
Message-Id: <3456AF3D.5F63@coos.dartmouth.edu>

Okay, to clarify:

I didn't mean to say that specifying scalar() when a scalar context is
implicit
was bad or to be avoided.  I was merely saying that the original author
was
incorrect in saying that scalar() was necessary in that context.

I do agree that it makes the code clearer.
(Looks like I should be more worried about making my *posts* clearer :-)

Chipmunk


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

Date: 29 Oct 1997 04:18:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can for loop be condensed using map()?
Message-Id: <slrn65ded1.fa0.abigail@betelgeuse.wayne.fnx.com>

Paul L. Lussier (plussier@wellfleet.com) wrote on 1519 September 1993 in
<URL: news:635igr$r0l@paperboy.corpeast.BayNetworks.COM>:
++ 
++ Hi,  I currently have this for loop which takes a hex mac address and converts
++ it into a dotted quad format and I'm looking for a more efficient way of doing
++ the same thing:
++ 
++  $mask = 'ffffff00'
++  for ($i=0; $i < length ($mask); $i+=2) {
++     push (@newmask, hex (substr ($mask, $i,2)));
++   }
++   $netmask = join ('.', @newmask);
++ 
++ Is there a way I can use map to do the same thing?  Can I somehow avoid the 
++ 2 step process of looping through, then joining?

$netmask = join '.', map {hex} $mask =~ m/(..)/g;

or:

$netmask = '';
map {$netmask .= '.' if $netmask; $netmask .= hex;} $mask =~ m/(..)/g;

or:

($netmask = $mask) =~ s/(..)/(hex $1) . '.'/eg; chop $netmask;

or:

($netmask = $mask) =~ s/(..)/${\hex $1}./g; chop $netmask;


I prefer the first one.


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


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

Date: 29 Oct 1997 09:16:12 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Can for loop be condensed using map()?
Message-Id: <is2015q90z.fsf@godzilla.kiere.ericsson.se>

plussier@wellfleet.com (Paul L. Lussier) writes:

> Is there a way I can use map to do the same thing?

$netmask = join ".", map {hex} $mask =~ /(..)/g;

TMTOWTDI, of course.
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: Wed, 29 Oct 1997 06:55:34 GMT
From: "Jay Cruto" <jrcruto@bechtel.com>
Subject: Can I use Perl IIS 3.0 & SSI on Microsoft's Personal Web Server?
Message-Id: <01bce435$e3c269e0$82100193@sinw0313.bechtel.com>

Is there anyone who knows how to enable SSI on Microsoft's Personal Web
Server?
I am trying to run a script that will display an graphic image based on
parsed information. I'm using Perl IIS 3.0 to do this.   I want to
autostart the script when the page initially get's loaded using

<!--#exec cgi="\cgi-bin\getlid.plx"-->

but nothing is happening.  However, If I create a hyperlink that points to
the script, it works ok.  The only problem is, the image is not on the same
page I want it to appear.

If you have any info, please give me a step by step instruction how to..

Thanks



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

Date: 29 Oct 1997 05:15:08 GMT
From: "mark hutchinson" <markh@manhatten.prestel.co.uk>
Subject: Csh to Perl converter ?
Message-Id: <01bce428$6ac8caa0$59025cc3@manhatten>

does anyone have a (preferably perl) script to convert a C-shell script to
Perl???



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

Date: Wed, 29 Oct 1997 03:57:36 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: DBD-Oracle-0.47.tar.gz corrupted?
Message-Id: <3457b350.9426283@news.wwa.com>

On 28 Oct 1997 11:48:50 -0700, lmulcahy@nyx.net (Larry Mulcahy) wrote:

>I've tried to download this half a dozen times and each time I wind up
>with something that (gnu) zcat doesn't recognize.  Yes, I know about
>setting FTP to binary mode, though I've mostly been trying to do this
>from Netscape.

That may be your problem.  I have had problems with Nutscrape
insisting on downloading files in ASCII mode when I have tried to
specify they be downloaded in binary mode.  Since you know all about
binary and ASCII mode and apparently suspect that Nutscrape could be
to blame, why don't you try using a solid FTP program instead of a web
browser to do your file transfers.

Just a thought . . .

Faust Gertz
Philosopher at Large


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

Date: Tue, 28 Oct 1997 21:23:18 -0500
From: Patrick Seal <patseal@hyperhost.net>
Subject: Environment
Message-Id: <34569E16.CFF96B91@hyperhost.net>

How do I make a directory a perl library?

I have a virtual server and need to make a perl library
within my directory tree:
/usr/home/hyperhos/

My ISP says it can be done but won't tell me how.

Patrick Seal
patseal@hyperhost.net


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

Date: Tue, 28 Oct 1997 22:56:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Environment
Message-Id: <comdog-ya02408000R2810972256120001@news.panix.com>

In article <34569E16.CFF96B91@hyperhost.net>, Patrick Seal <patseal@hyperhost.net> wrote:

>How do I make a directory a perl library?

there is nothing special about the directory itself...

>I have a virtual server and need to make a perl library
>within my directory tree:
>/usr/home/hyperhos/

simply make a directory and put Perl libraries in there.  the
documentation of (at least the good) modules will have instructions
on how to install them in your own directory.

then, to makek the Perl script look in that directory for modules,
use (ahem)

   use lib '/my/directory/path';

>My ISP says it can be done but won't tell me how.

if your ISP doesn't answer your questions, get one that will.  no
sense paying somebody to either ignore you or pretend to know answers
that they don't.  they should also be willing to install modules from 
CPAN in site_perl so that everyone can use them :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 28 Oct 1997 22:09:10 -0700
From: Tarkus <tarkus@dim.ANTISPAM.com>
Subject: Re: Has Perl gone off the deep end or is it me???
Message-Id: <3456C4F5.48B13698@dim.ANTISPAM.com>

Michael P Chandler wrote:

> > $Type = "P";
> >
> > print "Type = $Type\n";
> > if ($Type == "X")
> > {
>
> I thought string comparisons needed:
>
>     if ( <str_expr> eq <str_expr>) .......

You are absolutely right.  The "==" is only for
numerical comparisons such as:

$Type = 60;
print "Type = $Type\n";
if ( $Type == 50 ) {
 .
 .
 .

Kevin "Tarkus" Eson



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

Date: Tue, 28 Oct 1997 23:11:37 -0600
From: smurali@thiru.vetri.com
Subject: Help - PERL for WINDOWS 3.11
Message-Id: <878101625.16174@dejanews.com>

Hello

Can anyone help me in getting PERL for Windows 3.11 ( 16 bit ).

I have PERL for Windows 95.  But i need it in Windows 3.11 ( 16bit ) with
ODBC Support.

Thanks in Advance

Regards

SrinivasanMurali

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Tue, 28 Oct 1997 20:07:03 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: help for perl NT4.0
Message-Id: <636cp7$j3d@mtinsc04.worldnet.att.net>

I recommend the ActiveWare port:

http://www.activeware.com

You'll also want to check out the Perl web site (http://www.perl.com), which
has links to lots of documentation, and the Comprehensive Perl Archive
Network (also available through the Perl web site), which has many useful
modules, quite a few of which operate under NT.

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl

theresa@nytimes.com wrote in message
<345639d6.20809158@newsgate.nytimes.com>...
>Hi:
> Where can I download the perl that can run on NY4.0 from
>command line. Thanks in advance.




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

Date: 29 Oct 1997 08:38:58 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Help me optimize this functionality?
Message-Id: <636sn2$he3$1@vixen.cso.uiuc.edu>

Mattias Lvnnqvist (mattias.lonnqvist@-NO-SPAM-.uidesign.se) wrote:
: Currently I have a small function which translates certain sequences of
: chars,
: or to be precise, it translates %0a - %ff to upper caps.
: 
: My current function looks like this:
: 
: sub capit
: {
:     $testdata = $_[0];
:     $j='a';
: 
:     for ($i=0; $i<10; $i++){
:         for (('a','b','c','d','e','f')){
:             $j=$_;
:             $j =~ tr/a-f/A-F/;
:             $testdata =~ s/\%$i$_/\%$i$j/g;
:             $testdata =~ s/\%$_$i/\%$j$i/g;
:             $testdata =~ s/\%$_$_/\%$j$j/g;
:         }
:     }
:     return $testdata;
: }
: 
: 
: Now, this is real ugly. Its also a very solution, seen to complexity,
: since I have 60 loops to do this.

This is the type of thing a regex with hash lookup is so great for. No
subroutine necessary.

    # Set up translation table 
    for ( 0x0a .. 0xff ) {
	$key = sprintf ("%02x", $_);
	$tab{lc $key} = uc $key;
    }   

    my $data = "various %09 %Ag %fc %el %23 %Ed %ed\n";
    $data =~ s/%([0-9a-fA-F][0-9a-fA-F])/ '%' . ($tab{lc $1} || $1) /eg;

And I am guessing execution time will be reduced by...
no need to guess. 

The first time I benchmarked it I forgot to remove the 
translation table setup from the code test.

Benchmark: timing 100 iterations of Regex, Sub...
     Regex:  2 secs ( 1.57 usr  0.00 sys =  1.57 cpu)
       Sub:  3 secs ( 3.21 usr  0.00 sys =  3.21 cpu)

It is reduced by half even when running the translation table every
iteration.  I will do it while running the translation table only once...

Benchmark: timing 100 iterations of Regex, Sub...
     Regex:  0 secs ( 0.04 usr  0.00 sys =  0.04 cpu)
            (warning: too few iterations for a reliable count)
       Sub:  3 secs ( 3.13 usr  0.00 sys =  3.13 cpu)

Benchmark: timing 1000 iterations of Regex, Sub...
     Regex:  1 secs ( 0.36 usr  0.00 sys =  0.36 cpu)
            (warning: too few iterations for a reliable count)
       Sub: 32 secs (32.06 usr  0.00 sys = 32.06 cpu)

An 89x speedup, minus the very small tab setup time.

Regards,
Mike Heins


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

Date: Tue, 28 Oct 1997 22:32:37 -0600
From: Rabbid One <shard@*REMOVE*free.xtel.com>
Subject: NEWBIE QUESTION
Message-Id: <636e13$k76$1@news.socomm.net>

I've got a perl script going on via DOS. My questions are:

I'd like to set up a situation where I've got a 2 frame page up that a
user can input something in frame 1 and the perl script works it and
answers on frame 2. Is this possible?

I noticed that if I say 

  $x=1; 

and then later do a 

  if ($x=1) 

then the if comes up false but if I do a 

  if ($x="1") 

it works fine. Is this normal?

thanx!


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

Date: Wed, 29 Oct 1997 03:25:25 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: NEWBIE QUESTION
Message-Id: <comdog-ya02408000R2910970325250001@news.panix.com>

In article <636e13$k76$1@news.socomm.net>, shard@*REMOVE*free.xtel.com wrote:

>I'd like to set up a situation where I've got a 2 frame page up that a
>user can input something in frame 1 and the perl script works it and
>answers on frame 2. Is this possible?

see the information for Working with Frames in the CGI Meta FAQ.

>I noticed that if I say 
>  $x=1; 
>and then later do a 
>  if ($x=1)
>then the if comes up false but if I do a 

[are you sure it came up false?]

i think you wanted a comparison operator (perhaps ==)...

   #!/usr/bin/perl -w
   
   print "True!" if $x = 1;
   
   __END__
   # Found = in conditional, should be ==.
   File '<AppleEvent>'; Line 3
   # Identifier "main::x" used only once: possible typo.
   File '<AppleEvent>'; Line 3
   True!

notice that the expression ($x = 1) evaluates as true, since $x
is 1.  you will get a different result if you try it with $x = 0.
also notice that using the -w switch gives you a clue that you might
have made a mistake: "Found = in conditional, should be =="

>
>  if ($x="1") 
>
>it works fine. Is this normal?

for the same reason as the $x = 1 case works.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 29 Oct 1997 00:52:49 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: No value for $OSNAME under Windows
Message-Id: <3456CF2F.F00@coos.dartmouth.edu>

I've run into a problem with the special variable $OSNAME under Windows.
Basically, the variable has no value.

I am using the English module.  I checked the values of other special
variables, using their English names, and they all had reasonable
values.

Version Info:

perl v5.001, unofficial patchlevel 1m.
Perl for Win32 Build 110

WinNTW 4.0, build 1381


Any ideas?

Chipmunk


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

Date: 29 Oct 1997 08:12:34 +0100
From: ckc@dmi.min.dk (Casper K. Clausen)
Subject: Re: perl and pgp
Message-Id: <wvpu3e12gbh.fsf@hobbes.dmi.min.dk>

>>>>> "R" == Runar Bell <bell@idi.ntnu.no> writes:

R> The following works:
R> @out = `less textfile.txt |pgp -fae recipient`;

R> But, how do I do this if I want to use the variable/array @text instead of
R> the file textfile.txt?

Well, one might suspect that this has something to do with the open()
function. This might lead one to contemplate uttering the incantation
'man perlfunc' or some similar spell, which would then give one
insight into the open() function. And lo and behold: There is quite a
bit of space devoted to bidirectional pipes, complete with references
to other Perl functions and docs. What a coincidence.

Regards,
Kvan.
-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- |  unattempted is impossible.'
           Lokal  544            |   
I do not speak for DMI, just me. |        - Lord Mhoram, Son of Variol.      


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

Date: Wed, 29 Oct 1997 03:16:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl and pgp
Message-Id: <comdog-ya02408000R2910970316500001@news.panix.com>

In article <wvpu3e12gbh.fsf@hobbes.dmi.min.dk>, ckc@dmi.min.dk (Casper K. Clausen) wrote:

>>>>>> "R" == Runar Bell <bell@idi.ntnu.no> writes:
>
>R> The following works:
>R> @out = `less textfile.txt |pgp -fae recipient`;
>
>R> But, how do I do this if I want to use the variable/array @text instead of
>R> the file textfile.txt?
>
>Well, one might suspect that this has something to do with the open()
>function. This might lead one to contemplate uttering the incantation
>'man perlfunc' or some similar spell, which would then give one
>insight into the open() function.

IPC::Open2 or IPC::Open3 are better for this sort of thing than open().
here's a snippet:

[is anyone else doing any module sort of thing with PGP?]

use IPC::Open3;

sub _exec()
   {
   my $self     = shift;  #... sorry, can't give the rest of the
                          # package right now.
   my $data_ref = shift;  #reference to plain text data
   my $data     = '';     #will have the cipher text
   my $error    = '';     #any STDERR stuff from pgp

   my ($WRITE, $READ, $ERROR);
   
   my $command = $self->path . ' ' . $self->options;
   
   print "PGP: command is [$command]\n" if $debug > 0;
   
   my $pid = open3 \*WRITE, \*READ, \*ERROR,
      $command;
   
   print WRITE $$data_ref if ref $data_ref;  # yuck...

   close WRITE;
      
   while( <READ> )
      {
      $data .= $_;
      }
   close READ;
   
   while( <ERROR> )
      {
      $error .= $_;
      }
   close ERROR;
      
   return ($data, $error);
   }

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 29 Oct 1997 08:43:47 +0100
From: ckc@dmi.min.dk (Casper K. Clausen)
Subject: Re: Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
Message-Id: <wvpsotl2evg.fsf@hobbes.dmi.min.dk>

>>>>> "D" == Doug Seay <seay@absyss.fr> writes:

D> Do most people put .pl at the end of perl filenames?  Am I the odd man
D> out here?  I'd understand that for folks trapped in a 8.3 filename
D> system or filetype baseed OS, but do people do that who use modern OSes? 

I use .pl during development as a courtesy to emacs, even though I
know emacs will just grok the shebang line and enter cperl-mode
anyway. The extension just makes me feel more sure that it will (okay,
so I don't believe in magic). Once development's done, I usually make
a link without a .pl extension in some directory in my $path, or move
the file, if it's a short one which won't need maintenance, to a
non-.pl file in my $path.

Regards,
Kvan.
-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- |  unattempted is impossible.'
           Lokal  544            |   
I do not speak for DMI, just me. |        - Lord Mhoram, Son of Variol.      


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

Date: Wed, 29 Oct 1997 07:34:12 GMT
From: cliff.campbell@tenethealth.com (Cliff Campbell)
Subject: QUESTION: Perl, Selena Sol's db_Search, Netware Web Server and You.
Message-Id: <3456e6ed.1681097@news.supernews.com>

	I am trying to use Selena Sol's db_search.cgi script on my
Netware 4.11 server running Web Server 3.1.  I always get back a
document contains no data,  this error can occur when I specify the
wrong file name even.  I think I don't have it installed in the right
directory and that is why this is happening.  Does anyone know the
correct directory to install this script tree structure into?
TIA
Cliff CAmpbell
dreeves@fix.net



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

Date: Wed, 29 Oct 1997 03:51:19 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: return question
Message-Id: <3456b214.9110080@news.wwa.com>

On Tue, 28 Oct 1997 19:28:29 -0500, Joe Gottman
<joegottman@worldnet.att.net> wrote:

>I have a question about the return keyword. Is there any difference
>between the
>function 
>   sub foo { 1;} 
>and 
>  sub foo {return 1;}
>
>   I like using return as the last statement in a subroutine, but I am
>curious if
>this would cause the function to run slower or faster.

About six letters.  You could also just write:

sub foo { 1 }

to save more typing.  As far as one running faster than the other, I
can't see any reason for a difference in performance, but the only way
to be sure is to use the Benchmark module and see for yourself.

HTH

Faust Gertz
Philosopher at Large


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

Date: Wed, 29 Oct 1997 04:34:59 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: shtlm problem though perl works
Message-Id: <636ep1$9kc$1@nntp3.interaccess.com>

In article <635dru$42n$1@brokaw.wa.com>, kcarroll@halcyon.com (Kris Carroll) wrote:
>At http://www.horse-country.com/ridindex.shtml
><P align=center><A
>HREF="http://206.63.62.61/htbin/imagemap/maps/hcbuttons.map"><IMG
>SRC="media/hcbuttons.gif" alt="HC List" BORDER=0 ISMAP></A><!--#exec
>cgi="/cgi-bin/kcarroll/hc_random2.pl"--> </a></p>

You ought to bring this up on a comp.infosystem.www.browser.* group as 
that is your problem.  The page looks fine on my browser (IE4).  This 
is so _not_ a perl question.

Regards,

Troy Denkinger


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

Date: Tue, 28 Oct 1997 20:38:23 -0600
From: Mark Allman <ghost@ghost.neosoft.com>
Subject: Re: Sybperl dbuse closing STDOUT?
Message-Id: <3456A19F.70222492@ghost.neosoft.com>

Try adding a "select STDOUT;" after each call.  Either
that or explicitly add "STDOUT" to all prints in your
script.

-- Mark Allman
-- Sr. Engineer, The Boeing Company, allman@pat.lgb.cal.boeing.com
-- Allman Professional Consulting, http://www.neosoft.com/~ghost/

dmorr@software.net wrote:
> 
> I'm experiencing this strange intermittent problem with dbuse.
> I have a script which is hitting a Sybase database repeatedly
> throughout the life of the script.  At each iteration, it is
> calling $dbh->dbuse('database');  Occasionally, all output from
> the script stops after the last dbuse call.
> 
> Or, I should say, all output to STDOUT does not make it to a web
> browser.  Printing to a log file still works fine, and the script
> continues on its merry way as long as there are no print statements.
> 
> I can't duplicate this on the command line; it also doesn't happen
> every time through a browser.  I *can* reliably duplicate it if
> it happens once by reloading the form, but the same series of
> steps will not always produce the error.
> 
> I saw a post recently about this in this groupd, but the responses
> had to do with the SYBASE environment variable, which is set before
> and after the dbuse command.  Anybody have any other ideas about what's
> going on?  I'm pretty puzzled by this one.
> 
> I'm running perl 5.003, and Sybperl 2.07.
> 
> Thanks,
> Dave
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 29 Oct 1997 01:46:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Using Perl Modules
Message-Id: <6364i6$f5c$2@comdyn.comdyn.com.au>

In article <3455F5FB.3289@datahost.com>,
	Michael Stearns <michael@datahost.com> writes:

> Are there generic instructions available on installing and accessing
> Perl Modules? I searched but did not find any.

perldoc perlfaq8
/How do I install a CPAN module

> My questions:
> 
> After doing "Makefile" and "make" I certainly got a bunch of stuff
> created in my directory. Should everything be there that I need to use
> the module?

just use make install (see the next question as well)

> Can I leave the module in my local directory and use it from there or
> does it have to be somewhere else on the system?

perldoc perlfaq8
/How do I keep my own module/library directory?
/How do I add a directory to my include path at runtime?

> I want to use it on another system where I have an account, but I don't
> have telnet access. Can I do the install on another machine and copy
> certain parts over? If not, is there another way I can do the
> installation?

depends on the module. If it's pure perl, copying the file sshould do
the trick. If there's a compiled part, it will be a lot trickier.
Autoloading might also make your life harder.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: 28 Oct 1997 18:09:46 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Year2000 problem with localtime();
Message-Id: <m3g1pls4k5.fsf@windlord.Stanford.EDU>

Abigail <abigail@fnx.com> writes:

> Uhm, if I have my application read and write dates, using sizeof
> (time_t) space, I get a problem when sizeof (time_t) isn't constant over
> time.

Point.  The problem is lesser than with Y2K, though, just because the
internal storage structure of times will be changing essentially
automatically, and fixing data structures is something that people may
have to think about at least superficially when porting existing software
to new platforms.

But yes, there's still a problem with data storage.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 28 Oct 1997 19:35:52 -1000
From: Paul Bolt <vpbolt@pixi.com>
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <3456CB37.36CF8D98@pixi.com>

How does an individual get a subscription to The Perl Journal?
vpbolt@pixi.com

>Faust Gertz wrote:

> On 26 Oct 1997 20:02:31 GMT, as646@FreeNet.Carleton.CA (John Robson)
> wrote:
>
> >I would like to hear your opinions on it.
>
> Ok.
>
> >Do you find it useful?
>
> Yes.  Very useful.
>
> >Is it slanted toward the beginner or the expert, or both?
>
> I think it started with more articles for beginners, but has shifted
> away from such articles (I guess "Just the FAQs" is suppose to fill
> that role now).  If you are a beginner, you really should order all
> the back issues.  That way you will have access to Lincoln Stein's
> earlier CGI articles, Jeffrey Friedl's Regular Expression articles,
> and various articles on perl and Usenet, Mail, etc . . .  If you
> aren't a beginner, you should get all the back issues anyway, 'cause
> they are so good.
>
> >Does it have only Perl code, or does it also have fun anecdotal
> >stories about how people use Perl creatively?
>
> Thanks god it isn't all about coding.  It has both.  I really enjoyed
> the articles on the Human Genome Project, Pairwise Voting, Nuclear
> Weapons, etc. . .  Don't get me wrong, I find the code valuable as
> well, but it is the perl interest articles that keep me excited about
> learning perl.
>
> >What do you like best about the Perl Journal?
>
> The excitement whenever I get a new copy.  Yes, I have become a geek.
> I read it from cover to cover (except for the Perl/TK articles) and I
> know that someday, when I read and understand all the articles
> clearly, I will finally have left the position of perl newbie and be
> well on my way to amateur perl enthusiast.
>
> Streben nach Wahrheit
>
> Faust Gertz
> Philosopher at Large
>
> "Do not fear mistakes - - there are none." - Miles Davis.





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

Date: 29 Oct 1997 07:51:44 GMT
From: <mark@pla.to>
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <01bce43f$0706a5c0$064300c3@archive>


Paul Bolt <vpbolt@pixi.com> wrote in article
<3456CB37.36CF8D98@pixi.com>...
> How does an individual get a subscription to The Perl Journal?
> vpbolt@pixi.com
> 

try http://www.tpj.com - subscribe online

-- 
mark@pla.to   http://mind.pla.to - de site voor tweede hands computers en
computer-onderdelen




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

Date: Wed, 29 Oct 1997 03:18:33 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Your opinion on The Perl Journal (TPJ) ?
Message-Id: <comdog-ya02408000R2910970318330001@news.panix.com>

In article <3456CB37.36CF8D98@pixi.com>, Paul Bolt <vpbolt@pixi.com> wrote:

>How does an individual get a subscription to The Perl Journal?

<URL:http://tpj.com/the_perl_journal/> has all the details.

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 29 Oct 1997 02:49:55 GMT
From: juhan@avalon.nf.ca
Subject: Re: Zipping files on a UNIX system, with a cgi Perl script
Message-Id: <63688j$avi$1@usenet88.supernews.com>

In <34564396.853524D7@cloud9.net>, "B.J. Dweck" <bjdweck@cloud9.net> writes:
>...When I run the program from the shell, while logged on to my
>account, it works fine.  When I run it through the web, however, the
>program doesn't create the zip file, leading to an error message from
>the browser, that it can't find the file...

I had a similar problem, not in perl but another kind of CGI script. Keep in mind that
the environment the web scripts are running in is NOT the same as your shell
environment. Either setup your environment (better), or use full paths (not so
good). To test if this is the problem, use the full path to your "zip" program, and
any other program references. If your script magically starts to work, then see 
about fixing your environment for the web server, and its scripts.



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

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

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