[13247] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 657 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 26 21:07:25 1999

Date: Thu, 26 Aug 1999 18:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Aug 1999     Volume: 9 Number: 657

Today's topics:
    Re: Date/time problems (Martien Verbruggen)
    Re: DBM question (should be easy) <haj@oook.m.uunet.de>
        formmail and timestamp modification <rabrody@earthlink.net>
    Re: formmail and timestamp modification <cassell@mail.cor.epa.gov>
    Re: GIFgraph output to web page <ilya@speakeasy.org>
    Re: GIFgraph output to web page <ilya@speakeasy.org>
        help -  why  do I get ";" ? <geoff@brainstorm.net.au>
    Re: Jenda's gender [was: newbi: Registry Help under NT] (elephant)
    Re: Jenda's gender [was: newbi: Registry Help under NT] (elephant)
    Re: Locate a substring?! <cassell@mail.cor.epa.gov>
    Re: mirror.pl on OS/2 Question <huffd@nls.net>
    Re: mirror.pl on OS/2 Question (Abigail)
        OT Browser Height & Width tags (was Re: Images) <scottl@wybron.com>
    Re: Perl a Black Sheep? whos_john_galt@my-deja.com
        Perl Y2K Bugs on the Internet finsol@ts.co.nz
    Re: Perl Y2K Bugs on the Internet <cassell@mail.cor.epa.gov>
    Re: Perl Y2K Bugs on the Internet <laurensmith@sprynet.com>
        Perl.exe has an interpreted mode? <->
    Re: Perl.exe has an interpreted mode? <revjack@radix.net>
    Re: Perl.exe has an interpreted mode? (Abigail)
        problem with cgi script <davers@agora-net.com>
    Re: Regexp bug or what? <thierry.metoudi@francemel.com>
    Re: Regexp bug or what? (Larry Rosler)
    Re: semaphore manipulation <otis@my-deja.com>
    Re: Spawn a Web process <good@drinking.eng.sun.com>
    Re: Spawn a Web process (Abigail)
    Re: Visibility of inlined subs <john.wood@diamond.co.uk>
    Re: Why use Python when we've got Perl? (Phil Hunt)
    Re: Why use Python when we've got Perl? (William Tanksley)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 26 Aug 1999 23:01:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Date/time problems
Message-Id: <0Hjx3.198$bJ4.3556@nsw.nnrp.telstra.net>

In article <37C5A9EF.99AA8B59@news.news>,
	news <news@news.news> writes:
> Martien Verbruggen wrote:
>> Is this maybe perl 4?
>>
>> If so, you probably should get yourself a perl5 installation.
>>
> 
> If this was Perl 4, is there an alterative to localtime and gmtime?Thanks,

You can find out with 

# perl -v

Localtime and gmtime do exist in perl 4, but they just behave
differently, I believe. I can't actually remember that well, since
it's been a long time. The perl4 man page makes no mention of
localtime in a scalar context, just array context (which doesn't mean
it wouldn't do something).

You could try something like:

$time = `date`;

if you're on Unix. Or you could format your own date string based on
the array that localtime returns.

But I seriously would install a perl 5 if you are indeed using perl 4.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: Fri, 27 Aug 1999 01:23:43 +0200
From: Harald Joerg <haj@oook.m.uunet.de>
To: Matt Baker <matt@betcha.net>
Subject: Re: DBM question (should be easy)
Message-Id: <37C5CC7F.B5DC2C10@oook.m.uunet.de>

[mailed and posted, f'up to comp.lang.perl.modules]

Matt Baker wrote:
> 
> [...]
> use Fcntl;
> use SDBM_File;
> tie %hash, "SDBM_File", 'data',O_RDWR|O_CREAT|O_EXCL,0644;
> $hash{drink}='root beer';
> untie %hash;
> 
> When I run this code it creates two files:  data.dir and data.pag  .
> The problem is that although it creates the database files, it fails to put
> any data in either of them.  They are 0kb in length.
> What do I need to do to make this work?

SDBM_File is *broken* on Win9x, and on FAT filesystems in Win NT.
This fact had been documented in the Release Notes of ActivePerl
Build 309, but got lost later.

Changing SDBM_File to DB_File was all I needed to do to make your
example work.

OTOH SDBM_File works well with the cygwin port on Win95, so there
is more than one way to do it.
-- 
Oook,
--haj--


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

Date: Thu, 26 Aug 1999 15:06:30 -0700
From: "Robert Brody" <rabrody@earthlink.net>
Subject: formmail and timestamp modification
Message-Id: <7q4cod$gps$1@birch.prod.itd.earthlink.net>

Hi.  I'm using Matt Wright's formmail.pl and it presents a default screen
upon submitting the form that lists what you have entered/submitted in the
fields you've created.  It begins with a thank you for filling out this form
and says here's what you've submitted to (addressee) on (date/time).
However, the date/time reflects the server's date/time.  Being that the
hosting server I use is in another time zone, the time does not reflect
local time.  Is there a modification I could make to the script to offset
the time by a given value (in this case, -2)?

I realize that this time would then be inaccurate for people in other time
zones as well.  But I would prefer it to state my local time.  Any
suggestions?  Thanks.

Bob





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

Date: Thu, 26 Aug 1999 17:18:08 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: formmail and timestamp modification
Message-Id: <37C5D940.439411F0@mail.cor.epa.gov>

Robert Brody wrote:
> 
> Hi.  I'm using Matt Wright's formmail.pl and it presents a default screen

Mistake # 1

> upon submitting the form that lists what you have entered/submitted in the
> fields you've created.  It begins with a thank you for filling out this form
> and says here's what you've submitted to (addressee) on (date/time).
> However, the date/time reflects the server's date/time.  Being that the
> hosting server I use is in another time zone, the time does not reflect
> local time.  Is there a modification I could make to the script to offset
> the time by a given value (in this case, -2)?

Yes.  But you'll have to patch the code yourself, since everyone here
avoids touching Matt Wright's programs for fear of infection.

There must be some code in there which gets the current time, probably
using localtime() .  But whether Matt gets the code right, or even
makes it Y2K-compliant, I can't tell you.

But when localtime(time) gets the current time, 
localtime(time - 2 * 60 * 60) gets the current time minus 2 hours.
This will be off whenever you and your server differ on things like
Daylight Savings Time.  And issues of scalar vs list context matter
for localtime, as you can see by looking it up in the perlfunc
manpage.
 
> I realize that this time would then be inaccurate for people in other time
> zones as well.  But I would prefer it to state my local time.  Any
> suggestions?  Thanks.

Change the print() to specify that it is your local time.

You might also want to look at Jeff Pinyan's CRAP project, which
is geared toward revealing flaws in such programs, and then
ultimately providing alternatives.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 27 Aug 1999 00:14:11 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: GIFgraph output to web page
Message-Id: <rsbm2je7j7111@corp.supernews.com>

Kevin Marlowe <k.l.marlowe@larc.nasa.gov> wrote:
> I'm trying to use GIFgraph to output directly to a web page (instead of a
> file) as a cgi, but keep getting a server error when executing the code. I'm
> trying to use the "plot" function in one of the sample plots, just replacing
> the "plot_to_gif" function that's in all of the samples. Image file header
> problem? Anyway, I think I can figure this out with a clue or two; does
> anyone have an example of a working GIFgraph cgi that writes directly to
> STDOUT that I could look at?


This is the code that does it. @data is an array of arrays.
The lines that are commented out create a .gif file in your directory.
You need to have these headers:

use GD;
use GIFgraph::lines;        # to draw the graph

 $somegraph = new GIFgraph::lines(960, 720);



sub compute_graph

 {

   @data = (
             [@new_array_time],
             [@new_array_cpu_usr]
           );

 }

 #####################################################################

 sub display_graph

 {

   $somegraph->set(
                    title        => "Machine: $machine - $month_begin/$day_begin/$year_begin",
                    x_label      => 'time',
                    y_label      => 'cpu',
                    y_max_value  => 100,
                    y_tick_value => 1,
                    x_tick_value => 2,
                    x_label_skip => $frequency
                  );

#  $somegraph->plot_to_gif
#    ("$output_dir/$machine.$year_begin.$month_begin.$day_begin.gif", \@data );
   print STDOUT $input_string->header(-type => 'image/gif');
   binmode STDOUT;
   print STDOUT $somegraph->plot (\@data);

 }

 ################################################################





==============================================================================
Though we have many valleys to travel and mountains to climb, by nature we are
inclined to fear the unknown. Life rewards  those of us who accept the call to
go where we have never been even when we, seemingly, have to go there alone.
==============================================================================


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

Date: Fri, 27 Aug 1999 00:15:58 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: GIFgraph output to web page
Message-Id: <rsbm5uldj7142@corp.supernews.com>

Kevin Marlowe <k.l.marlowe@larc.nasa.gov> wrote:
> Tom -
> Thanks for the refs. I spent a good part of Saturday reading these and
> anything else I could find, as well as trying some different things with the
> scripts, to no avail. I think my confusion is a perl issue, not cgi, so I'll
> keep it here rather than in cgi.authoring.misc. My GIFgraph script writes to

OH, and a good book on this is:

_Programming Web Graphics With Perl & GNU software_



==============================================================================
Though we have many valleys to travel and mountains to climb, by nature we are
inclined to fear the unknown. Life rewards  those of us who accept the call to
go where we have never been even when we, seemingly, have to go there alone.
==============================================================================


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

Date: Fri, 27 Aug 1999 10:13:03 +0000
From: "Geoffrey Toogood" <geoff@brainstorm.net.au>
Subject: help -  why  do I get ";" ?
Message-Id: <37c5d77c@grissom>

Using CGI::Cookie;

When I get data from a cookie and make a string from the hash ref. I then
break string up using "split" ...

###########
ie.

$string = ($cookie{'nameofcookie'}); #foo=bar&baz path=/cgi-bin/

@a = split (/ /, $string);
$x = @a[0];
@b = split (/=/, $x);
$y = @b[1];
@c = split (/&/, $y);

$value1 = @c[0]; # bar
$value2 = @c[1]; # baz;


###########

I always get a ";" with the second value.  I end up having to chop $value2
to get the true value.  Is this normal ? why does it do this ? is it my code
? will it do this on all servers or just mine? can someone suggest a quicker
more efficient way to do this using CGI::Cookie ?

Cheers 
Geoff 


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

Date: Fri, 27 Aug 1999 11:00:10 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Jenda's gender [was: newbi: Registry Help under NT]
Message-Id: <MPG.12308e28a30a32f7989c88@news-server>

David Cassell writes ..
>elephant wrote:
>[snip of my garbage]
>
>> only problem is that I'm not American .. neither am I female (another
>
>It was *you*?  Sorry.  I know you're not 'Murrkun.  After all,
>your header info says your org is 
>    'Telstra Big Pond Cable - Sydney Site 1'
>and even we know where Sydney is.  

ooh .. that's so nice of my ISP - to fill in a blank Organization header 
with it's own information .. I'd never noticed .. should be all fixed up 
now

>Well, some of us do.
>
>Okay, a small percentage of us do, but we're too weak at math
>to quantify it accurately.

lol

>> common reason for assuming someone else is female in my experience)
>> 
>> I'm Australian .. I just guessed at Jenda's gender .. it's not the first
>> time - and I'm sure it will not be the last - that those Czech (s?)
>> names screw me up .. my culturally-inept apologies Jenda
>> 
>> ( I guess I'll have to go back to dreaming about Abigail *8^)
>
>To quote Randal: "heh".

*8^)

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Fri, 27 Aug 1999 10:54:00 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Jenda's gender [was: newbi: Registry Help under NT]
Message-Id: <MPG.12308cb26785f462989c86@news-server>

Jenda Krynicky writes ..
>In case you ever need it:
>Do not look at the first name (you'd have to remember all names), but at the l
>It differs between males and females in Czech. (Same for Slovak)
>If it ends with "a" you have about 99.9% chance it's a female. Otherwise it's 

( lines longer than 80 chars rudely truncated )

thanks for the information - very different from here (where last names 
are all the same for each member of the family - as you probably know) 
 .. I'm sure it will come in handy

>> ( I guess I'll have to go back to dreaming about Abigail *8^)
>
>I wish you nice dreams ;-)

*8^) .. I need all the help I can get

>BTW: Did we get far from Perl, huh?

Perl ? .. what's that ? .. is that the CGI script language ?

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Thu, 26 Aug 1999 14:07:42 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Locate a substring?!
Message-Id: <37C5AC9E.692F624D@mail.cor.epa.gov>

Phil Schaechter wrote:
[his answer before the question, jeopardy-style as we like to
call it]
> Thanks, that's just what I'm looking for
> Phil

An easy way to find functions like this is to look in the
beginning of the perlfunc 'manpage'.  You can read it just
by typing 'perldoc perlfunc' at a command prompt, although
some people prefer the HTML version [you can also get it in
POD or LaTeX or...]  There is a section titled "Perl functions
by category" which will help narrow your search.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 22:46:51 GMT
From: "David D. Huff Jr." <huffd@nls.net>
Subject: Re: mirror.pl on OS/2 Question
Message-Id: <37C5C288.78D1E5E1@nls.net>

Yes, Abigail I will.

Please, (Abigail) help me to do file deletes on the target system
when they no longer exist on the source system.

I am using the mirror.pl script on OS/2 Warp. The mirror
program works very well. But the file delete portion does
not.

Your assistance is appreciated.

Thank you,

Dave Huff

Abigail wrote:

> David D. Huff Jr. (huffd@nls.net) wrote on MMCLXXXVI September MCMXCIII
> in <URL:news:37C48EAB.6E3177F3@nls.net>:
> '' How do I make mirror.pl delete files on the target
> '' server that do not exist on the source server?
>
> You would use the magic word "please".
>
> Abigail
> --
> srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
> //=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----



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

Date: 26 Aug 1999 18:15:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mirror.pl on OS/2 Question
Message-Id: <slrn7sbim9.n0r.abigail@alexandra.delanet.com>

David D. Huff Jr. (huffd@nls.net) wrote on MMCLXXXVI September MCMXCIII
in <URL:news:37C5C288.78D1E5E1@nls.net>:
'' 
'' I am using the mirror.pl script on OS/2 Warp. The mirror
'' program works very well. But the file delete portion does
'' not.

Jeopardy style, and still no indication what is being tried and
how it doesn't work as expected. Just "it doesn't work".

And you honestly expect a serious answer? Get real.




Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 26 Aug 1999 16:30:28 -0600
From: Scott Longberry <scottl@wybron.com>
Subject: OT Browser Height & Width tags (was Re: Images)
Message-Id: <37C5C003.D548829E@wybron.com>

Phil Schaechter wrote:
> 
> Or you could make it easy on yourself, and have it print out smaller height
> and width tags, the browser will then resize the picture for you

This would entirely defeat the purpose of using thumbnails. The purpose
of using thumbnails is to speed up download times of your web page. By
simply changing the width and height tags in the HTML the browser still
downloads the entire image and then shrinks the displayed size... No
savings in dl time here.

Sorry for the off topic post but I wanted to clear this up before
someone else who didn't know any better tried it.

Scott
-- 
Scott Longberry
Systems Administrator
Wybron, Inc.
4830 List Dr.
Colorado Springs, CO 80919


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

Date: Fri, 27 Aug 1999 00:04:11 GMT
From: whos_john_galt@my-deja.com
Subject: Re: Perl a Black Sheep?
Message-Id: <7q4klj$guv$1@nnrp1.deja.com>

Nope, just MCSE and MCSD


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 26 Aug 1999 23:32:25 GMT
From: finsol@ts.co.nz
Subject: Perl Y2K Bugs on the Internet
Message-Id: <7q4iq8$fk2$1@nnrp1.deja.com>

This posting relates to C/C++, Java and Javascript developers, but is of
particular interest to those developing in Perl.

Perl developers who are unaware that it is possible to create Y2K bugs
in Perl applications may be interested in my article published August
1999 regarding the finding of numerous Y2K bugs in Perl, Java,
Javascript and C/C++ in code published on the internet and buried within
web pages.

This article is available at URL:
http://www.y2kinfo.com/journal/features/0899_amon.html

The article links through to over 300 web pages that contain Y2K bugged
code - the vast majority of them in Perl.  The most common problem is
hardcoded 19's but there are also 70 on-line examples of the booby trap
code problem which affects all the above languages.
To go directly to these on-line examples, the URL is:
http://www.ts.co.nz/~finsol/y2k_examples.htm

It would appear that the Y2K message is still not getting through to
many programmers.  For Perl developers, part of the reason maybe that
whenever the subject is raised within the Perl newsgroup the response is
often abuse, denial or a belittling of the person making the query.
Often they are told to read the FAQ which offers minimal information on
the topic.  An intelligent newsgroup debate on the topic would do more
in enlightening programmers who have yet to discover that their
applications need to be checked for Y2K bugs.

Jocelyn Amon


--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 26 Aug 1999 17:32:05 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Y2K Bugs on the Internet
Message-Id: <37C5DC85.1CA94EC2@mail.cor.epa.gov>

finsol@ts.co.nz wrote:
> 
> This posting relates to C/C++, Java and Javascript developers, but is of
> particular interest to those developing in Perl.

Nice to see you again.

The problem is that all Perl developers know this problem, but
thousands of script-kiddies do not.  You need to get your message 
out to a difference audience.  We in this newsgroup have
complained and complained about bad code in popular Perl
web programs, but has it done much good?  I doubt it.

In fact, you can look at resources like Jeff Pinyan's 
CRAP project to see that posters in this ng are serious
about pointing out major flaws in such code.

> Perl developers who are unaware that it is possible to create Y2K bugs
> in Perl applications may be interested in my article published August
> 1999 regarding the finding of numerous Y2K bugs in Perl, Java,
> Javascript and C/C++ in code published on the internet and buried within
> web pages.
> 
> This article is available at URL:
> http://www.y2kinfo.com/journal/features/0899_amon.html
> 
> The article links through to over 300 web pages that contain Y2K bugged
> code - the vast majority of them in Perl.  The most common problem is
> hardcoded 19's but there are also 70 on-line examples of the booby trap
> code problem which affects all the above languages.

There are even worse mangles than the '19' prepend out
there.  Frustrating, isn't it?

> To go directly to these on-line examples, the URL is:
> http://www.ts.co.nz/~finsol/y2k_examples.htm
> 
> It would appear that the Y2K message is still not getting through to
> many programmers.  For Perl developers, part of the reason maybe that
> whenever the subject is raised within the Perl newsgroup the response is
> often abuse, denial or a belittling of the person making the query.

I disagree here.  The problem is that the people who know
better are not the ones lifting code and sticking it in
their web pages _ad_hoc_ with [1] no understanding of the
code, and [2] no interest in learning.  The people who
are taking scripts out of Matt's Script Archive or Selena
Sol's Archive are not the ones *writing* any Perl programs.

Have you considered sending each and every guilty party
you find an e-mail telling them that they have an obvious
Y2K error in their code and they should be embarrassed?

> Often they are told to read the FAQ which offers minimal information on
> the topic.  An intelligent newsgroup debate on the topic would do more
> in enlightening programmers who have yet to discover that their
> applications need to be checked for Y2K bugs.

In my experience, the people who are perpetrating these
errors: 
[1] do not read this newsgroup;
[2] when they come here for help they will not read past
    messages even if said message is less than a few hours
    old;
[3] insist that they do not want to learn Perl and expect
    newsgroup members to write code for them;
[4] refuse to take constructive (okay, sometimes not so
    constructive) criticism about the code they're using
    without understanding;
[5] often get furious that anyone expects them to do some
    work like learning enough Perl to fix a simple bug
    like this themselves.

I would welcome some constructive discussion of other
ways the perpetrators can be notified of the mistakes they
are making, because we don't seem to be making much
headway merely by discussing it here. 

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 17:29:55 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Perl Y2K Bugs on the Internet
Message-Id: <7q4m6a$ccq$1@brokaw.wa.com>


finsol@ts.co.nz wrote in message <7q4iq8$fk2$1@nnrp1.deja.com>...
[Y2K whining snipped]
>An intelligent newsgroup debate on the topic would do more
>in enlightening programmers who have yet to discover that their
>applications need to be checked for Y2K bugs.

Debate is not necessary.  See perlfaq4: Does Perl have a year 2000
problem?  Is Perl Y2K compliant?

Also see: http://language.perl.com/news/y2k.html

While you're at it, check out:
     perldoc -f localtime
     perldoc -f gmtime

>Jocelyn Amon
Trolling again, Ms. Amon?





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

Date: Thu, 26 Aug 1999 16:08:23 -0700
From: <->
Subject: Perl.exe has an interpreted mode?
Message-Id: <7q4hrf$tb8@news.dns.microsoft.com>

I've noticed if you just type 'perl.exe' from the command line, perl seems
to go into interpreted mode. I can't verify this since I don't know what the
control commands are. It allows you to enter just about anything, and
sometimes offers a warning, but I can't figure out how to tell it to
actually run some code. I'm looking for an interpreted mode to quickly test
lines of code, something like the old versions of Forth. I know about '-e'
switch, but in involves more typing than it's worth.

Anyone have any ideas?
Doug Carter
namekuji@hotmail.com




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

Date: 26 Aug 1999 23:21:06 GMT
From: revjack <revjack@radix.net>
Subject: Re: Perl.exe has an interpreted mode?
Message-Id: <7q4i52$p82$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

- explains it all:
:I've noticed if you just type 'perl.exe' from the command line, perl seems
:to go into interpreted mode. I can't verify this since I don't know what the
:control commands are. It allows you to enter just about anything, and
:sometimes offers a warning, but I can't figure out how to tell it to
:actually run some code.

Type the code in (as many lines as you like), hit Ctrl-D, and Enter.


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

Date: 26 Aug 1999 18:47:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl.exe has an interpreted mode?
Message-Id: <slrn7sbkiq.n0r.abigail@alexandra.delanet.com>

- (-) wrote on MMCLXXXVI September MCMXCIII in
<URL:news:7q4hrf$tb8@news.dns.microsoft.com>:
\\ I've noticed if you just type 'perl.exe' from the command line, perl seems
\\ to go into interpreted mode. I can't verify this since I don't know what the
\\ control commands are. It allows you to enter just about anything, and
\\ sometimes offers a warning, but I can't figure out how to tell it to
\\ actually run some code. I'm looking for an interpreted mode to quickly test
\\ lines of code, something like the old versions of Forth. I know about '-e'
\\ switch, but in involves more typing than it's worth.


   $ perl -w
   print "Hello, world!\n";
   __END__
   Hello, world!
   $


Look, no magic "control commands".

Of course, this is documented in the manual....


Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 26 Aug 1999 20:10:27 -0400
From: David Roehsler <davers@agora-net.com>
Subject: problem with cgi script
Message-Id: <37C5D773.47F161DB@agora-net.com>

Hi,

I am having trouble with a part of a cgi script I am writing.

The script is made up of 2 parts. The first part is called after input
is processed through the web page and it (the input) is displayed for a
preview.

This web site  is for creating a BiBteX entry, and the date is supposed
to be displayed in a particular format. It looks something like this:

Month = mar # "23--" # may # " 18" ,


This output is from the first part of the script. This is the code:

if ($FORM{start_month} && $FORM{start_date} && $FORM{end_date} &&
$FORM{end_month})

print "\t  Month = $FORM{'start_month'} # \"$FORM{'start_date'}--\" #
$FORM{'end_month'} # \" $FORM{'end_date'}\" , \n";

$FORM{date} = "$FORM{'start_month'} #   \"$FORM{'start_date'}  --\" #
$FORM{'end_month'} #  $FORM{'end_date'},";

The last part of the snippet writes the whole string into one scalar
variable called "date".

After this, the output is fed to another script for final processing, it
is in the web page like this:

print "<input type=hidden name=date value=\"$FORM{'date'}\">\n";

When it comes to the second script, the input is written to  a file,
this variable does not come out correctly. It gets cut off at the first
quotation mark:

Month = mar #   ,

The part which writes it to a file looks like this:

if ($FORM{'date'})
{
print OUT "  Month = $FORM{'date'},\n";
}

Any assistance is appreciated, it has been driving me crazy.

Best regards

David Roehsler



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

Date: Thu, 26 Aug 1999 23:09:01 +0200
From: Thierry METOUDI <thierry.metoudi@francemel.com>
Subject: Re: Regexp bug or what?
Message-Id: <37C5ACED.E38E563E@francemel.com>

Tell me more

Larry Rosler a écrit :

> [Posted and a courtesy copy mailed.]
>
> In article <37C31408.8F893EAB@francemel.com> on Tue, 24 Aug 1999
> 23:52:09 +0200, Thierry METOUDI <thierry.metoudi@francemel.com> says...
> > I'm using ActivePerl build 509 and I noticed that the  + regexp
> > quantifier doesn't seem to work properly.
>
> Don't bet on that!
>
> > example:
> >
> > $p = "999  yyyyyy";
> > if ( $p=~/(\d+?)\s*?([A-Za-z]+?)/g ) {
> >   print "$1\t$2\n";
> > }
> >
> > output:
> > 999 y
>
> You told it to match a string of at least one letter, but as few as
> possible, so it did.
>
> > and if we change the code for:
> >
> > if ( $p=~/(\d+?)\s*?([A-Za-z]+)/g ) {
> >
> > outputs:
> > 999 yyyyyy
> >
> > this is the desired output but the regexp should be the first one to get
> > this result. Right?
>
> Wrong.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com



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

Date: Thu, 26 Aug 1999 14:43:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regexp bug or what?
Message-Id: <MPG.122f54ce5b28a93e989eb7@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37C5ACED.E38E563E@francemel.com> on Thu, 26 Aug 1999 
23:09:01 +0200, Thierry METOUDI <thierry.metoudi@francemel.com> says...
> Tell me more

That's rather an unbounded request, isn't it?

> > > $p = "999  yyyyyy";
 ...
> > > if ( $p=~/(\d+?)\s*?([A-Za-z]+)/g ) {

      if ( $p =~ /
 (\d+)       # Capture first sequence of one or more digits into $1.
             # (The ? is not needed, so I omitted it.)
 \s*         # Skip optional sequence of white-space characters.
             # (The ? is not needed, so I omitted it.)
 ([A-Za-z]+) # Capture sequence of one or more letters into $2.
                /gx ) {

So $1 is '999 and $2 is 'yyyyyy'.

I assume I've told you enough.  This is all very basic regex stuff, so 
you should read up on it yourself.

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


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

Date: Thu, 26 Aug 1999 23:49:55 GMT
From: Otis Gospodnetic <otis@my-deja.com>
Subject: Re: semaphore manipulation
Message-Id: <7q4jqv$g6u$1@nnrp1.deja.com>

In article <7q1pbo$h02$1@nnrp1.deja.com>,
  Jim Williams <james.p.williams@usahq.unitedspacealliance.com> wrote:
> In article <7q1ef1$8dr$1@nnrp1.deja.com>,
>   Otis Gospodnetic <otis@my-deja.com> wrote:
> > I'm looking for a perl script or module for handling semaphores...
> > So far I found IPC::Semaphore via www.cpan.org search interface, but
> > that module does not let me manipulate semaphores that other
> > applications have created, which is what I really need.
>
> While I've never used IPC::Semaphore, a quick glance at it shows that
> it is just a wrapper around semget(), et al.  As such, you should be
> able to use it to create them anew or use existing ones created by
> other processes.  Setting the IPC_CREAT bit in the constructor call
> causes it to be created if it doesn't exist on the system.  This is
> appropriate for server processes.  Clients typically do not set this
> bit and expect the server to have already created the semaphore.
>
> What problems did you have with IPC::Semaphore?  Or, maybe I
> misunderstood your question...
>
> Also, if you're trying to share a data structure between two
processes,
> you might try IPC::Shareable which simplifies these synchronization
> issues.

Maybe I am missing something about IPC::Semaphore.
I see no way to get other semaphores (those that I see when I do 'ipcs')
and manipulate (remove) them.

Application X (not perl, just something completely different) creates
some semaphores visible with 'ipcs' and I want to write a script that
periodically checks semaphores in the system and removes some of them
(because they lock a certain thing, a database, which makes other
things using that Db hang)

First I was going to write a script that would parse the output of
'ipcs' and do 'ipcrm -s <sem. ID>' but then I found IPC::Semaphore and
thought that using that would be more eleegant, however I can't see how
to remove existing semaphores, only how to create new ones and
manipulate those that I created myself (not what I want)

How does this sound?
Thanks,

Otis
--
InfoJump - Information For The Masses
         - 5,000,000 articles from 4,000 periodicals
         - http://www.infojump.com/?dn


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 26 Aug 1999 16:53:52 -0700
From: "David T. Cannon" <good@drinking.eng.sun.com>
Subject: Re: Spawn a Web process
Message-Id: <37C5D390.F8CF1566@drinking.eng.sun.com>

Uh huh. And line 17 in what? in Perl, or the system lib?

Dave.

Abigail wrote:

> David T. Cannon (good@drinking.eng.sun.com) wrote on MMCLXXXV September
> MCMXCIII in <URL:news:37C47651.4FD99C60@drinking.eng.sun.com>:
> ??
> ??     I have a Perl cgi program that I would like to start a new
> ?? process(to run a report). However, using system() doesn't seem to work.
>
> Yeah, that's because there's a bug in line 17. It should be the
> other way around.
>
> Abigail
> --
> sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
> h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
> c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
> print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----



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

Date: 26 Aug 1999 19:45:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Spawn a Web process
Message-Id: <slrn7sbnui.n0r.abigail@alexandra.delanet.com>

David T. Cannon (good@drinking.eng.sun.com) wrote on MMCLXXXVI September
MCMXCIII in <URL:news:37C5D390.F8CF1566@drinking.eng.sun.com>:
`` Uh huh. And line 17 in what? in Perl, or the system lib?

You're posting in Jeopardy style, fully quoting the article including
signature and advertisement.

Stop that.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 26 Aug 1999 23:31:58 +0100
From: "Paul Wood" <john.wood@diamond.co.uk>
Subject: Re: Visibility of inlined subs
Message-Id: <7q4fc9$g9e$1@nclient7-gui.server.ntli.net>

> Yes.  You ought to look in the perldiag pages whenever you get an
> error you don't understand.  Here's what this says:
>
> Constant subroutine %s redefined
>   (S) You redefined a subroutine which had previously been eligible
>   for inlining. See perlsub for commentary and workarounds.

I understand the error, just not why I get it when the subs don't appear to
be there when I try to use them.

> So go to the perlsub pages [read them in HTML or using the command
> 'perldoc perlsub'] and read, as indicated.

I've read all the man pages etc... I still can't spot what's wrong.
Here's a breakdown of the code...

# in file.pl

use Modules;

package main;
require "library_file.pl";

&function( CONST1 | CONST2 );

# in library_file.pl

package main;

sub CONST1 () { 0 }
sub CONST2 () { 1 }
sub CONST3 () { 2 }

sub function {
 .
 .
 .
}

If I check the vales of the constants from inside the library file, they're
fine. If I try to use them from the main file, I get the string values of
the sub names instead.

Thanks,

-Paul.




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

Date: Thu, 26 Aug 99 20:30:30 GMT
From: philh@vision25.demon.co.uk (Phil Hunt)
Subject: Re: Why use Python when we've got Perl?
Message-Id: <935699430snz@vision25.demon.co.uk>

In article <37c563bc.26497369@news.hydro.co.uk>
           gary@onegoodidea.com "Gary O'Keefe" writes:
> A keyboard was whacked upside David Oppenheimer's head and out came:
> 
> >I don't quite understand the relevance of this entire Perl advocacy string
> >here.  If Xah thinks that getting mean responses to postings (especially
> >postings from newbies) is so very cool, then why waste time over here doing
> >postings to the Python newsgroup.  I must say that in most newsgroups I have
> >found people friendly and helpful.  If I were to post to a newsgroup and get
> >flamed for not knowing anything or given obviously incorrect information just
> >to piss me off, I'd never go back.  It would not generate feelings of
> >advocacy for me.  Who the hell wants to have some intellectual elitist
> >assholes tell you you're ignorant just for asking a question?!
> 
> Python is a language that you hear about after conversing with
> knowledgeable people, a language recommended by experts to the keen
> computer scientist -- I've always thought of Python, perhaps unfairly,
> as being the language for those people interested in language design
> as an end in itself. But, one way or another, this makes for edifying
> conversation between educated people.
> 
> Perl on the other hand is the first language anyone even vaguely
> interested in putting together an interactive web-server hears about.
> That means EVERY DUMBASS IN THE UNIVERSE who wants to put their cock
> on the internet and have you virtually stroke it but, importantly,
> can't be bothered to actually learn all this computer bullshit posts
> to comp.lang.perl.misc.
> 
> If your newsgroup (that you'd just paid to download) was filled with
> posts like this:
> 
> > Subject: [newbee] I am too damn lazy - can't you do this for me?
> >
> > hay gurus
> >
> > Im starting up an intractive cock-stroking website
> > (http://www.cockstroke.com/). Its going 2 B KEWL!!!
> >
> > But I NEED A CGI TO MAKE IT WORK!!!
> >
> > Can you supr-clever gurus write me something??!! It woudnt take
> > you any time and ITD B GRATE!!!
> >
> > THX
> > 
> > Newbee
> 
> then your patience would vapourise, just like ours.

Hey, I thought all Perl users were like that :-)

> Gary
> 
> The newbee post above and any mentioned websites are purely fictional.
> Any similarity to a real newbee, (living or dead) or website are
> purely co-incidental.
> 
> <NOT SERIOUS>
> p.s. I've got a great idea: let's teach those smug python bastards a
> lesson by re-directing all the newbees to comp.lang.python. Tell them
> it's the latest, greatest, thing for developing their CGI scripts.

I can see it now: Python, the language for a firmer, harder, hotter,
cock-stroking experience!!!

-- 
Phil Hunt....philh@vision25.demon.co.uk



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

Date: Fri, 27 Aug 1999 00:12:41 GMT
From: wtanksle@dolphin.openprojects.net (William Tanksley)
Subject: Re: Why use Python when we've got Perl?
Message-Id: <slrn7sblvo.p96.wtanksle@dolphin.openprojects.net>

On Thu, 26 Aug 1999 10:44:48 -0400, David Oppenheimer wrote:

>That being said, are there ways to integrate Python and Perl to do things
>that neither one can do alone?!

Minotaur is an attempt to do exactly that -- they've got Python, Perl,
Tcl, Ruby, Forth, and several other languages all glued together and all
callable from each other, with good data interchange.

If anything can result in a synergistic effect, that's it.

>David O.

-- 
-William "Billy" Tanksley


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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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