[9826] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3419 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 11 15:07:49 1998

Date: Tue, 11 Aug 98 12:01:33 -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           Tue, 11 Aug 1998     Volume: 8 Number: 3419

Today's topics:
    Re: IMPORTANT: Proper Netiquette <birgitt@hamburg.citde.net>
    Re: IMPORTANT: Proper Netiquette (Gary L. Burnore)
    Re: IMPORTANT: Proper Netiquette <flavell@mail.cern.ch>
    Re: Is there a maximum recommended file size for Perl S (brian d foy)
    Re: Need to Lock files (NFS) huntersean@hotmail.com
    Re: Need to Lock files (NFS) (Andre Merzky)
    Re: perl 5.005_01, Tk400.202 and AIX <cmihaly@fa.disney.com>
    Re: Perl, http and save greenej@my-dejanews.com
        Question: Retrieving values for HTML display (Mr. Mirthful)
    Re: Question: Retrieving values for HTML display <rootbeer@teleport.com>
    Re: re first language (Steve Linberg)
        reading formatted mainframe data in perl philippos@my-dejanews.com
    Re: reading formatted mainframe data in perl <rootbeer@teleport.com>
    Re: Regex problem <l.e.kolden@hfstud.uio.no>
    Re: Self-printing code (brian d foy)
        Test your Javascript and HTML knowledge <mike.russiello@tekmetrics.com>
    Re: Test your Javascript and HTML knowledge <rootbeer@teleport.com>
    Re: use strict problem with indirect file variables ? (Tom Grydeland)
    Re: Using variable in TR (Andre L.)
    Re: Using variable in TR (Andre L.)
    Re: variable indirection [off topic - parens] (Nem W Schlecht)
    Re: What is the purpose of Perl (Andre Merzky)
    Re: What is the purpose of Perl (Craig Berry)
    Re: What is the purpose of Perl (Craig Berry)
    Re: What is the purpose of Perl (Walker Aumann)
    Re: X-file (?=...), case postponed. (Patrick Timmins)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 11 Aug 1998 12:57:23 +0000
From: Birgitt Funk <birgitt@hamburg.citde.net>
Subject: Re: IMPORTANT: Proper Netiquette
Message-Id: <6qq1er$bm0$1@trader.ipf.de>

Tom Christiansen wrote:
> 
> Those who have never read this document, should.

Great, thanks, I even got a personal copy via email,
which makes me wonder which netiquette rules I failed
to follow - well, I guess I know.  :-)

Some short suggestion: As many documents, including
this one, were not listed in news.announce.newusers on my 
news server you might point to the URL

http://www.netannounce.org/news.announce.newusers/

may be in your Perl Mini FAQ or your "Welcome" email
to new clpm posters by Nathan Torkington.

Saves a lot of time to have everything together independent
from your news server's peculiarities.

Birgitt Funk


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

Date: Tue, 11 Aug 1998 18:21:59 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: IMPORTANT: Proper Netiquette
Message-Id: <35d18b49.93864921@nntpd.databasix.com>

On 11 Aug 1998 02:50:13 GMT, in article <6qobh5$nc7$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:

>Those who have never read this document, should.
>
>Date: Tue, 28 Jul 1998 08:00:09 GMT
>Supersedes: <Evz288.I0w@tac.nyc.ny.us>
>Expires: Fri, 28 Aug 1998 08:00:09 GMT
>Message-ID: <Ewsow9.KpG@tac.nyc.ny.us>
>>From: netannounce@deshaw.com (Mark Moraes)
>Subject: A Primer on How to Work With the Usenet Community
>Newsgroups: news.announce.newusers,news.answers
>Followup-To: news.newusers.questions
>Approved: netannounce@deshaw.com (Mark Moraes)
>Lines: 433
>Xref: csnews news.announce.newusers:3008 news.answers:137187
>
>Archive-name: usenet/primer/part1
>Original-author: chuq@apple.COM (Chuq Von Rospach)
>Comment: enhanced & edited until 5/93 by spaf@cs.purdue.edu (Gene Spafford)
>Last-change: 23 Sep 1996 by netannounce@deshaw.com (Mark Moraes)
>Changes-posted-to: news.misc,news.answers
>
>              A Primer on How to Work With the Usenet Community
>                             Chuq Von Rospach 


>From reading some of your posts in .moderated, looks like you didn't read it
before either.  As with anything written about USENet, some of it is valid and
current and some of it is not valid and outdated.

  
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Tue, 11 Aug 1998 20:41:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: IMPORTANT: Proper Netiquette
Message-Id: <Pine.HPP.3.95a.980811203918.14482T-100000@hpplus01.cern.ch>

On Tue, 11 Aug 1998, Gary L. Burnore wrote:

> From reading some of your posts in .moderated, looks like you didn't read it
> before either.  As with anything written about USENet, some of it is valid and
> current and some of it is not valid and outdated.

As with anything posted to usenet, some people are trying to do
something constructive, while others are only too happy to carp about
it.




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

Date: Tue, 11 Aug 1998 14:09:45 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Is there a maximum recommended file size for Perl Scripts
Message-Id: <comdog-ya02408000R1108981409450001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35CFCDAF.5AD4FE26@purco.qc.ca>, Leon Stepanian <info@purco.qc.ca> posted:

>Hi;
>
>Just a small question. My perl script is now 192K and includes lots of
>sub_routines,
>internal html prints, several file logging, updating and retreiving
>sub_routines, along with a access code tracing system to make sure all
>generated pages and actions are not activated via pages which were
>bookmarked.

perhaps you want to abstract everything into a module which is
Autosplit, then write tiny scripts to perform logically different
tasks.  each script only autoloads the functions it needs.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Conference Quiz Show <URL:http://tpj.com/tpj/quiz-show>


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

Date: Tue, 11 Aug 1998 16:57:50 GMT
From: huntersean@hotmail.com
Subject: Re: Need to Lock files (NFS)
Message-Id: <6qpt6e$kdv$1@nnrp1.dejanews.com>

In article <35D04830.FAE00EC1@betalasermike.com>,
  "Michael A. Jones" <jonesma@betalasermike.com> wrote:
> Have been trying to find a good way to lock a file that an other user
> might try to open while I'm processing it. The user is NFS mounted to
> server and I would like to "Lock" the file. I'm looking for any
> resources that might address such an attempt. I've tried the obvious
> (flock) and have been experimenting with fcntl. Any advice would be
> appreciated.
> Details: file in question is a "pkziped" file created by a user. My
> program watches for the creation of such files, waits until it's closed
> and then does stuff to it. I would like to prevent anyone from opening
> it during my (short) processing just in case. I think that means locking
> it.
>
>

IIRC you cannot reliably and portably flock a file over NFS.  This is a unix
problem, not perl's fault.  Perhaps creating and checking for the existence
of a named lock file would be suitable for your app.  This is not atomic,
however, so it does open a potential race window.

Sean Hunter.

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


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

Date: 11 Aug 1998 18:46:26 GMT
From: am@am.westblaak.spirit.nl (Andre Merzky)
Subject: Re: Need to Lock files (NFS)
Message-Id: <6qq3i2$n18$1@newnews.nl.uu.net>

In article <6qpt6e$kdv$1@nnrp1.dejanews.com>, huntersean@hotmail.com writes:
> In article <35D04830.FAE00EC1@betalasermike.com>,
>   "Michael A. Jones" <jonesma@betalasermike.com> wrote:
> > Have been trying to find a good way to lock a file that an other user
> > might try to open while I'm processing it. The user is NFS mounted to
> > server and I would like to "Lock" the file. I'm looking for any
> > resources that might address such an attempt. I've tried the obvious
> > (flock) and have been experimenting with fcntl. Any advice would be
> > appreciated.
 
> IIRC you cannot reliably and portably flock a file over NFS.  This is a unix
> problem, not perl's fault.  Perhaps creating and checking for the existence
> of a named lock file would be suitable for your app.  This is not atomic,
> however, so it does open a potential race window.

You can make it atomic.. - I had this problem recently..:-)

 - filename = test.dbm
 - look if any file exists with name: 'test.dbm.lock.(\d+)'
 - if yes, wait, try again etc.
 - if not: creat one: 'test.dbm.lock.<ipnum(localhost).pid>
  not atomic til now...
 - check if only YOUR file exists! :-)
 - if not: remove your's, wait random time, start from very beginning
 - if yes: work

Problems:  - if working program segfaults or exits abnormally, dbm file could
             remain locked...
           - slow...

But it worked fine for me...

HtH, Andre.




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

Date: Tue, 11 Aug 1998 10:22:00 -0700
From: Chris Mihaly <cmihaly@fa.disney.com>
To: Ron Reidy <rereidy@uswest.net>
Subject: Re: perl 5.005_01, Tk400.202 and AIX
Message-Id: <35D07DB8.4B26F17C@fa.disney.com>

Well, I was able to build it but had to do a bunch of strange stuff. 
Appears, that MakeMaker just segements faults after processing so many
subpackages.  So, I moved the directories from Pod down up a directory
so perl wouldn't see them, then ran perl Makefile.PL and it ran
through.  Then I swapped the directories, put back the ones I moved up
and moved the ones up to Pod up a directory and ran perl Makefile.PL. 
Unfortunately, the Makefile in pTk gets messed up because the dates are
out of sync, so I had to comment out the .NO_CONFIG_REC so that it would
build properly.  Then everything else worked fine.  It doesn't matter
what subpackages there are, it just the number, after processing so many
it core dumps.  

	My guess is that at some point it writes over memory that is being used
by something else.  We have a very similar problem under IRIX, although
it only appears when parsing scripts, it just randomly core dumps.
Setting an environment variable (any variable) generally fixes it since
that will move memory around.  This didn't effect the above problem
though.

	Chris

	
Ron Reidy wrote:

 I also have had trouble biulding p/Tk.  Could you please let me know
how you
 resolve it?
 
 TIA
 
 rr

-- 
Christopher Mihaly 		Email: cmihaly@fa.disney.com   
Walt Disney Feature Animation   Phone: (818) 526-3231 
500 S. Buena Vista St. 		Fax:   (818) 560-9388
Burbank, CA 91521-4806


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

Date: Tue, 11 Aug 1998 16:30:25 GMT
From: greenej@my-dejanews.com
Subject: Re: Perl, http and save
Message-Id: <6qprj2$hqr$1@nnrp1.dejanews.com>

In article <35CEE838.AEB02A31@mannheim-netz.de>,
  lars <lars.schonert@mannheim-netz.de> wrote:
> Hello,
> [-snip-]
> Thankzg
>

perldoc LWP::Simple

The man page contains an example that should get you started.
Viel Gluck!
mfG,
J. Greene
Informatics Consulting
D-79539 Loerrach

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


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

Date: Tue, 11 Aug 1998 17:02:12 GMT
From: NOjcjSPAM@mail.med.upenn.edu (Mr. Mirthful)
Subject: Question: Retrieving values for HTML display
Message-Id: <35d0783e.99756952@uphs1>

I want to add some questionnaires to a site. 
1. each page would have a simple question
2. I want to keep a global tally in a single text file
3. i want to display the percentage on each page

For instance,
"Your mother says you can't go out after 10; she's gone. Would you
return before 10?
Buttons: YES or NO
"23% of people answered YES"

Can anyone give me a push in the right direction with this? The part i
need help with is how to transfer the values of the yes/no buttons
into variables in the Perl script and store them, then retrieve them
for display on the HTML page. 

-Jerrold



--remove NOSPAM to reply

--
My Father Always Believed That   | I want        | The Acquisition
Laughter Was The Best Medicine,  |    to         |   of Information
I Guess That's Why Several Of     |   believe.    | is an Advantageous
Us Died Of Tuberculosis! :^)       |   - X-Files   |   Expedition.

http://mail.med.upenn.edu/~jcj


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

Date: Tue, 11 Aug 1998 17:42:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Question: Retrieving values for HTML display
Message-Id: <Pine.GSO.4.02.9808111039550.10161-100000@user2.teleport.com>

On Tue, 11 Aug 1998, Mr. Mirthful wrote:

> Newsgroups: comp.lang.perl.tk, comp.lang.perl.misc

Why crosspost to c.l.p.tk? Followups set.

> The part i need help with is how to transfer the values of the yes/no
> buttons into variables in the Perl script and store them, then
> retrieve them for display on the HTML page.

Use a module, like CGI.pm. 

> --remove NOSPAM to reply

--remove NOSPAM if you want replies. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 11 Aug 1998 14:25:13 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: re first language
Message-Id: <linberg-1108981425130001@projdirc.literacy.upenn.edu>

In article <01bdc1f7$ad850220$47eb1bcc@XSTA71.pcr.com>, "Matt Heusser"
<matt@pcr7.pcr.com> wrote:

> Forget that.  When I was in college, I took a course
> in VAX assembler, and we had to take our assembler
> code and turn it into Hex or Octal.  REAL programmers
> code in Octal.    ;-)  <Sarcasm clearly implied>

REAL Real Programmers punch their own cards.  :)
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Tue, 11 Aug 1998 15:56:13 GMT
From: philippos@my-dejanews.com
Subject: reading formatted mainframe data in perl
Message-Id: <6qppit$et9$1@nnrp1.dejanews.com>

we are faced with the daunting task of having to unpack, reformat, and
otherwise convert various types of mainframe data (e.g. cobol formats, EBCDIC
fields, etc.) from a variety of sources.  The particular problem right now is
determining the format of a COBOL file without any layout information, and
with reflexive fields in the format.

however, ANYTHING in the line of Mainframe->microcomputer (PC) conversions
using perl would be greatly appreciated.

Please forgive me if my terminology is incorrect, as i am not of the mainframe
world.

thanks,

philip

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


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

Date: Tue, 11 Aug 1998 16:42:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: reading formatted mainframe data in perl
Message-Id: <Pine.GSO.4.02.9808110940410.10161-100000@user2.teleport.com>

On Tue, 11 Aug 1998 philippos@my-dejanews.com wrote:

> we are faced with the daunting task of having to unpack, reformat, and
> otherwise convert various types of mainframe data (e.g. cobol formats,
> EBCDIC fields, etc.) from a variety of sources.  The particular
> problem right now is determining the format of a COBOL file without
> any layout information, and with reflexive fields in the format.

Maybe the docs, FAQs, and newsgroups about COBOL could be of help to you
here. Once you know the format, it's generally easy to convert it with
Perl. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 11 Aug 1998 19:33:20 +0200
From: Lars Erik Kolden <l.e.kolden@hfstud.uio.no>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regex problem
Message-Id: <35D08060.F05E320@hfstud.uio.no>

Hello again. I've been happy for a couple of hours not, until my mood
dropped down several feet. I discovered a very critical error in my
script: it will only work if I'm trying to delete the first row of the
table (the first <tr>-</tr> pair; since the .*? after the <tr> will
match anything before $linktext, it will replace a lot more than what it
should if the table row I want to delete isn't the first one. Therefore
I wrote a new regex, but it seems like that isn't going to do it either.
It just doesn't want to match, and I'm back to where I started. Could
you take a quick glance on the regex? I've backslashed a lot of it, but
that wouldn't be a problem, would it?


open(BODY, "+<$body_file") || &error(bad_read);
{ local $/; $file = <BODY> }

$file =~ s!

<tr>\s* 
<td width=\"43\%\" align=\"left\" valign=\"top\"><a
href=\"$region\/$date.*?\.html\">$linktext<\/a><\/td> \s*  
<td width=\"33\%\" align=\"center\" valign=\"top\">$date<\/td> \s*
<td width=\"24\%\" align=\"center\" valign=\"top\">$region<\/td> \s*
<\/tr>


Note: $region\/$date.*?\.html is there to match the URL. The script that
generates these pages detects if there are pages of the same date in the
directory. If so, it names the new file dd-mm-yy_1.html and so on. (So
the .*? should match nothing or an underscore and a number).

Greetings from a very stressed/nervous Lars Erik (my boss is getting on
my nerves)


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

Date: Tue, 11 Aug 1998 14:06:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Self-printing code
Message-Id: <comdog-ya02408000R1108981406280001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6qp8bo$o6e$1@nnrp1.dejanews.com>, Robin Houston <robin.houston@guardian.co.uk> posted:

>>Robin Houston <robin.houston@guardian.co.uk> posted:
>> >Oh, but that's cheating :-)
>> >It reads its own source

>print`cat $0`

but this one reads in its source!

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Conference Quiz Show <URL:http://tpj.com/tpj/quiz-show>


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

Date: Tue, 11 Aug 1998 13:51:50 -0400
From: Mike Russiello <mike.russiello@tekmetrics.com>
Subject: Test your Javascript and HTML knowledge
Message-Id: <35D084B6.4B26@tekmetrics.com>

We have developed separate HTML and JAVASCRIPT tests that will SOMEDAY
be used to screen job applicants and help employees get rewarded for
learning (perl is coming soon).  Right now the tests are in beta and we
need people to "test the test".  If you take the test your information
WILL NOT BE SHARED WITH ANYONE, though you will see how well you know
the material.  

Just go to www.123apply.com and enter a pin of 'Beta html' or 'Beta
JS'.  The system will give you a 12 question test three times (different
questions each time) to see how consistent the scores are.  You can also
comment on each question so we can identify problems.

At completion, you will see scores between 1-5 (5 is highest).  We will
also post a top ten list at 123apply.com.  Other than the top ten list,
your info WILL NOT BE SHARED WITH ANYONE and YOU WILL NOT HEAR FROM US.

Thanks for helping us out.

Mike Russiello
TekMetrics, Inc.


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

Date: Tue, 11 Aug 1998 17:50:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Test your Javascript and HTML knowledge
Message-Id: <Pine.GSO.4.02.9808111049080.10161-100000@user2.teleport.com>

On Tue, 11 Aug 1998, Mike Russiello wrote:

> Newsgroups: comp.lang.perl.misc
> Subject: Test your Javascript and HTML knowledge

This wasn't appropriate for a Perl newsgroup the first time you posted it
today, albeit under a different Subject line. But, even if it were
on-topic, that's no reason to post it twice!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 11 Aug 1998 17:13:08 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: use strict problem with indirect file variables ?
Message-Id: <slrn6t0ut4.gvd.Tom.Grydeland@mitra.phys.uit.no>

On Tue, 11 Aug 1998 06:00:49 GMT,
Phil Taylor <phil@ackltd.demon.co.uk> wrote:

> Well, thanks for knocking the nail in. My Perl book "teach yourself
> Perl 5 in 21 days" from SAMS gives an example of passing file handles
> into procedures using the method I posted, so that's why I did it that
> way. Obviously know I know better and can do it with one of those
> funny snowflake characters.
> 
> Apologies for making you Grrrrr, your help is appreciated. I'm not
> sure where I'm going wrong, the book says I would have tought myself
> Perl by now. I'm well over the 21 days.

That book is where you go wrong.

If you want to know why, take a look at
<URL:http://xenu.phys.uit.no/~tom/TYP21D.html>

The better book is the online docs.

> Phil

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Tue, 11 Aug 1998 13:17:53 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Using variable in TR
Message-Id: <alecler-1108981317530001@dialup-743.hip.cam.org>

In article <6qodt2$ii13@hkpa05.polyu.edu.hk>, cselton@hkp.hk (cs - Elton
Kong) wrote:

> Hi!
> 
> I want to use a variable's value in the tr operator. Below is my
> test code:
> 
> $m = 'abc';
> $n = 'xyz';
> $o = 'a1b2c3';
> $o =~ tr/$m/$n/;
> print $o, "\n";
> 
> What I would like to do is to store the source characters and
> replacement characters in 2 variables, and then do the translation
> using these 2 variables. However the above code doesn't work.
> Could anyone help?

[An erroneous version of this message may have already been sent. Here is
the real one.]

As mentioned in perlop, use an eval().

   eval '$o =~ '."tr/$m/$n/";
   die $@ if $@;

   print "$o\n";

Andre


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

Date: Tue, 11 Aug 1998 13:16:51 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Using variable in TR
Message-Id: <alecler-1108981316510001@dialup-743.hip.cam.org>

In article <6qodt2$ii13@hkpa05.polyu.edu.hk>, cselton@hkp.hk (cs - Elton
Kong) wrote:

> Hi!
> 
> I want to use a variable's value in the tr operator. Below is my
> test code:
> 
> $m = 'abc';
> $n = 'xyz';
> $o = 'a1b2c3';
> $o =~ tr/$m/$n/;
> print $o, "\n";
> 
> What I would like to do is to store the source characters and
> replacement characters in 2 variables, and then do the translation
> using these 2 variables. However the above code doesn't work.
> Could anyone help?


As mentioned in perlop, use an eval().

   eval '$o =~ '."tr/$m/$n/";
   die $@ if $@;

   print "$_\n";

Andre


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

Date: 11 Aug 1998 12:59:20 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: variable indirection [off topic - parens]
Message-Id: <6qq0po$55q@abattoir.cc.ndsu.nodak.edu>

[courtesy copy e-mailed to author(s)]

In comp.lang.perl.misc, Jonathan Feinberg  <jdf@pobox.com> wrote:
>nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht) writes:
>
>> When calling my(), a *function*, I think you should put your
>> arguments in parens, just like you have to when you call your own
>> function that you've written or like you always have to when you
>> program in C.
>
>Using parens with my() creates a list assignment, and is therefore
>semantically different from my() without parens.
>
>   my @a = qw( a b c );
>   my ($x) = @a;
>   my  $y  = @a;
>   print "\$x is $x\n\$y is $y\n";

Yes.  This was discussed earlier in the thread.

-- 
Nem W Schlecht                  nem@plains.nodak.edu
NDUS UNIX SysAdmin        http://www.nodak.edu/~nem/
"Perl did the magic.  I just waved the wand."


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

Date: 11 Aug 1998 16:23:15 GMT
From: am@am.westblaak.spirit.nl (Andre Merzky)
Subject: Re: What is the purpose of Perl
Message-Id: <6qpr5j$317$1@newnews.nl.uu.net>

In article <35D05E8D.61C5@min.net>, John Porter <jdporter@min.net> writes:
> I R A Aggie wrote:
> > 
> > (Tom Christiansen) wrote:
> > + Goodness, wouldn't it be easier to just fork?  No data copying. :-)
> > 
> > Forgive my presumption here, I only have a vague notion of what forking
> > does, but wouldn't this give you _parallel_ universes?
> > I don't think the data space is shared...
> 
> Well, if "code space" is fundamental physical laws, and "data space"
> is the matter/energy contents in toto, then I don't think you 
> necessarily want sharing of the data space.  That would be very
> weird indeed.

Hmm, this gives me weird ideas...

Imagine a universe of, say, 16 Bit. Sharing this 16 Bit Data Space not necessarily
means troubles in causality in the single universes (universES??? hmmm...), as long 
as a universes access only a part of the stuff, say 4 bit each, _directly_.
If there is a overlap in memory access, this easily can be interpreted as Wormhole.
If the overlap is randomly, the wormholes are instable. This is fully compatible
with my programming experiences... ;-)

On the other hand, accesing the 4 Bit available with a, say, 4 Bit Universal Bus, 
a certain unpredictability of results can occure if this is done by more than
one processes at the same time-quantum (known as clocktick). This was first described
by Heisenberg, who concluded (In words of a friend of mine): 'How shall I know what
I think before I hear what I have to say?'. 

Upgrading your Universe hardware, btw, will just show effect in enroling some additional
new dimensions. I really wonder how some physicists can honestly come to the conclusion
that there are 11 (!) dimensions... - obviously, there are (2^n + 1), whereby the
additional one comes from the clocktick. So upgrading an 9 Bit universo to a 
17 Bit one will show interesting effects, especially if you consider the increasing
number of wormholes...

A final questin remains: Is the universe opened or closed? Thus: will there be a
reboot? Poor creatures captured in Microver$es...

Andre (going to have examination in particle physics next... - I should quit...)



PS.: please excuse my bad english...





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

Date: 11 Aug 1998 16:30:53 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What is the purpose of Perl
Message-Id: <6qprjt$ic6$2@marina.cinenet.net>

Miguel Cruz (mnc@diana.law.yale.edu) wrote:
: Randal Schwartz  <merlyn@stonehenge.com> wrote:
: >Of course, it can only hold on to scalars, arrays, and hashes, but
: >that's gonna be about as good as you can get.
: 
: Is there really anything else in the universe?

I just had the weird image of the immediately post-big-bang Perlverse
consisting of undifferentiated typeglobs, then as the energy density
falls, there's a symmetry break into scalars and composites, then as it
falls still further, composites subdivide into hashes and lists.

Now, where does that leave the weird case of file handles?  Perhaps in an
analogous position to gravitation, resisting all attempts at unification
with the other three fundamental forces...er, data types. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 11 Aug 1998 16:58:06 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What is the purpose of Perl
Message-Id: <6qpt6u$ic6$4@marina.cinenet.net>

Andre Merzky (am@am.westblaak.spirit.nl) wrote:
: A final questin remains: Is the universe open or closed?

Not only is it open, it's also free-in-the-Gnu-sense. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 11 Aug 1998 18:54:06 GMT
From: walkera@ofb.net (Walker Aumann)
Subject: Re: What is the purpose of Perl
Message-Id: <slrn6t14qn.q78.walkera@ofb.net>

On Mon, 10 Aug 1998 09:35:23 -0500, I R A Aggie wrote:
> In article <6qlj11$aok$1@news.ycc.yale.edu>, mnc@diana.law.yale.edu
> (Miguel Cruz) wrote:
> + It has mapped the universe and created an exact duplicate.
> %universe_2 = %universe;
> James - from empirical evidence, I'd say the universe is a hash... ;)

Come on, there's no excuse for providing answers like this when complete
explanations are already available on every system with a properly
installed perl distribution.

% perldoc perlfaq42
 ...
        How do I create an exact duplicate of the universe?
 ...

Walker


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

Date: Tue, 11 Aug 1998 16:28:28 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <6qprfb$hoj$1@nnrp1.dejanews.com>

In article <1ddkbbw.1wh2xca1tzn3wgN@bay1-160.quincy.ziplink.net>,
  rjk@coos.dartmouth.edu (Ronald J Kimball) wrote:
[snip]
> Because split(//) never matches before the first character in the
> string.  It only matches *between* actual characters.  Because the 'J'
> is *before* the match position, it can't be matched by (?=(.*)).

So the split// ( albeit, in the guise of split/(?=(.*))/ ) takes
precedence over the '(.*)'. Perl sees the (?= .. ) and nothing else
between the '/../' in split and says "OK, I'm splitting on null". It
then begins, by throwing out the 'J', then the '(.*)' gets implemented
*for the first time*, and works with whatever is left, which then gets
thrown into the array as well, because it matched parenthetically.
Back to 'split on null', which throws out 'u', then to '(.*)' again,
etc, etc.

Do I finally get it?? So it took about 10 to 12 hours of my own
study / testing time, plus the work and assistance of numerous people
around the world for me to figure out just one 2-line sig from Abigail?

Thanks to all for your assistance and perseverance in pounding
all this into my head (particularly Daniel Grisinger,
dgris@perrin.dimensional.com, who gave me several hundred lines worth
of explanation and examples on zero-width positive lookahead assertions
and 'split' interactions).

Again, just one final question. Is all this documented some place, or
at least implied by the existing documentation, or is it just a
phenomenon that you all have come to understand intuitively? I believe
I see it now, but it was in no way, shape, or form an intuitive matter
for me. :(

Thanks again,

Patick Timmins
U. Nebraska Medical Center

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


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

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

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