[9897] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3490 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 20 11:19:12 1998

Date: Thu, 20 Aug 98 08:00:35 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 20 Aug 1998     Volume: 8 Number: 3490

Today's topics:
    Re: [Q] deprecated use of split (what? why?) <jdf@pobox.com>
    Re: [Q] deprecated use of split (what? why?) (Greg Bacon)
    Re: [Q] deprecated use of split (what? why?) <jdf@pobox.com>
    Re: [Q] deprecated use of split (what? why?) (Larry Rosler)
    Re: Call another perl script? <e.christensen@netjob.dk>
    Re: Comparison operator (Steve Linberg)
    Re: creating a nt service with perl <knguyen@ab.bluecross.ca>
    Re: Dumb Windows Question b_redeker@hotmail.com
    Re: example for sending mail with perl under win32 <e.christensen@netjob.dk>
        help, @INC doesn't contain /usr/lib/perl5 nana@my-dejanews.com
        HELP: Easy question, I just can't figure out the answer <fdelin@uhl.uiowa.edu>
    Re: HELP: Easy question, I just can't figure out the an <jdf@pobox.com>
        How to create a searchable database <shioky@pc.jaring.my>
        How to include print codes in a perl generated text fil <jlaird@nih.gov>
    Re: How to include print codes in a perl generated text (Steve Linberg)
    Re: Informix ONL 5.0 / ESQL 4.10.U and PERL 5.00404 (Xyvind Gjerstad)
        Locking files on Window 95 server (Hugo Benne)
    Re: Locking files on Window 95 server (Steve Linberg)
    Re: NEWBIE Question: Perl Script in Unix vs. NT dzuy@my-dejanews.com
        perl -U don't work.. <scalp@orka.fr>
    Re: Perl Style (Scott Erickson)
    Re: Protecting a data struc with local or my?--More Con (Craig Berry)
    Re: Rounding & floating point problems <jdf@pobox.com>
        Same subroutine name in require files <ple@mitra.com>
    Re: setting environment variables (Tad McClellan)
    Re: such a thing as a "perl user"? <jdf@pobox.com>
    Re: system call "find" in PERL <jdw@alder.dev.tivoli.com>
    Re: The @INC path <jdf@pobox.com>
        Trouble with Net-SSL <f.hartmann@intershop.de>
    Re: Utility for news article fetching selected by keywo (Steve Linberg)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 20 Aug 1998 09:43:44 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: [Q] deprecated use of split (what? why?)
Message-Id: <90kjn273.fsf@mailhost.panix.com>

Matthias Fischmann <fis@mpi-sb.mpg.de> writes:

> > Use of implicit split to @_ is deprecated at ./gna line 4.

perlfunc says about split()

   If not in a list context, returns the number of fields found and
   splits into the @_ array. (In a list context, you can force the split
   into @_ by using ?? as the pattern delimiters, but it still returns
   the array value.) The use of implicit split to @_ is deprecated,
   however.  

perldiag has this to say:

  Use of implicit split to @_ is deprecated 
     (D) It makes a lot of work for the compiler when you clobber a
     subroutine's argument list, so it's better if you assign the
     results of a split() explicitly to an array (or list).

> Is there a way to tell it that I want to use split purely
> functionally?

   $lines = (@dummy = split("\n", $s));

Hmm.  I might throw away split entirely and do

   $lines = $s =~ tr/\n/\n/;

and, since the last "line" might not be terminated with a \n...

   $lines++ unless $s =~ /\n$/;

It's much faster:

   $s = "foo\nbar\nbaz";
   timethese ( 400_000,
	       {
		dummy_array => sub { scalar (@a = split("\n", $s)); },
		tao_of_tr   => sub { 
		  $lines = $s =~ tr/\n/\n/;
		  $lines++ unless $s =~ /\n$/;
		}
	       }
	     );

dummy_array:  5 wallclock secs ( 5.63 usr +  0.00 sys =  5.63 CPU)
 tao_of_tr:  3 wallclock secs ( 2.67 usr +  0.00 sys =  2.67 CPU)

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 20 Aug 1998 13:45:02 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: [Q] deprecated use of split (what? why?)
Message-Id: <6rh98u$gc3$3@info.uah.edu>

In article <y9izpcz7uff.fsf@mpii02700.mpi-sb.mpg.de>,
	Matthias Fischmann <fis@mpi-sb.mpg.de> writes:
: The following code should (and actually does) print out a line count
: of the text stored in $s:
: 
: > my $s = "foo\nbar\n";
: > print (scalar (split '\n', $s));
: 
: My problem is the following warning:
: 
: > Use of implicit split to @_ is deprecated at ./gna line 4.

>From the perlfunc entry on split:

    If [in scalar] context, returns the number of fields found and
    splits into the C<@_> array.  (In list context, you can force the
    split into C<@_> by using C<??> as the pattern delimiters, but it
    still returns the list value.)  The use of implicit split to C<@_>
    is deprecated, however, because it clobbers your subroutine
    arguments.

Are you trying to remove the trailing newline from $s?  Why not chomp
it?  If you really like using split, just lose the scalar like

    print split "\n", $s;

Note that the use of double quotes in this case is important.  Inside
double quotes, the sequence \n means newline, but it's literally \n
inside single quotes.

Hope this helps,
Greg
-- 
Woody: Hey, Mr. Peterson, there's a cold one waiting for you. 
Norm:  I know, and if she calls, I'm not here


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

Date: 20 Aug 1998 10:01:32 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: [Q] deprecated use of split (what? why?)
Message-Id: <1zqbn1df.fsf@mailhost.panix.com>

gbacon@cs.uah.edu (Greg Bacon) writes:

>     print split "\n", $s;
> 
> Note that the use of double quotes in this case is important.  Inside
> double quotes, the sequence \n means newline, but it's literally \n
> inside single quotes.

   $s = "foo\nbar\nbaz";
   print join('*', split('\n', $s));
   __END__
   foo*bar*baz

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Thu, 20 Aug 1998 07:16:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: [Q] deprecated use of split (what? why?)
Message-Id: <MPG.1045cf7d7c25fe969897d8@nntp.hpl.hp.com>

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

In article <y9izpcz7uff.fsf@mpii02700.mpi-sb.mpg.de> on 20 Aug 1998 
13:40:36 +0200, Matthias Fischmann <fis@mpi-sb.mpg.de> says...
 ...
> The following code should (and actually does) print out a line count
> of the text stored in $s:
> 
> > my $s = "foo\nbar\n";
> > print (scalar (split '\n', $s));

When what you are counting is the occurrences of single characters, the 
best way is to avoid actually creating an array and counting the elements 
in the array, by using the 'tr' operator:

print $s =~ tr/\n//;

does what you want.  You can also count single characters from a set of 
characters:

$_ = 'banana';
print tr/ab//;

prints 4.

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


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

Date: Thu, 20 Aug 1998 16:07:31 +0200
From: Ernst Christensen <e.christensen@netjob.dk>
To: "8\(F&@" <versace@gianni.com>
Subject: Re: Call another perl script?
Message-Id: <35DC2DA2.11FF9A30@netjob.dk>

Hi
How about
system("a.pl");
or
print "Location: a.pl \n\n";



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

Date: Thu, 20 Aug 1998 09:03:11 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Comparison operator
Message-Id: <linberg-2008980903110001@projdirc.literacy.upenn.edu>

In article <6rh5p3$e3j$1@cronkite.ocis.temple.edu>, eoh@thunder.temple.edu
(Ekeho Oh) wrote:

> Hi Folks,
> I am a newbie of Perl.
> I've got strange result. I compare $abc with 10 using == or ne. The 
> result wrong. I tried "10" also. Same result.
> But lt, <, gt work fine.
> i.e.
> if ($abc == 10)
> {
> printf xxx
> }

---------------------------
> perl
$abc = 10;
if ($abc == 10) {
  print "It worked!\n";
}
__END__
It worked!
>
---------------------------

Works for me.  How about a more complete code sample where we see what
you're putting in $abc?
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Wed, 19 Aug 1998 15:29:39 -0600
From: Ky Nguyen <knguyen@ab.bluecross.ca>
To: Brett Lawrence <Brettl@datent.com>
Subject: Re: creating a nt service with perl
Message-Id: <35DB43C3.F088DD@ab.bluecross.ca>

Install resource kit, and SRVANY.EXE will do the trick.

Brett Lawrence wrote:

> Hi
> Can anybody tell me if you can create a service for nt using perl?
> If so could you point me to some information on how to do this.
>
> Thanks Brett





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

Date: Thu, 20 Aug 1998 13:50:23 GMT
From: b_redeker@hotmail.com
Subject: Re: Dumb Windows Question
Message-Id: <6rh9iv$8v2$1@nnrp1.dejanews.com>

In article <35DB3816.68EDEEAB@unlinfo.unl.edu>,
  Robert Losee <rlosee@unlinfo.unl.edu> wrote:
> Maybe I'm dumb, or maybe Windows. I'm hoping you can tell me.
>
[snip]
oh boy, you will be flamed for this (so I won't do it)
cause it isn't a Perl-question.
I know three options:
* make a pif-file;
* make a batch-file and link .pl to that;
* add $_=<STDIN>; at the end of your script;
either one can have it's advantages

--
Boudewijn

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


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

Date: Thu, 20 Aug 1998 16:17:30 +0200
From: Ernst Christensen <e.christensen@netjob.dk>
To: Jim Woodgate <jdw@dev.tivoli.com>
Subject: Re: example for sending mail with perl under win32
Message-Id: <35DC2FFA.A03B174F@netjob.dk>

Hi
This one works (for me)
My NET module is installed something different than it should be, so the
first line is not correct?


use lib '/Net::SMTP';

                   $smtp = Net::SMTP->new('mailhost.nnn.com'); # connect
to an SMTP server

                   $smtp->mail( 'e.christensen@netjob.dk' );     # use
the sender's address here

                   $smtp->to('e.christensen@netjob.dk');        #
recipient's address

                   $smtp->data();                      # Start the mail

                   # Send the header.
                   #
                   $smtp->datasend("To: e.christensen\@netjob.dk\n");
                   $smtp->datasend("From:e.christensen\@netjob.dk\n");
  $smtp->datasend("Subject: Justtesting\n");
                   $smtp->datasend("\n");

                   # Send the body.
                   #
                   $smtp->datasend("Hello, World!\n");
   $smtp->datasend("Hello, there!\n");
                   $smtp->dataend();                   # Finish sending
the mail
                   $smtp->quit;                        # Close the SMTP
connection



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

Date: Thu, 20 Aug 1998 13:46:22 GMT
From: nana@my-dejanews.com
Subject: help, @INC doesn't contain /usr/lib/perl5
Message-Id: <6rh9be$8s7$1@nnrp1.dejanews.com>

I've just installed latest perl on my linux on intell. actually it was
installed with linux, but then I needed some additional modules. I tryed to
use CPAN shell to install them and finally ended up installing the latest
perl5.00502.

Now my problem is that it can't find any module which is in /usr/lib/perl5
(strict.pm for example) and reason is that @INC contains
/usr/lib/perl5.00502, /usr/lib/perl5/site_perl, etc, except /usr/lib/perl5.
Is this a way it sould be, or do I need somehow to include /usr/lib/perl5 in
@INC and how to do that?

thanks

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


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

Date: Thu, 20 Aug 1998 08:51:06 -0500
From: Frank Delin <fdelin@uhl.uiowa.edu>
Subject: HELP: Easy question, I just can't figure out the answer.
Message-Id: <35DC29CA.27A70420@uhl.uiowa.edu>

Why doesn't this statement assign the value "2" to the variable
$putErCode?
There is no tmp directory and it output the 2 to the output stream but I
was under the impression I could also capture the value in a var.

$putErCode = chdir("tmp") || warn("2");

Thanks in advance,

Frank Delin
fcdelin@blue.weeg.uiowa.edu





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

Date: 20 Aug 1998 10:05:11 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Frank Delin <fdelin@uhl.uiowa.edu>
Subject: Re: HELP: Easy question, I just can't figure out the answer.
Message-Id: <zpczlmmw.fsf@mailhost.panix.com>

Frank Delin <fdelin@uhl.uiowa.edu> writes:

> There is no tmp directory and it output the 2 to the output stream but I
> was under the impression I could also capture the value in a var.
> 
> $putErCode = chdir("tmp") || warn("2");

I don't see anything in the documentation for warn() that suggests
that it returns its argument.  You could use the scalar comma
operator, though:

  $putErCode = chdir("tmp") || (warn("2"), 2);

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 20 Aug 1998 14:51:06 GMT
From: "shioky" <shioky@pc.jaring.my>
Subject: How to create a searchable database
Message-Id: <01bdcc4b$74a18d80$741c8ea1@jaring.ltc>

Hello! Do you know how to create a searchable database?
If do,pls tell me.
Thankx


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

Date: Thu, 20 Aug 1998 09:21:05 -0400
From: jbl <jlaird@nih.gov>
Subject: How to include print codes in a perl generated text file
Message-Id: <35DC22C1.ECD213D0@nih.gov>

How does one include print codes in a perl generated text file to be
printed?
I have an HP print code web page to get the different codes, but I don't
understand how the printer will know in the text file how to print the
text while interperting the print codes.
JBL



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

Date: Thu, 20 Aug 1998 10:02:55 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: How to include print codes in a perl generated text file
Message-Id: <linberg-2008981002550001@projdirc.literacy.upenn.edu>

In article <35DC22C1.ECD213D0@nih.gov>, jbl <jlaird@nih.gov> wrote:

> How does one include print codes in a perl generated text file to be
> printed?
> I have an HP print code web page to get the different codes, but I don't
> understand how the printer will know in the text file how to print the
> text while interperting the print codes.

This sounds like a printer question, not a Perl question... your printer
has to know how to interpret what you put in your text file.  All you have
to do, as you say, is put the right codes in - just print away!

print qq{
here is some text bring printed to a file.
This is a line <printer code> with some </printer code> formatted code for
my printer, the &syntax& of which [0x0D] only I know.
);
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: 18 Aug 1998 00:35:17 +0200
From: ogj@tglobe3.tollpost.no (Xyvind Gjerstad)
Subject: Re: Informix ONL 5.0 / ESQL 4.10.U and PERL 5.00404
Message-Id: <wrhfzbme3e.fsf@tglobe3.tollpost.no>

Rich Sy <Richmont.Sy@exchange.sms.siemens.com> writes:

> We have informix online 5.0 and esqlc 4.10.U.  We want to use perl
> 5.00404 to interface with informix.  So far we've not found any
> available perl interface to informix that can make use of what we
> currently have. I thought I've found something with the older 'isqlperl'
> but it only compiles with perl 4.

I have used it (isqlperl) with several ports of Online 5.0X. No problem, 
except that you'll have to rewrite to use DBI/DBD when upgrading to a newer
Online (7.X).
The build should be pretty straightforward. Seem to recall some troubles 
with libraries. If you get complaints about missing libraries, check 
with nm(1) under $INFORMIXDIR/lib and include the missing libraries in
the linker command line in the Makefile.
-- 
Xyvind Gjerstad    Systems dept Tollpost-Globe AS  N-6301 Endalsnes/Norway
E-mail: ogj@it.tollpost.no     Phone: +47 7122 6663     Fax: +47 7122 6694


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

Date: Thu, 20 Aug 1998 14:19:21 GMT
From: h.benne@library.uu.nl (Hugo Benne)
Subject: Locking files on Window 95 server
Message-Id: <6rhb9q$34s$1@news2.xs4all.nl>

Hello !

I tried to use the command "flock (FILE,2);" to lock a file on our Win95 
webserver. But instead of locking the file, the script stopped/crashed after 
this line of Perl code.

Is this a known problem and does anybody know the solution ?

Regards,

Hugo

--------------------------------------------------
Universiteit Utrecht, Faculteit Rechtsgeleerdheid
Juridische Bibliotheek, Afdeling ICT
http://www.library.law.uu.nl/
e-mail: h.benne@library.uu.nl
Postadres: Ganzenmarkt 32, 3512 GE Utrecht
Bezoekadres: Hoogt 13
Telefoon (030) 2537206, Telefax (030) 2538409
--------------------------------------------------


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

Date: Thu, 20 Aug 1998 10:36:56 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Locking files on Window 95 server
Message-Id: <linberg-2008981036560001@projdirc.literacy.upenn.edu>

In article <6rhb9q$34s$1@news2.xs4all.nl>, h.benne@library.uu.nl (Hugo
Benne) wrote:

> Hello !
> 
> I tried to use the command "flock (FILE,2);" to lock a file on our Win95 
> webserver. But instead of locking the file, the script stopped/crashed after 
> this line of Perl code.
> 
> Is this a known problem and does anybody know the solution ?

see perlfaq5: How do I lock a file?
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Thu, 20 Aug 1998 14:15:55 GMT
From: dzuy@my-dejanews.com
Subject: Re: NEWBIE Question: Perl Script in Unix vs. NT
Message-Id: <6rhb2r$art$1@nnrp1.dejanews.com>

In article <35db481f.198124758@uphs1>,
  NOjcjSPAM@mail.med.upenn.edu (Mr. Mirthful) wrote:
> Hi,
>
> i have the following Perl Script, which is used to keep track of
> results from a survey. it works when running it from an NT based web
> server, and now i need to have it running from Unix. The problem is
> that when it is run, it returns an "internal server error". On the
> Unix box, other Perl programs are running fine, so it is not a
> configuration problem. i assume there must be something in the code
> that is correct for NT but not Unix. Any help would be greatly
> appreciated.
>
>
	Use vi on UNIX to edit your script.  If you see an ^M at the end
	of every line, this is your problem.  This is also a problem if
	you try to read in a DOS format file, UNIX cannot find the end of
	line.  You need to strip off all ^M.  Type

		<shift>:1,$s/<ctrl>v<shift>m//g

	This will strip all ^M.

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


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

Date: Thu, 20 Aug 1998 15:03:52 +0200
From: "sCALP" <scalp@orka.fr>
Subject: perl -U don't work..
Message-Id: <6rh6p4$c68$1@platane.wanadoo.fr>

hi!
i'm using a perl script to manage .htaccess files (or to do any critic
commands)
i have a perl like this:

#!/usr/bin/perl -U
cat /etc/shadow                          <-- it's just to try something
'critic'


and i set its attributes to +x and +s.

the file work when i'm root and that i type ./myfile, but when i'm not root
(eg: user via internet (CGi)) it don't work...

what must i do... i work on SuSE 5.2 with Perl 5.00404...

can you help me and answer me: scalp@orka.fr
many thanks to you!
sCALP




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

Date: Thu, 20 Aug 1998 14:31:19 GMT
From: Scott.L.Erickson@HealthPartners.com (Scott Erickson)
Subject: Re: Perl Style
Message-Id: <35dc3055.3113705101@news.mr.net>

Previously, Zenin <zenin@bawdycaste.org> wrote:

>Scott Erickson <Scott.L.Erickson@HealthPartners.com> wrote:
>: Previously, Tom Christiansen <tchrist@mox.perl.com> wrote:
>        >snip<
>: >Anyone who thinks "or" is more legible than "||", or "BEGIN" is more
>: >legible than "{", should go try playing the calculus without recourse
>: >to any symbolic notation.
>:
>: What about calculus? If I was doing calculus, I would use math
>: notation. But I am not, I am use Perl, so I will use Perl language
>: constructs.
>
>        You just made Tom's point exactly.
>
>        The fact is, you *are* using Perl, but you are going out of your
>        way to avoid it's most basic primitive constructs.  There is
>        a reason "||" existed before "or".
>
>        The only reason "||" doesn't say "or" to one's mind as quickly or
>        faster even then "or" is simply because they haven't been
>        programming in C styled languages for long enough.

Please explain how I "made Tom's point exactly". Also, please explain
how I am going out of my way "to avoid [Perl's] most basic primitive
constructs." Maybe you just entered this thread and did not see all
the postings for this article. If you had read my postings in this
thread, maybe you would have noticed that I had said that for some
purposes, I think "or" is better than "||". I hardly see that as
support for the statement that " you are going out of your  way to
avoid it's most basic primitive constructs."

Also, are you implying that "||" is more primitive than "or"? If so,
how is it more primitive? And, do you believe that more primitive is
better than less primitive? If so, why? It is my understanding that
"or" is similar to "||", with a major difference being that "or" has
much lower precedence than "||".

As to the reasons as to why '||' existed before 'or', so what! They
both are valid parts of Perl, so I will use either as I see fit.

Scott.


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

Date: 20 Aug 1998 06:19:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Protecting a data struc with local or my?--More Confusion
Message-Id: <6rgf5b$5nd$1@marina.cinenet.net>

Rick Delaney (rick.delaney@shaw.wave.ca) wrote:
: Craig Berry wrote:
: > Use 'exists' to check for the existence of the key, and iff it exists
: > proceed to check for the defined-ness of its value.  E.g,
: > 
: >   if (exists $myhash{foo} && defined $myhash{foo}) {
: >     ...
: >   }
: 
: Unfortunately 'exists' will also allow references to spring into
: existence with some flavours of perl (5.004_04).  For example:
[example snipped]

Not so, you're bringing the intermediate-level key into existence in your

:             print "$y\n" if exists($ref->{$x}{$y});

line in the test function.  (Had me worried there for a minute, though...) 

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


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

Date: 20 Aug 1998 09:06:00 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: wlo7128808@aol.com (WLo7128808)
Subject: Re: Rounding & floating point problems
Message-Id: <iujnn3xz.fsf@mailhost.panix.com>

wlo7128808@aol.com (WLo7128808) writes:

> I can't explain it, it seems to have something to do with the way
> Perl does floating point arithmetic.

Please see the question "Why am I getting long decimals (eg,
19.9499999999999) instead of the numbers I should be getting (eg,
19.95)?" in perlfaq4.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Thu, 20 Aug 1998 10:03:30 -0400
From: Phuong Le <ple@mitra.com>
Subject: Same subroutine name in require files
Message-Id: <35DC2CB2.80DFCC73@mitra.com>

require 'f1.pl';
require 'f2.pl';

f();

If both f1.pl and f2.pl implement a subroutine f.  When f is call Perl
cannot resolve to which f to call and so it hang.

Is there a way to resolve this ambiguity without rename one the
subroutine name?


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

Date: Thu, 20 Aug 1998 06:58:05 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: setting environment variables
Message-Id: <d03hr6.5mi.ln@metronet.com>

Nitin Gupta (niting@raleigh.ibm.com) wrote:
: How can I set an env variable dynamically from within PERL? I have a script
: which sometimes needs to access the proxy server so I need to set the
: 'http_proxy' env. variable for the session the script is running under.


   $ENV{http_proxy} = 'my.server';


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 20 Aug 1998 09:53:06 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: such a thing as a "perl user"?
Message-Id: <67fnn1rh.fsf@mailhost.panix.com>

linberg@literacy.upenn.edu (Steve Linberg) writes:

> Has anybody ever written poetry in C?  

Well...  http://reality.sgi.com/csp/ioccc/1990/westley.c

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 19 Aug 1998 22:09:53 -0500
From: Jim Woodgate <jdw@alder.dev.tivoli.com>
Subject: Re: system call "find" in PERL
Message-Id: <ob1zqcl56m.fsf@alder.dev.tivoli.com>


Eric Sheng <shenge@ece.ucdavis.edu> writes:

> 	foreach $dir (sort (`find Grandpa_ma/$son_name \\( -name 'prog_*' -o -name 'grandson_non_hacker' \\)` ) ) {
> 	    chomp $dir;
> 	    if ($dir =~ m|.*/grandson_non_hacker$|) {
> 		foreach $non_hacker (sort (`find $dir -name \'\*.occup\'`) ) {
> 		    $family_tree{$non_hacker} = "1\n";

just for kicks try running your find commands from the command line,
only use find2perl as the find binary instead of find, I think you'll
be pleasantly suprised... :)


> 		$num_programs = `ls -l $dir/*.ext 2>/dev/null | wc -l 2>/dev/null`;
> 		$family_tree{$dir} = $num_programs;
> 	    }

I think you're right that all your system calls, especially the
externals finds are probably killing performance, but I don't know if
you'll ever get 600 files in 5-10 seconds, however running ls -l and
piping to wc is *really* bad, ls -l will stat every file, when it
looks like you're only really interested in the filenames, which can
be extracted using opendir/readdir.  I'd write some example code, but
this looks a little too much like homework for my taste... :)

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: 20 Aug 1998 09:08:08 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: mike_murphy-ppk@nortel.com (Michael Murphy)
Subject: Re: The @INC path
Message-Id: <emubn3uf.fsf@mailhost.panix.com>

mike_murphy-ppk@nortel.com (Michael Murphy) writes:

> knguyen@ab.bluecross.ca wrote:
> > 2. My 2nd question is how do I change @INC path?
> 
> $INC[@INC] = '/new/path/goes/here';

I would instead recommend

  use lib '/new/path/goes/here';

which is evaluated at compile time.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Thu, 20 Aug 1998 16:04:48 +0200
From: Falk Hartmann <f.hartmann@intershop.de>
Subject: Trouble with Net-SSL
Message-Id: <35DC2D00.AAF4D439@intershop.de>

Hi all,
I have trouble using Net-SSL v1.02 on a WinNT machine. It compiles
without problems, using SSLeay v0.9.0(b), but it causes Perl to crash
when invoking the module. Does anyone encounter similar problems and can
provide any hint that might help?

Thanx in advance,
Falk




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

Date: Thu, 20 Aug 1998 10:21:32 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Utility for news article fetching selected by keywords ?
Message-Id: <linberg-2008981021320001@projdirc.literacy.upenn.edu>

In article <linberg-2008980850440001@projdirc.literacy.upenn.edu>,
linberg@literacy.upenn.edu (Steve Linberg) wrote:

> In article <rd7m04c9us.fsf@epiphore.francenet.fr>, Gildas Perrot
> <perrot@francenet.fr> wrote:
> 
> > Hi everybody,
> > 
> > Is there any tool to fetch in certain newsgroups, articles
> > selected by keywords ?  
> > Thanks in advance for your help.  Gildas.
> 
> How about News::NNTP?  Go to www.perl.com and check the CPAN archives.

Oops, I meant Net::NNTP, obviously... or News::NNTPClient.  Sorry.
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3490
**************************************

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