[16317] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3729 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 11:05:40 2000

Date: Tue, 18 Jul 2000 08:05:29 -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: <963932729-v9-i3729@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 18 Jul 2000     Volume: 9 Number: 3729

Today's topics:
    Re: ARRAY PROBLEM vgm32@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! newsposter@cthulhu.demon.nl
    Re: bless loses inheritance? (Anno Siegel)
    Re: CGI.pl problem with checkbox (Keith Calvert Ivey)
        convert string to real data. <ecmorgan@lucent.com>
        file uploading with PerlScript/ASP <samara_biz@hotmail.com>
    Re: limits on GET (Keith Calvert Ivey)
    Re: NEW: AI::NeuralNetwork - idea, comments (Logan Shaw)
    Re: Newbie - How can I set up a secure directory that i (Clinton A. Pierce)
    Re: Newbie needs help! (Spike)
    Re: newbie: incrementing the value of a byte (M.J.T. Guy)
    Re: Out of Memory - more info (M.J.T. Guy)
    Re: perl -lpi.bak -e "s/old/new/g" *.* broken on NT? <ucesgka@ucl.ac.uk>
        Producing an executable for Perl program sanjay33@my-deja.com
        Running a CGI script <jaford@watford53.freeserve.co.uk>
        Semi-newbie Regex question. <jeffahill@lucent.com>
    Re: Semi-newbie Regex question. (Marcel Grunauer)
    Re: Semi-newbie Regex question. (Malcolm Ray)
        SSL programs <tambaah@xhotmailx.com>
    Re: Suggestion for syntax change <keithmur@mindspring.com>
    Re: Suggestion for syntax change <keithmur@mindspring.com>
    Re: warn not working after re-opening STDERR (M.J.T. Guy)
        why does this not work? <gte941n@prism.gatech.edu>
    Re: Yet another string manipulation question - (Keith Calvert Ivey)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 18 Jul 2000 14:50:37 GMT
From: vgm32@my-deja.com
Subject: Re: ARRAY PROBLEM
Message-Id: <8l1qrl$pfp$1@nnrp1.deja.com>

In article <39739485@ns1.access1.com.au>,
  "-EViL-DOC-" <-EViL-DOC-@BLUR.COM> wrote:
> Hi,
>
> I am reading 2 files into separate arrays
> @array1 contains many lines of the following format.
> $array1[0] contains
integer1,integer2,integer3,integer4,integer5,integer6
>
> @array2 contains many lines of the following format.
> $array2[0] contains integer1,integer2,integer3,integer4
>
> My question is how can i add the say third element from
> $array1[1] (EG. integer1,integer2,integer3,integer4)
>                                       ^^ This one
>
> to the 2nd element of $array1[3] (EG.
integer1,integer2,integer3,integer4
>
> ^^ This one
> Thanks in advance !
>
>

Assumption
    You want to add one integer from the list in item $array1[0] to one
integer from the list in $array2[0].

Solution
    Create yet an array of each list and handle the items separately,
namely:

@tmp1 = split(",", $array1[0]) ; #$array1[0] contains 5,6,7
@tmp2 = split(",", $array2[0]) ; #$array2[0] contains 8,9,4

$total = $tmp1[1] + $tmp2[2] ;   #$total = 6 + 4


Analysis
    This is the first solution that I thought of, there's got to be a
less costly way of doing this.


--Victor


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 18 Jul 2000 13:33:43 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8l1mbn$b2t$1@internal-news.uu.net>

Randal L. Schwartz <merlyn@stonehenge.com.bbs@openbazaar.net> wrote:

> I think you'll find that experts generally do pick up on the
> questioner having said "I've read X Y Z, and here's what I don't get
> about that".  First, that's pretty rare, and second, it would be even
> rarer to get a flat "RTFM" once that has happened. :)  I challenge
> you to pick out the 1% of the cases that are like that against the
> normal 99% of the cases.  Go ahead.  Deja.com is your friend. :)

  Yesterday, someone claimed to have read docs for system and relevant
portions of perlfaq8, yet still asks why system does not give her
the output of the command she's trying to run. Those two documents
explicitly say that if you want to capture output of an external
command, you should use backticks. Ofcourse, I'm not an expert
so this case does not apply ;)

Erik



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

Date: 18 Jul 2000 13:09:20 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: bless loses inheritance?
Message-Id: <8l1ku0$hbd$1@lublin.zrz.tu-berlin.de>

 <up2l8@my-deja.com> wrote in comp.lang.perl.misc:
>Hello,
>
>I am trying to reconsecrate an object into
>a new class (I'm trying to make a copy constructor...)
>but it seems that when I re-bless the object it loses
>all of the inheritance information.

An object doesn't have inheritance information, its class does.  So
re-blessing an object is *expected* to change inheritance, unless
the old and new class inherit exactly the same.

>                                     I found that when
>I call a simple function like so:
>
>sub ima {
>  return(@ISA);
>}

The @ISA this sub refers to is determined at the time ima is compiled.
Whichever package is default at the moment defines which @ISA will
be returned at run time.

>The inheritance info seems to be read correctly.
>
>ex.
>
>  bless $o, $to_class;
>  print "PASS\n" if ($o->isa("Netlist::Element"));
>  print "IMA- ".join("\n\t", $o->ima)."\n";
>  print "PASS, but weird!\n" if ($o->isa("Netlist::Element"));
>
>Oddly enough this always prints the weird string, even though
>I really didn't DO anything!

Why is this weird?  The if-condition is the same in the first and the
last print(), so they either both print, or both don't.

>Does anyone have any ideas on this???

Not really, except I get the feeling you are expecting a behavior that
isn't to be expected.

Anno


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

Date: Tue, 18 Jul 2000 14:08:59 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: CGI.pl problem with checkbox
Message-Id: <398063b0.50995221@news.newsguy.com>

tbalazs-this-must-go@netcomuk.co.uk (Tony Balazs) wrote:

>print p(checkbox(-name=>"ref",-value=>"Y",-checked=>0), " Ref: $a");
>#other stuff
>
>This is producing as HTML:
><P><INPUT TYPE="checkbox" NAME="ref" VALUE="Y">ref Ref: 100

As you would expect from the documentation (see
http://stein.cshl.org/WWW/CGI/#checkbox):

    The optional fourth parameter (-label assigns a user-visible
    label to the button. If not provided, the checkbox's name
    will be used.

What you want is

 print p( checkbox(
              -name    => "ref",
              -value   => "Y",
              -checked => 0,
              -label   => "Ref: $a"
          )
       );


-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: Tue, 18 Jul 2000 10:36:35 -0400
From: Edward C Morgan <ecmorgan@lucent.com>
Subject: convert string to real data.
Message-Id: <39746B73.7F59C737@lucent.com>

I have the following code:

%map=();
$fh=IO::File->new("> foo");
$map{$fh}=1;

The map now has a string "IO::File::GLOB(0x1234)"
How do I convert this string back into the object?

-- 
=========================================
 Edward C. Morgan
 Email:  ecmorgan@lucent.com
 Phone: (610) 712-3435

 Do not boast about tomorrow, For you     
 do not know what a day may bring forth. 
=========================================


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

Date: Tue, 18 Jul 2000 09:54:22 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: file uploading with PerlScript/ASP
Message-Id: <3974618E.42D3BE38@hotmail.com>

Hi,

I need to be able to upload a file from the user's computer to the
server.
When a user logs in into the web-site, he is presented with a web form
where he has to enter some information, such as name, e-mail, etc.. and
also specify the file that he wants to have uploaded to the server.
After he hits submit I need to upload the specified file. I'm using
PerlScript for ASP.

Could anyone give me any ideas how to do this, or point to some places
where I can find more information about this.

Thank you in advance!

Alex



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

Date: Tue, 18 Jul 2000 13:56:06 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: limits on GET
Message-Id: <397e617f.50433894@news.newsguy.com>

"Alan J. Flavell" <flavell@mail.cern.ch> wrote:

>then you _could_ use CGI.pm's "excapeHTML" method:

I'm expecially disturbed to see this from you, Alan.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: 18 Jul 2000 10:00:57 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <8l1rf9$pgb$1@provolone.cs.utexas.edu>

In article <39741A48.C0A9E4FC@la.znet.com>,
Kiralynne Schilitubi  <callgirl@la.znet.com> wrote:
>I will register an objection to use of "AI" within
>your module name. This suggests your module employs
>"Artificial Intelligence" which is, with current
>technology, regardless of programming language,
>quite impossible even at a primitive level.
>We are centuries away from any programming
>which can be labeled, Artificial Intelligence,
>with any degree of accuracy and truth.

Have you sent e-mail to the AAAI and the MIT AI lab informing them of
their error?  It seems like you'd want to set them straight first,
since they're higher profile groups so therefore they must be more
embarassing.  While you're at it, there are hundreds of other
university CS departments that need to be corrected as well.

I do agree that AI is a bit of a misnomer, but so are many other things
in computer science which are named by analogy.  Random number
generators usually don't really generate random numbers, Artificial
Intelligence is artificial but isn't truly intelligence, and on the
subject of perl, many things which are referred to as magic aren't
truly magic; instead, they employ heuristics.

I too would like people to chose names that truly make sense, but
people have been choosing names that don't make sense forever.  What
matters most with words and terminology is not whether they are the
ideal terms, but whether their intended meanings can be understood.  I
think the meaning of "AI::NeuralNetwork" is pretty plain to anyone who
knows anything about machine learning.

Having said all that, I'm just going to mention that "AI::NeuralNet" is
shorter and just as clear.  But either seems great to me.

  - Logan


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

Date: Tue, 18 Jul 2000 13:38:11 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Newbie - How can I set up a secure directory that is only accessib;le
Message-Id: <75Zc5.41865$fR2.385356@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <3bRHO6$UKJ@openbazaar.net>,
	lkenny@fisheries.org.bbs@openbazaar.net (Liam) writes:
> This may not be a definite perl question, it may be an html issue on
> the directory side.  I'm not sure.  If it isn't, I would appreciate
> any helpful direction you can point me in to resolve this issue.

This is normaly done through configuration on your webserver and 
has nothing to do with Perl.

Followups redirected to comp.infosystems.www.servers where this 
should be asked.


-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Tue, 18 Jul 2000 13:05:40 GMT
From: sp@spike.co.za (Spike)
Subject: Re: Newbie needs help!
Message-Id: <397454bc.25667972@news.is.co.za>

Hello people - there actually arent any square brackets in the text
file - look more closely at the original extract:
e.g.
www.perl.com    A perl site

 ... And (.*?) will return 4 results since it will match a space !
so this would be more correct:

while(<TEXTFILEHANDLE>) {
  if (/^(.+)\t(.+)$/) {
    $link = $1 ;
    $descr = $2 ;
    # now you can do what you like with $link and $descr ...
  }	
}

You would test it first so that lines not matching will be ignored
like blanks or comments ...

Spike.
www.spike.co.za


On Tue, 18 Jul 2000 01:09:04 GMT, kcivey@cpcug.org (Keith Calvert
Ivey) wrote:

>Jim Mauldin <mauldin@netstorm.net> wrote:
>>Keith Calvert Ivey wrote:
>
>>> Jim Mauldin <mauldin@netstorm.net> wrote:
>>>
>>> >($link, $descr) = /\[(.*?)]/g;
>>> >
>>> Yes, but then you'll get the brackets included in $link and
>>> $descr.
>>
>>Not so.  perldoc perlop, and try it on $_ = "[www.perl.org]\t[A Perl site]";
>>It only returns what's inside the ( ) after matching the whole expression.
>
>You've made me look more foolish I was by deleting the part my
>comment applies to, where you said the parentheses were
>unnecessary.  On looking back, I see that I misread your post,
>and you weren't referring to the capturing parentheses.
>
>-- 
>Keith C. Ivey <kcivey@cpcug.org>
>Washington, DC
>(Free at last from the forced spamsig of
>Newsfeeds.com, cursed be their name)



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

Date: 18 Jul 2000 13:56:03 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: newbie: incrementing the value of a byte
Message-Id: <8l1nlj$qdp$1@pegasus.csx.cam.ac.uk>

Makarand Kulkarni  <makarand_kulkarni@my-deja.com> wrote:
>> I am using read to read in a byte from a file, but if I can't work out how
>> to increment the value of the byte rather than the ascii representation of
>> it.
>
>use the "use bytes" pragma if you are using perl 5.6

This has no relevance to what the OP wants to do.

Use ord() and chr().

And please attribute your quotes.


Mike Guy


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

Date: 18 Jul 2000 14:49:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Out of Memory - more info
Message-Id: <8l1qou$t39$1@pegasus.csx.cam.ac.uk>

James McCallum <james.mccallum@bradford.gov.uk> wrote:
>On Mon, 17 Jul 2000 14:31:58 GMT, james.mccallum@bradford.gov.uk
>(James McCallum) wrote:
>
>This is what I've written
>
>#!/usr/gnu/bin/perl -w
>#
>open (C,"/list");
>while (<C>) {
>  print "$_";
>}
>
>And the result I get is 'out of memory'
>The input file /list has a size of 222960 bytes 

That means Perl failed to allocate a chunk of memory.   On most platforms,
that happens if you run out of swap space.

OTOH, that program should be *tiny*, and will only hold one line at a
time in memory.   And the file size is hardly challenging.

Are you using some old version of Perl?   It looks like you have some
sort of memory leak.


Mike Guy


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

Date: Tue, 18 Jul 2000 12:41:13 +0100
From: "George Karpodinis" <ucesgka@ucl.ac.uk>
Subject: Re: perl -lpi.bak -e "s/old/new/g" *.* broken on NT?
Message-Id: <8l1o06$m2u$1@uns-a.ucl.ac.uk>

If you run the following program:

  perl -e "print join ',' => @ARGV" *.*

you'll see that $ARGV[0] is the string "*.*".  To get around this, you
might want to consider doing:

  perl -pi.bak -e "BEGIN { @ARGV = map /[*?]/ ? glob($_) : $_, @ARGV }
  s/foo/bar/ig"

That will modify @ARGV at the beginning, changing any element with a * or
? in it into the corresponding list of files matching the glob.

Credit goes to Jeff "japhy" Pinyan(japhy@pobox.com) who answered the same
question for me.

George

<atramos_us@my-deja.com> wrote in message news:8kl8rh$r6$1@nnrp1.deja.com...
>
>
> My fovorite Perl one-liner (multi-file global search/replace)
> fails on NT with an "Invalid Argument" error.
>
> Is there something I need to reconfigure?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Tue, 18 Jul 2000 13:39:20 GMT
From: sanjay33@my-deja.com
Subject: Producing an executable for Perl program
Message-Id: <8l1mm6$lvu$1@nnrp1.deja.com>

Although I understand that Perl is an interpreted language, am I correct
in assuming that a Perl program is read into memory and converted into
some intermediate form before it is executed. If this is true, then it
should be possible to produce a executable file which runs the program.

Can anyone tell me how to produce this file?

thanks
sanjay


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 14:53:25 +0100
From: Jim Ford <jaford@watford53.freeserve.co.uk>
Subject: Running a CGI script
Message-Id: <39746155.90B5E7D7@watford53.freeserve.co.uk>

I thought I'd have a play with CGI on my Linux box. I've downloaded and
installed the CGI.pm, but am unable to run the example scripts with any
browser (Netscape, Lynx etc.). All that happens is that I get the source
script displayed. I think it may be a configuration problem with Apache,
but don't know enough about Apache to risk fiddling with the (huge)
config file. I'd also like to RTFM, but don't know what one I should
look for!

Any ideas - anyone, please.

Regards: Jim Ford



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

Date: Tue, 18 Jul 2000 09:09:19 -0500
From: Jeff H <jeffahill@lucent.com>
Subject: Semi-newbie Regex question.
Message-Id: <3974650F.83691241@lucent.com>

To start, I read the Regex page, and couldn't make heads nor tails of it as it
relates to my application.  

What I'm trying to do should be very simple, but I can't seem to make it work. 
I want to read in a scalar string, see if there is a semicolon in it, and cut
off everything from the semicolon, on.  

I have an internal webpage that calls a Unix Korn shell script, and found, to my
dismay, that any who wants to can run whatever command they darn well please
from my webmaster account.  (I got thrown into the job because I'm a good VB
programmer, and nobody else wanted it).  If anyone has any better suggestions as
to how to keep people from hacking that part of the page, I'd love to hear
them.  Thank you.

Jeff Hill
Lucent Technologies


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

Date: Tue, 18 Jul 2000 14:17:18 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Semi-newbie Regex question.
Message-Id: <slrn8n8nad.202.marcel@fizban.local>

On Tue, 18 Jul 2000 09:09:19 -0500, Jeff H <jeffahill@lucent.com> wrote:

> What I'm trying to do should be very simple, but I can't seem to make
> it work.  I want to read in a scalar string, see if there is a semicolon
> in it, and cut off everything from the semicolon, on.

    perl -pe's/;.*//' test.txt

Or just use that regex on your scalar.

> If anyone has any better suggestions as to how to keep people from
> hacking that part of the page, I'd love to hear them

'perldoc perlsec' is a start.

-- 
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();


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

Date: 18 Jul 2000 14:25:40 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Semi-newbie Regex question.
Message-Id: <slrn8n8q74.vbg.M.Ray@carlova.ulcc.ac.uk>

On Tue, 18 Jul 2000 09:09:19 -0500, Jeff H <jeffahill@lucent.com> wrote:
>To start, I read the Regex page, and couldn't make heads nor tails of it as it
>relates to my application.  
>
>What I'm trying to do should be very simple, but I can't seem to make it work. 
>I want to read in a scalar string, see if there is a semicolon in it, and cut
>off everything from the semicolon, on.  
>
>I have an internal webpage that calls a Unix Korn shell script, and found, to my
>dismay, that any who wants to can run whatever command they darn well please
>from my webmaster account.  (I got thrown into the job because I'm a good VB
>programmer, and nobody else wanted it).  If anyone has any better suggestions as
>to how to keep people from hacking that part of the page, I'd love to hear
>them.  Thank you.

If you haven't already read perlsec, I recommend you do so: it should help
you.  But I'd like to emphasise one thing up front: don't try to strip out
'bad' characters!  It's too easy to miss one (for example, in some shells
caret is an alternative pipe character - how many people remember that?).
It's better to decide what characters are safe and allow only those.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 18 Jul 2000 09:37:50 -0500
From: "Tambaa Hapa" <tambaah@xhotmailx.com>
Subject: SSL programs
Message-Id: <8l1q3v$cbd$1@tilde.csc.ti.com>

Anyone know of a site with good examples in perl for retrieving SSL pages
and submitting SSL forms?

TIA
huzefa




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

Date: Tue, 18 Jul 2000 08:53:45 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Suggestion for syntax change
Message-Id: <39746169.58AB054D@mindspring.com>

Bart Lateur wrote:
> 
> Jakob Schmidt wrote:
> 
> (about ".." inside @ary[0..-1])
> 
> >Your wish would require that the .. operator behaved in a different manner
> >when it finds itself used in array indexing than in other contexts. Isn't
> >that a bit... erm... ugly?
> 
> You mean, like context sensitive? Gee, there's a novel idea. No, in Perl
> there's absolutely nothing that is context sensitive.
> 
Thank you, Bart!  You are not MEAN.  Sorry.  (Ducks)


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

Date: Tue, 18 Jul 2000 09:04:44 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Suggestion for syntax change
Message-Id: <397463FC.CB4C5E58@mindspring.com>

Jakob Schmidt wrote:
> 
> Bart Lateur <bart.lateur@skynet.be> writes:
> 
> > Jakob Schmidt wrote:
> >
> > >Your wish would require that the .. operator behaved in a different manner
> > >when it finds itself used in array indexing than in other contexts. Isn't
> > >that a bit... erm... ugly?
> >
> > You mean, like context sensitive? Gee, there's a novel idea. No, in Perl
> > there's absolutely nothing that is context sensitive.
> 
> I deliberately didn't say that. I just asked if this specific example wouldn't
> be ugly.
> 
> Well, wouldn't it?
> 
It could get quite interesting, if it were context-sensitive, and could
also count down as well as up.

For instance:

@list = (apple boy cow dog);

@list[1..-1] would be qw(boy, cow, dog)

@list[1..-4] would be qw(boy apple)

I think I like it.  Remember, this would only obtain in list subscript
context.  Outside that context, '1..-1', for instance, doing '1, 0, -1'
would also be a nice addition.

This question should nicely separate devotees of language orthogonality
from *real* Perlers.  ;-)


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

Date: 18 Jul 2000 14:38:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: warn not working after re-opening STDERR
Message-Id: <8l1q4v$sau$1@pegasus.csx.cam.ac.uk>

In article <8l0ubn$4c9$1@nnrp1.deja.com>,  <scottbeck@my-deja.com> wrote:
>
>Sorry, but I forgot to mention this does work on windows but not unixish
>systems. I did try it on Win2k and WinNT and it does work.
>The warn does not happen on the linux systems I tried it on.
>RedHat 6.0, Mandrake 7.0, and Mandrake 7.1.

This is a bug in the stdio on some versions of Linux.
When a file descriptor is allocated, the standards specified that the
lowest available number should be used.   But Linux (or rather glibc)
breaks this rule.

Perl tends to get confused if STDERR has a fileno other than 2.
Your code *should* free fds 1 and 2, then reallocate STDOUT on fd 1
and STDERR on fd 2 (being the lowest numbers currently free), so all
should be happy.    But the Linux bug messes this up.

(Note that you are living dangerously here; if the operations had been
done in a different order ... ).

Perl5.6.0 is less fussy about where STDERR points to, so the problem
should go away if you upgrade.


Mike Guy


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

Date: 18 Jul 2000 14:55:40 GMT
From: Benjamin David Garrison <gte941n@prism.gatech.edu>
Subject: why does this not work?
Message-Id: <8l1r5c$n76$1@news-int.gatech.edu>

($current_month, $current_day, $current_year)=split(/-/, `date 
"+%m-%d-%Y"`);
$current_year=chomp $current_year;

-- 
Ben Garrison * ICQ#20300203 * IM ben628496 * www.ben.f2s.com
 "My God" - single log entry of the pilot of the Enola Gay on the day
 that the bomb was dropped on Hiroshima, Japan.


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

Date: Tue, 18 Jul 2000 13:51:52 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Yet another string manipulation question -
Message-Id: <397d6026.50089106@news.newsguy.com>

elephant@squirrelgroup.com (jason) wrote:

>  my %rules = ( a => 'be', c => 'd', e => 'kl' );
>  my $char = 'X';
>
>  for my $key (keys %rules)
>  {
>    $String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
>  }

Consider what happens if $String1 is 'aacd'.  The second 'a'
gets captured and ignored while the first 'a' is being
processed, and you get 'aXacd' instead of 'aXaXcd'.  Change the
substitution line to

    $String1 =~ s/$key(?=[^$rules{$key}])/$key$char/g;

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3729
**************************************


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