[18707] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 875 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 11 09:05:38 2001

Date: Fri, 11 May 2001 06:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989586312-v10-i875@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 11 May 2001     Volume: 10 Number: 875

Today's topics:
    Re: 1 billion seconds bug <bart.lateur@skynet.be>
    Re: 1 billion seconds bug <ilya@math.ohio-state.edu>
    Re: 1 billion seconds bug <bart.lateur@skynet.be>
    Re: Base 6 sieve. (Anno Siegel)
    Re: basic TRUE / FALSE (Rudolf Polzer)
    Re: CGI=HASH(0x176ef80) Help Please! (M.J.T. Guy)
    Re: CGI=HASH(0x176ef80) Help Please! <bart.lateur@skynet.be>
    Re: CGI=HASH(0x176ef80) Help Please! (Anno Siegel)
    Re: CGI=HASH(0x176ef80) Help Please! (Anno Siegel)
        collect versions of loaded modules <Tim.Lauterborn@gmx.de>
    Re: dynamischer download - CGI <nehls@uni.de>
    Re: Existing Script To Add Time (John Doherty)
    Re: format Question <lmoran@wtsg.com>
    Re: format Question (M.J.T. Guy)
    Re: format Question (Randal L. Schwartz)
        Large environment stops processes spawning <donotreply@interbulletin.bogus>
    Re: Local Time <bart.lateur@skynet.be>
    Re: Local Time <flavell@mail.cern.ch>
    Re: New Perl Script <me@my_no_spam.org>
    Re: OZ as a beginners' banguage? <lager@ling.gu.se>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
        Proposed new pragma: caution. 194.203.215.187 [demerphq@hotmail.com]
        Q: eval and bypassing ctrl-flow cases <pedroni@inf.ethz.ch>
    Re: Q: eval and bypassing ctrl-flow cases <ack@ivu.de>
        Tips for using the Perl Debuger <chris_newman@bigpond.com>
    Re: weird error on @array syntax (Rudolf Polzer)
    Re: weird error on @array syntax <bart.lateur@skynet.be>
    Re: weird error on @array syntax (M.J.T. Guy)
    Re: weird error on @array syntax (M.J.T. Guy)
    Re: weird error on @array syntax <bart.lateur@skynet.be>
    Re: weird error on @array syntax (M.J.T. Guy)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 11 May 2001 08:33:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: 1 billion seconds bug
Message-Id: <iq8nft4kfbvvl1e1n43k275sf629ckcnms@4ax.com>

Ilya Zakharevich wrote:

>[A complimentary Cc of this posting was sent to
>Bart Lateur 
><bart.lateur@skynet.be>], who wrote in article <l62mft49r35cseuhhuang7pilbffqbi0hf@4ax.com>:
>> Except for people using a Mac.
>
>>  - Seconds since epoch are in local time. Local time?!?! Yes, local
>> time.
>
>Hmm?  Do you mean "seconds since epoch was reached in the local time"?
>"Local time" according to the laws of 1904 (including Russia having a
>Julian calendar), or backpropagated laws of 1981, or backpropagated
>laws of the time of the last MacOS update, or what?
>
>Or is it seconds between epoch and the moment when UTC local-time is
>equal to the local time?
>
>Puzzled,

Perhaps this post in the archives of the MacPerl mailing list might
clear things up.

	<http://bumppo.net/lists/macperl/2000/05/msg00161.html>


One could say that the hardware clock on a Mac counts in localtime.
gmtime is calculated, based on the time zone and daylight savings time,
and not the other way around, as on Unix.

-- 
	Bart.


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

Date: 11 May 2001 09:46:14 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: 1 billion seconds bug
Message-Id: <9dgcd6$kku$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Bart Lateur 
<bart.lateur@skynet.be>], who wrote in article <iq8nft4kfbvvl1e1n43k275sf629ckcnms@4ax.com>:
> One could say that the hardware clock on a Mac counts in localtime.
> gmtime is calculated, based on the time zone and daylight savings time,
> and not the other way around, as on Unix.

Some Unices may operate in this mode too (Linux).  Win*, DOS and OS/2
operate in this way too.  What is so special about Macs?

Ilya


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

Date: Fri, 11 May 2001 10:19:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: 1 billion seconds bug
Message-Id: <otenft4l5j6ckmqcrqj8gv4jhe2kvrh84v@4ax.com>

Ilya Zakharevich wrote:

>Bart Lateur wrote:
>> One could say that the hardware clock on a Mac counts in localtime.
>> gmtime is calculated, based on the time zone and daylight savings time,
>> and not the other way around, as on Unix.
>
>Some Unices may operate in this mode too (Linux).  Win*, DOS and OS/2
>operate in this way too.  What is so special about Macs?

The fact that the epoch is nothing close to 1970?

When installing FreeBSD, it offers you the choice to keep the clock in
"stupid mode" for MS-DOS compatibility, or to set it to GMT.

But the OP said that *every* computer in the world would soon switch to
a time() of 1 billion, all a the same time. Clearly, this can't be true.

-- 
	Bart.


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

Date: 11 May 2001 12:45:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Base 6 sieve.
Message-Id: <9dgmsd$s3q$1@mamenchi.zrz.TU-Berlin.DE>

According to Abigail <abigail@foad.org>:
> Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMDCCCIX
> September MCMXCIII in <URL:news:9dem5b$jsr$1@mamenchi.zrz.TU-Berlin.DE>:
> ~~  According to Abigail <abigail@foad.org>:
> ~~ > Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMDCCCVII
> ~~ > September MCMXCIII in <URL:news:9d9b9t$jbu$1@mamenchi.zrz.TU-Berlin.DE>:
> ~~ > 
> ~~ > There's little about a sieve you can do to make it language specific.
> ~~ > All significant optimizations (one byte of usage per 24 possible numbers,
> ~~ > and the core loop) are language independent - so it translates easily
> ~~ > to C or assembler. As long as your language gives you access to bits.
> ~~  
> ~~  Well, in your first sieve program in one place you wrote "$n << 1" for
> ~~  "2*$n", clearly inspired by a parallel stream of low-level thinking.
> 
> I also said that I think it shouldn't matter whether you write $n << 1, 
> 2 * $n or $n + $n, a good compiler should generate identical, optimal,
> code. In the absense of overloaded or tie()d stuff of course.

Yes, that's why the shift stands out.  It isn't there to make perl
fast but to remind the reader (and possible translator to assembly)
that the multiplication can be done this way.

> ~~ > There is, however, a major inefficiency in the program that's screaming
> ~~ > to be optimized away. Can you guess what it is?
> ~~  
> ~~  If you are clearing bits more often than necessary I don't see it.  If
> ~~  there were an easy way to predict which bits will be cleared, we wouldn't
> ~~  need this nifty algorithm
> ~~  
> ~~  There's only one place where I see potential room for improvement:
> ~~  could the calculation of the actual index into the sieve be simplified
> ~~  if the previous value was saved?  Some previous partial result?  Off
> ~~  the top of my head I don't see how, but we do know that $n is a prime
> ~~  larger than the factors of $BASE, maybe that helps... .
> ~~  
> ~~  Well, I guess that amounts to a declaration of defeat.  I don't hear
> ~~  the screaming.
> 
> 
> Well, currently the loop calculates the next number to be scrubbed,
> and from that, the bitindex is calculated. Calculating the next number
> is done reasonably efficient, but completely unnessary. In stead of
> calculating the next number, all that's needed is calculating the
> next bit index. We know by how much the next number is incremented
> (2 * $n and 4 * $n (results that could have been cached)), but there's
> a linear relationship between the skips in numbers and the skips in

Well, linear it isn't but it's certainly one-to-one since it's strictly
monotonous.

> bitindices. So, it should be much faster to keep track of the bit
> indices, as that's the only thing we are interested in.

It's strange but true that the algorithm doesn't need to know the
non-prime number it is about to scrub.  Going directly from one sieve
index to the next is certainly a possibility, though I don't see
first sight why it would have to be faster.  The relationship of one
sieve index to the next looks rather complex.

Lessee... it looks as though for each n there are two alternating
increments involved.  If this were provable it could indeed speed
up the scrub loop, even if we have to invest some time to find what
the increments are for each n and which comes first.

Anno


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

Date: Thu, 10 May 2001 20:04:31 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: basic TRUE / FALSE
Message-Id: <slrn9flm1f.135.eins@www42.t-offline.de>

Todd Smith <todd@designsouth.net> wrote:
> >
> > my $showvar = TRUE;
> >
> > I can't find anything in the FAQs or docs about use of these things.  Can
> I
> > not use them this way?
> >
> 
> 
> no, use 0 or 1

and if he really wants to use TRUE and FALSE:

use constant TRUE => 1;
use constant FALSE => 0;

-- 
#!/usr/bin/perl --       !     !  !   !  !    !       # PerlPaint
print 'You owe me $' .  ! !   !  !   !  !    !        # (c)2001RP
                       !   ! !  !   !  !    !         ###########
                      !     !   !!!!  !!!! !!!!   'NULL!' . ".\n"


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

Date: 11 May 2001 12:03:04 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: CGI=HASH(0x176ef80) Help Please!
Message-Id: <9dgkdo$qpl$1@pegasus.csx.cam.ac.uk>

Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>
>If the result is a scalar, ${ \ $query-param( 'fname')} works too.

But be aware that there is currently a bug in this construct, in that
$query->param is evaluated in list context instead of scalar context.
This may or may not matter in the particular example.


Mike Guy


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

Date: Fri, 11 May 2001 12:29:09 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CGI=HASH(0x176ef80) Help Please!
Message-Id: <vqmnft8a2ug16md1tpal9nvtegtofl4cih@4ax.com>

Anno Siegel wrote:

>If the result is a scalar, ${ \ $query-param( 'fname')} works too.

Even without the ">"?

-- 
	Bart.


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

Date: 11 May 2001 12:53:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: CGI=HASH(0x176ef80) Help Please!
Message-Id: <9dgnc3$s3q$2@mamenchi.zrz.TU-Berlin.DE>

According to M.J.T. Guy <mjtg@cus.cam.ac.uk>:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> >
> >If the result is a scalar, ${ \ $query-param( 'fname')} works too.
> 
> But be aware that there is currently a bug in this construct, in that
> $query->param is evaluated in list context instead of scalar context.
> This may or may not matter in the particular example.

Oh.  I wasn't aware of that.  Is it that an outside list context
is erroneously propagated, or will the inside of ${ ...} always
be in list context?  A cursory test seems to show that the latter
is the case.

Anno


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

Date: 11 May 2001 12:56:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: CGI=HASH(0x176ef80) Help Please!
Message-Id: <9dgnip$s3q$3@mamenchi.zrz.TU-Berlin.DE>

According to Bart Lateur  <bart.lateur@skynet.be>:
> Anno Siegel wrote:
> 
> >If the result is a scalar, ${ \ $query-param( 'fname')} works too.
> 
> Even without the ">"?

Hmmm?  Maybe I'm dense, but what ">"?

Anno


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

Date: Fri, 11 May 2001 14:37:11 +0200
From: "Tim Lauterborn" <Tim.Lauterborn@gmx.de>
Subject: collect versions of loaded modules
Message-Id: <9dgmft$ltf$1@nets3.rz.RWTH-Aachen.DE>

Hi,

I would like to collect automatically the version information from the
loaded modules of a perl program. Does anyone know how to do that by a
function and not manually?

Thanks!

Greetings,
Tim




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

Date: Fri, 11 May 2001 10:16:27 +0200
From: "Ulrich Nehls" <nehls@uni.de>
Subject: Re: dynamischer download - CGI
Message-Id: <9dg75l$8dn$1@rznews2.rrze.uni-erlangen.de>

"Thorsten Stueben" <thorsten@stueben.de> wrote in message
news:9dg1t4$eao$1@donald.stueben.inka.de...
> Hallo,
>
> ich habe folgendes vor: Ich möchte gerne Freunden, bestimmte Bilder die
ich
> auf meiner Homepage habe zum downloaden via FTP anbieten.

Deine Freunde sollten nen Rechtsklick auf die Bilder machen und sie dann
selbst runterladen.

> Ist das möglich? Und wenn ja, wie schaffe ich es die Files per zip zu
> komprimieren und anschließend zurückzugeben?

Die gängigen Grafikformate (jpg, gif) sind ihrer Natur nach bereits
komprimiert, so daß du nach dem zippen allenfalls eine Rate von <1%
feststellen wirst. Das Ganze ist von daher eigentlich nicht wert, daß man
dafür ein perlscript schreibt ...

Uli




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

Date: 11 May 2001 05:36:49 GMT
From: jdoherty@usenet.com (John Doherty)
Subject: Re: Existing Script To Add Time
Message-Id: <Xns909E6343445Djdoherty3141592654@198.99.146.18>

"grasshopper" <grasshopper99[no-spam]@hotmail.com> wrote in
<bNJK6.22617$Hk4.384649@news1.rdc1.ab.home.com>: 

>Wondering if anyone has a script (bourne or perl) available which
>can calculate the elapsed time between two given times such as:
>08:00 16:30 which would be an elapsed time of  08:30.

Given a file like this:
  
  $ cat foo
  00:00 00:05
  01:05 01:10
  02:10 03:20
  $

you can think of it as four fields:

  <starthour><startminute><endhour><endminute>

with fields separated by either a colon or a space.

Now calculate the start time and end time in minutes since midnight,
subtract the former from the latter, and print the resulting number 
of minutes:

  $ awk -F':| ' '{print (($3 * 60) + $4) - (($1 * 60) + $2)}' foo
  5
  5
  70
  $

Given the input, that's the best you can do. With input like this:

  23:00 01:00

there's no way to know how many days may have elapsed between the
start and end times. The number of minutes between the two is 120
plus a non-negative integer multiple of 1440, but there's no way
to know what that non-negative integer multiple is

--


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

Date: Fri, 11 May 2001 08:52:45 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: format Question
Message-Id: <5mnnftg9vn8mgcvp22skbtis95lpnaga5j@4ax.com>

On Fri, 11 May 2001 09:03:56 +0200, Philip Newton
<pne-news-20010511@newton.digitalspace.net> wrote wonderful things
about sparkplugs:

>On Thu, 10 May 2001 19:45:49 GMT, mjd@plover.com (Mark Jason Dominus)
>wrote:
>
>>         $pwd =~ y/a-z/22233344455566677788899900/;
>>         #             abcdefghijklmnopqrstuvwxyz
>> 
>> The first time I saw your y/// line, I had to grovel over it to make
>> sure that the two halves were the same.  With my version, you don't
>> need to do that.
>
>How about
>
>    $pwd =~ y[abcdefghijklmnopqrstuvwxyz]
>             [22233344455566677788899900];

No doubt both answers are better than this, but I am sort of fond of
that one because after all a little obfuscation is probably a good
thing for a variable named $pwd

;)

--
print "\x{263a}" 


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

Date: 11 May 2001 12:54:10 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: format Question
Message-Id: <9dgndi$qe$1@pegasus.csx.cam.ac.uk>

Mark Jason Dominus <mjd@plover.com> wrote:
>
>May I suggest:
>
>        $pwd =~ y/A-Z/a-z/;
>        $pwd =~ y/a-z/22233344455566677788899900/;
>        #             abcdefghijklmnopqrstuvwxyz
>
>The first time I saw your y/// line, I had to grovel over it to make
>sure that the two halves were the same.  With my version, you don't
>need to do that.

Or indeed, exploiting the wondrous facilities of y///

         $pwd =~ y/A-Za-z/22233344455566677788899900/;
         #                abcdefghijklmnopqrstuvwxyz


Mike Guy


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

Date: 11 May 2001 06:04:09 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: format Question
Message-Id: <m1k83o596e.fsf@halfdome.holdit.com>

>>>>> "M" == M J T Guy <mjtg@cus.cam.ac.uk> writes:

>> $pwd =~ y/A-Z/a-z/;
>> $pwd =~ y/a-z/22233344455566677788899900/;
>> #             abcdefghijklmnopqrstuvwxyz

M> Or indeed, exploiting the wondrous facilities of y///

M>          $pwd =~ y/A-Za-z/22233344455566677788899900/;
M>          #                abcdefghijklmnopqrstuvwxyz

Meaning that A-Z becomes those digits (2's through 0's), and
everything after that becomes the last digit repeated, making them all
0's?  I don't understand how that's "wonderous".  Why would I want all
lowercase characters to be 0?

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 11 May 2001 10:55:59 +0000
From: Chris Jack <donotreply@interbulletin.bogus>
Subject: Large environment stops processes spawning
Message-Id: <3AFBC53F.4750B387@interbulletin.com>


I am using perl, version 5.004_04 built for PA-RISC2.0 on an
HP machine running Unix version10.20.

If the size of the environment gets beyond about 20K, Perl stops
being able to spawn processes: e.g. the following program prints
nothing:
   $ENV{a} = "a" x 40000;
   system("echo hi");

For various reasons, it is difficult for me to reduce the size
of the environment or upgrade the Perl version.

Does anyone have any suggestions or workarounds?

Regards
Chris

_______________________________________________
Submitted via WebNewsReader of http://www.interbulletin.com



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

Date: Fri, 11 May 2001 09:26:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Local Time
Message-Id: <rubnftsff5nree0ihf8lhg4lu7r3fnuj8g@4ax.com>

Abigail wrote:

>  --  Given that the attacker has access to directories in your PATH, the
>      attacker might have access to other parts of your system too. (S)he
>      could just chroot() to you a place under her control, a place that
>      finds a rogue date in /bin/date.

You appear to be overlooking one thing here: PATH is not a system
constant. It is an environment variable. One that can relatively easily
be modified. New directories can then be added easily. Write access to
the directories *you* put in it, is not necessary.

There's a reason why Perl's taint mode doesn't trust $ENV{PATH} as
passed down by the system.

-- 
	Bart.


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

Date: Fri, 11 May 2001 11:16:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Local Time
Message-Id: <Pine.LNX.4.30.0105111107140.21137-100000@lxplus003.cern.ch>

On Thu, 10 May 2001, Abigail wrote:

> --  But as long as I'm not wearing my wizard's hat, then even if I had
> --  been duped into accepting a rogue executable, it won't just slink into
> --  /bin/date under its own steam - and even if it did manage to get
> --  itself in there, it would rate to get noticed rather soon, unless it
> --  mysteriously worked out how the system auditing was done and managed
> --  to subvert it before any alarms went off.
>
> False sense of security.

No dispute.  They could have fooled me into running their rootkit, or
starting a daemon on a high-numbered port.

There is no such thing as absolute security.  It's a compromise; but
just because absolute security is impossible is no reason to leave
doors open and windows unlatched when they have been pointed out as an
additional security exposure.

> There's only one way: Fix your security hole,

OK, you tell me where they all are, and I'll fix them.  The problem is
surely not knowing where they all are?

cheers



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

Date: Fri, 11 May 2001 08:18:00 -0400
From: Dave VP <me@my_no_spam.org>
Subject: Re: New Perl Script
Message-Id: <3AFBD878.C6484A23@my_no_spam.org>

Josh wrote:
> 
> Hello could some one make me  a perl script i Think its a easy script well
> If you want to help
> 
> E-mail me Jap108864@home.com

*Poof* -- You are a now perl script.


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

Date: Fri, 11 May 2001 13:13:07 +0200
From: =?iso-8859-1?Q?Torbj=F6rn?= Lager <lager@ling.gu.se>
To: "Biep @ http://www.biep.org/" <reply-via@my-web-site.com>
Subject: Re: OZ as a beginners' banguage?
Message-Id: <3AFBC943.6ABBD8BD@ling.gu.se>



"Biep @ http://www.biep.org/" wrote:
> 
> On a related note, what would people think of OZ as a beginners' language?
> (http://www.mozart-oz.org)  Is it used anywhere as such?

Two relevant items from the Mozart Latest News page at 
http://www.mozart-oz.org/news.cgi:

---------------------------------------------------------- 
Apr 4,
2001 Mozart at the 7th World Conference on Computers in Education
(WCCE)

The 7th World Conference on Computers in Education (WCCE 2001) will
take place in Copenhagen, Denmark from July 28 to Aug. 3, 2001.

At WCCE 2001, there will be a panel discussion on Monday, July 30, from
11:00 to 12:30, on The Next Generation of Programming Languages.
Moderator: Juris Reinfelds. Participants: Peter Van Roy, Corky
Cartwright, Seif Haridi, Mikihiko Onari, Arthur Tattnall, and Ingrid de
Vargas Milto.

(Peter Van Roy and Seif Haridi are in the OZ development team, and are 
also authors of the book draft at:
 
      http://www.info.ucl.ac.be/~pvr/book.ps.gz
      http://www.info.ucl.ac.be/~pvr/book.pdf

)

---------------------------------------------------------- 
Jan 31, 2001
Multiparadigm Programming Without Loss of Depth

There will be a session on the use of Mozart/Oz for computer science
education at the:

  32nd SIGCSE Technical Symposium on Computer Science Education

to be held on Feb. 21-25, 2001, in Charlotte, NC USA. The SIGCSE
symposium Web site is:

            http://www.math.grin.edu/~sigcse/2001/

The Mozart session is titled: Multiparadigm Programming Without Loss of
Depth and will be presented by Juris Reinfelds of New Mexico State
University in a "Birds of a Feather" session on Thursday Feb. 22, from
5:15 pm to 6:15 pm.
----------------------------------------------------------

-- 
----------------------------------------------------------------
Torbjörn Lager                  Computational Linguist
Department of Linguistics       Uppsala University
S-751 20 Uppsala                Sweden
Phone: +46 18 471 7860          http://stp.ling.uu.se/~torbjorn/
----------------------------------------------------------------


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

Date: Fri, 11 May 2001 08:20:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <uq7nftogctnn1reoriapbo2ep1ufa6qggr@4ax.com>

tadmc@augustmail.com wrote:

>Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)

Looks really good. Even better than the previous version(s).

>    Search a Usenet archive
>        There are tens of thousands of Perl programmers. It is very likely
>        that your question has already been asked (and answered). See if you
>        can find where it has already been answered.
>
>        One such searchable archive is
>        <URL:http://www.deja.com/home_ps.shtml>.

Unfortunately, Deja aka DejaNews is no longer. <groups.google.com>
allegedly took over the archive, but until now, it is not even a mere
shadow of what DejaNews used to be. It's a pity.


>        For more information on choosing a Subject see "Choosing Good
>        Subject Lines"
>        <URL:http://www.perl.com/CPAN-local/authors/Dean_Roehrich/subjects.p
>        ost>

Oops,  this URL has been wrapped. This should be avoided, even if the
line turns out to be slightly longer than 76 characters. If all else
fails, drop the "URL:".

-- 
	Bart.


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

Date: Fri, 11 May 2001 08:24:10 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3g8nftcapgjgfh363ca3pjpf9k352ohss3@4ax.com>

Andras Malatinszky wrote:

>>        - Check the Perl Frequently Asked Questions (FAQ)
>
>You might want to include a URL here. I know that theoretically you should be
>able to find the FAQ on your own machine, but in practice this doesn't seem to
>work for newbies.

He might mention that the FAQ is part of the online docs, included with
every distribution. In Win32 Perl distributions (ActiveState,
IndigoPerl), all are available in two formats: POD and html.

Pointing to the docs for perldoc, for efficiently searching through the
docs, is one more possibility.

>>        - Check the other standard Perl docs (*.pod)
>
>What is pod? Again, if I know, I probably don't need this piece of advice. If I
>am new to the game, I may not know.

See above.

-- 
	Bart.


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

Date: 11 May 2001 11:43:26 GMT
From: 194.203.215.187 [demerphq@hotmail.com]
Subject: Proposed new pragma: caution.
Message-Id: <9dgj8u7s1r@news1.newsguy.com>


Hello All

I have just applied for a CPAN id to release a new pragma.
This pragma is intended for those of us that are too lazy to put

use strict;
use warnings;

at the start of their scripts, and who do not like the command line switch style of doing the same.  Instead with this module you can simply type

use caution;

And likewise if you wish to diable all strict and warnings options, and thus throw caution to the wind you may

no caution;

Well, actually I am taking a liberty here, my current invocation would actually be

use ex::caution;
and
no ex::caution;

As this idea is still experimental.  But I think you can see the idea..

Any thoughts are welcome...

Yves/DeMerphQ









==================================
Poster's IP address: 194.203.215.187
Posted via http://nodevice.com
Linux Programmer's Site


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

Date: Fri, 11 May 2001 11:57:10 +0200
From: Samuele Pedroni <pedroni@inf.ethz.ch>
Subject: Q: eval and bypassing ctrl-flow cases
Message-Id: <3AFBB776.E298AB63@inf.ethz.ch>

Hi, asking in peace:

I have the following the problem:
for my (first) perl program I would like to use eval to evaluate perl
single liner
but I have been biten by the following behaviour:
e.g.

print eval('1 unless 666'),"\n"

prints 666

and eval('1 if ""') eq ""

I expected defined(eval('1 if ""')) to be false:

Is this behaviour idiomatic, funny, ill-defined or a difficult to remove
implementation (buggy?) corner case?

I have tried the following workaround:

eval('return ' . $expr . '; undef')

it is not very general but basically it's ok for my needs; is there a
better way?

Thanks, Samuele Pedroni.



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

Date: Fri, 11 May 2001 14:47:56 +0200
From: Ulrich Ackermann <ack@ivu.de>
Subject: Re: Q: eval and bypassing ctrl-flow cases
Message-Id: <3AFBDF7C.7D3B26CE@ivu.de>

Samuele Pedroni wrote:

> Hi, asking in peace:
>
> I have the following the problem:
> for my (first) perl program I would like to use eval to evaluate perl
> single liner
> but I have been biten by the following behaviour:
> e.g.print eval('1 unless 666'),"\n"

prints the return value of the eval function call (which seems to be '666')
followed by a newline.
Putting the 'print' statement into the eval might change that behaviour but
is maybe not what you are looking for.
val('print 1 unless 666');
print "\n";

HTH, Ulrich



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

Date: Fri, 11 May 2001 18:41:12 +1000
From: Chris Newman <chris_newman@bigpond.com>
Subject: Tips for using the Perl Debuger
Message-Id: <B721E2C8.662E%chris_newman@bigpond.com>



Yes I have read to the FAQs but this is a question about personal working
habits

What is the most efficient way to set up and working with the Perl debuger?
Use aliases for common tasks. Use the a LINE ACTION command to view changes
to variables. Any suggestions (NO FLAMES PLEASE) would be appreciated. We
all need to learn sometime.



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

Date: Thu, 10 May 2001 19:58:30 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: weird error on @array syntax
Message-Id: <slrn9fllm6.135.eins@www42.t-offline.de>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> @a = @a;
> print "@a\n";

I would use (then it is strict-safe):

use vars qw/@a/;
eval $str;
print "@a\n";



-- 
#!/usr/bin/perl -w -- sequences
$0=++$|;for(;;){print-length$0;$0=~s/(.)\1*/$1.length$&/ge;}print"\n";


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

Date: Fri, 11 May 2001 11:19:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: weird error on @array syntax
Message-Id: <8linft4bv6bbnsfc5c09t761kajtnnsrhr@4ax.com>

Craig Berry wrote:

>: Is it me (more probably) or perl?
>
>I'd actually blame this one more on perl.

Perl4 mosty likely would have printed a literal @ instead. Would you
prefer that to the warning -- er, error?

p.s. I would use

	do 'inc';

instead of that elaborate mechanism of first loading the file and then
evalling it.

-- 
	Bart.


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

Date: 11 May 2001 12:17:17 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: weird error on @array syntax
Message-Id: <9dgl8d$rlp$1@pegasus.csx.cam.ac.uk>

Craig Berry <cberry@cinenet.net> wrote:
>
>I understand this will be downgraded to a warning in some future version.

It's already happened:

perl5.6.0 -we 'print "abc@def\n"'
In string, @def now must be written as \@def at -e line 1, near "abc@def"
Execution of -e aborted due to compilation errors.

perl5.6.1 -we 'print "abc@def\n"'
Possible unintended interpolation of @def in string at -e line 1.
Name "main::def" used only once: possible typo at -e line 1.
abc


Mike Guy


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

Date: 11 May 2001 12:20:33 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: weird error on @array syntax
Message-Id: <9dgleh$s1a$1@pegasus.csx.cam.ac.uk>

Bart Lateur  <bart.lateur@skynet.be> wrote:
>
>p.s. I would use
>
>	do 'inc';
>
>instead of that elaborate mechanism of first loading the file and then
>evalling it.

C<do> is fine for one-liners and jiffy programs.   But as soon as you
check for errors (you always do that, don't you?  :-), it becomes
essential to dismantle the C<do> into its component parts to find out
what's going wrong.


Mike Guy


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

Date: Fri, 11 May 2001 12:27:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: weird error on @array syntax
Message-Id: <0jmnft4dd715c9ngc5h0jitv9najl10s1g@4ax.com>

M.J.T. Guy wrote:

>C<do> is fine for one-liners and jiffy programs.   But as soon as you
>check for errors (you always do that, don't you?  :-), it becomes
>essential to dismantle the C<do> into its component parts to find out
>what's going wrong.

	open OUT, ">test.inc" or die "Can't save test.inc file: $!";
	print OUT <<'END';
	print "A program with a bug in it"
	print "Heh!"
	END
	close OUT;
	do 'test.inc';
	die "Oops, an error: $@" if $@;
-->
	Oops, an error: syntax error at test.inc line 2, near "print"

What's your problem with this?

-- 
	Bart.


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

Date: 11 May 2001 12:43:37 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: weird error on @array syntax
Message-Id: <9dgmpp$1i$1@pegasus.csx.cam.ac.uk>

Bart Lateur  <bart.lateur@skynet.be> wrote:
>M.J.T. Guy wrote:
>
>>C<do> is fine for one-liners and jiffy programs.   But as soon as you
>>check for errors (you always do that, don't you?  :-), it becomes
>>essential to dismantle the C<do> into its component parts to find out
>>what's going wrong.
>
>	open OUT, ">test.inc" or die "Can't save test.inc file: $!";
>	print OUT <<'END';
>	print "A program with a bug in it"
>	print "Heh!"
>	END
>	close OUT;
>	do 'test.inc';
>	die "Oops, an error: $@" if $@;
>-->
>	Oops, an error: syntax error at test.inc line 2, near "print"
>
>What's your problem with this?

I didn't say do() doesn't detect *any* errors.   The problem is that it
doesn't detect *all* possible errors.    Suppose the file didn't exist, or
wasn't readable?


Mike Guy


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

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

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 V10 Issue 875
**************************************


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