[12300] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5900 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 5 18:07:20 1999

Date: Sat, 5 Jun 99 15:00:18 -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           Sat, 5 Jun 1999     Volume: 8 Number: 5900

Today's topics:
    Re: Anyone know what is this script line meaning ?? <cassell@mail.cor.epa.gov>
    Re: CGI Scripting to a database <thewheel@stlnet.com>
        chomp() is ok (was Re: Executing adduser? Follow Up.) <hasant@trabas.co.id>
    Re: FAQ 5.25: How can I read in a file by paragraphs? <cassell@mail.cor.epa.gov>
    Re: Help with OOP in Perl <thewheel@stlnet.com>
    Re: Help! Perl "typo" error <thewheel@stlnet.com>
    Re: how do i fucking run perl w32 <gellyfish@gellyfish.com>
    Re: I'm looking for some virgin men, send me a message  (Michel Dalle)
    Re: Issuing remote commands without Telnet... <gellyfish@gellyfish.com>
        It don't work !  What are my mistakes ??? <bruno.baguette@francemel.com>
    Re: It don't work !  What are my mistakes ??? <rootbeer@redcat.com>
    Re: It don't work !  What are my mistakes ??? <bruno.baguette@francemel.com>
    Re: It don't work !  What are my mistakes ??? <rootbeer@redcat.com>
    Re: know Perl to maintain Perl (was: Re: I pass an arra <tchrist@mox.perl.com>
    Re: msql, dbi, apache, linux <thewheel@stlnet.com>
    Re: Problem with opening 2 files at once. Please Help!! <thewheel@stlnet.com>
    Re: Question regarding semaphores <gellyfish@gellyfish.com>
    Re: split strings <bruno@toutatis.demon.co.uk>
    Re: split strings (Tad McClellan)
    Re: split strings <All@n.due.net>
    Re: The artistic license and perl: <rra@stanford.edu>
    Re: Using Or to evaluate multiple values <bruno@toutatis.demon.co.uk>
    Re: Using Or to evaluate multiple values <dgris@moiraine.dimensional.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 05 Jun 1999 13:49:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <37598D53.F73F323D@mail.cor.epa.gov>

kevin wrote:
> 
> On Mon, 31 May 1999 07:59:47 GMT, an opinion was expressed by
> tvn007@my-deja.com stating:
> 
> >Be Kind to others please
> >
> >You do not have to reply to him/her with such answer.
> >
> Do you know what, some (not all) of the posters i have seen
> in this ng, are IMO at times real ignorant. Much more so than any
> other programming related ng i have personally seen.

Are you referring to the questioners or the responders?
If you're referring to the responders, then you don't know much
about the Perl culture.  But that's okay.  Perl is a
learn-as-you-go kind of language.  Which is also how people
get in over their heads more so than in many other languages.
 
> How many times have you seen: 'read the manual' 'read a book'
> etc.
> 
> Basically is what some people are really saying is why bother with
> ng's when there are books?

No, what 'some' people are saying is:

1)  "For Pete's sake, the answer to this is on your own
computer in the files that install with Perl.  Can't you
be bothered to read them?"

or

2)  "Good grief!  I just spent the last three years writing
answers for this and similar questions!  Do you have any
idea how it makes me feel to see this when I already wrote
a comprehensive answer and made it available to everyone on
earth?"

or

3)  "Ooh.  This is bad.  Don't you even know that your
problem has *nothing* to do with programming Perl, but
is in fact a CGI|HTML|HTTP|webserver|win32|sockets [pick
at least one] question?"

or

4)  "Your question is so poorly worded that the answer 
could be anything.  Do you want to try again?"

or

5)  "Seriously, how do you expect someone maybe thousands
of miles away to mystically divine what's wrong with your
unposted code?  Could you please try to follow the guidelines
for this newsgroup when you post?"

or

 ...

I could go on for hours, but why bother.  Either you have gotten
the point, or you won't.

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


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

Date: Sat, 05 Jun 1999 16:19:00 -0500
From: "T. Wheeler" <thewheel@stlnet.com>
Subject: Re: CGI Scripting to a database
Message-Id: <37599444.3D78E12@stlnet.com>

There are modules for this on CPAN.  

A better approcah might be to use the perl
DBI modules that are somewhat of a standard
for database access in perl.

I think the URL for DBI is:

http://www.hermetica.com/

T. Wheeler

paulm@dirigo.com wrote:
> 
> I'm currently in the process of setting up our database to be web
> enabled.  Does anyone know of a place where I can get an idea of how to
> write CGI scripts to query a database via ODBC?
> 
> --
> Paul R. Mesker
> System Engineer
> Dirigo Inc.
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

-- 
------------------------------------------------
thewheel@stlnet.com


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

Date: Sun, 6 Jun 1999 01:07:12 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: chomp() is ok (was Re: Executing adduser? Follow Up.)
Message-Id: <Pine.LNX.3.96.990606010144.18427A-100000@borg.intern.trabas.co.id>

On Fri, 4 Jun 1999, Tom Phoenix wrote:

rootbeer] chomp was included merely by habit. In fact, if you don't chomp, the
rootbeer] newline is removed with the other trailing whitespace, so it's completely
rootbeer] unnecessary. There's no significant difference in efficiency, though,
rootbeer] since the I/O overhead is so large. Cheers!

As a habit, yes. I do that too.
I still tought that chomp() on blank line would
return undefined until I re-read perldoc -f chomp.


thanks,
-hasan-
uhm, no more sig(h)




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

Date: Sat, 05 Jun 1999 14:02:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Tom and Gnat <perlfaq-suggestions@perl.com>
Subject: Re: FAQ 5.25: How can I read in a file by paragraphs?
Message-Id: <3759906B.A1199CBC@mail.cor.epa.gov>

[courtesy cc sent to poster]

Tom Christiansen wrote:
> 
> [snip of header and 1st para]
> 
>     Note that a blank line must have no blanks in it. Thus `"fred\n
>     \nstuff\n\n"' is one paragraph, but `"fred\n\nstuff\n\n"' is two.

Due to the line break, this is opaque to those who need to
understand it.  May I suggest:

     Note that a blank line must have no blanks in it.
     Thus `"fred\n \nstuff\n\n"' is one paragraph,
     but  `"fred\n\nstuff\n\n"' is two.

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


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

Date: Sat, 05 Jun 1999 16:21:51 -0500
From: "T. Wheeler" <thewheel@stlnet.com>
Subject: Re: Help with OOP in Perl
Message-Id: <375994EF.2786025D@stlnet.com>

And the best news is that you probably
already have one.

$perldoc perltoot

(This is the same as looking at the perltoot
manpage).  I have seen that Tom Christiansen
has written a newer tutorial recently, but I
have not yet had the time to check it out. 
You might want to do a search on perl.com for
that.

Tom Wheeler


Josh Steadmon wrote:
> 
> Hello, I'm an intermediate Perl programmer who has been plagued by poorly
> written tutuorials.  I was hoping someone could point me to a (hopefully
> free) guide on object oriented stuff in Perl.  Thanks for the help!
> 
> Josh

-- 
------------------------------------------------
thewheel@stlnet.com


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

Date: Sat, 05 Jun 1999 16:26:59 -0500
From: "T. Wheeler" <thewheel@stlnet.com>
Subject: Re: Help! Perl "typo" error
Message-Id: <37599623.B54FC05F@stlnet.com>

These are not errors -- they are warnings. 
You are (wisely) using the -w switch, which
warns you of these things.  If there really
is no mistake, you are probably guilty of
poor program design, rather than bad typing.

It's impossible to say what is causing this
exactly without seeing the program itself,
but you could find it yourself by following
those variable throughout the program and see
if they are doing what you think they should
be doing.  Using the perl debugger might also
be helpful.

Finally, remember that perl is
case-sensitive, so if you are on a Windows
platform (and are new to perl), this may be
unfamiliar to you.  $VARIABLE and $variable
are not the same.

Tom Wheeler


Kevin Howe wrote:
> 
> I have been using a script I wrote successfully for quite some time, but for
> some reason on one of my servers I am now getting the following errors when
> I do a syntax check, despite the fact that there are no "typos" in the
> variable names. Can anyone tell me what is happenning?
> 
> Greatly appreciated,
> Kevin
> 
> Errors
> ----------------------
> Name "main::ITEM_AFTER_SHIPPING" used only once: possible typo at
> /virtualhosts/triple-bypass.com//www/cgi-bin/carts/plans/shop.cgi line 293.
> 
> Name "main::options" used only once: possible typo at
> /virtualhosts/triple-bypass.com//www/cgi-bin/carts/plans/shop.cgi line 332.
> 
> Name "main::tax1" used only once: possible typo at
> /virtualhosts/triple-bypass.com//www/cgi-bin/carts/plans/shop.cgi line 460.

-- 
------------------------------------------------
thewheel@stlnet.com


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

Date: 5 Jun 1999 19:12:27 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how do i fucking run perl w32
Message-Id: <7jbsqr$4n0$1@gellyfish.btinternet.com>

On Sat, 5 Jun 1999 02:32:57 -0400 Marler wrote:
> Subject: how do i fucking run perl w32
>

There is quite a strong possibility that a large number of people
seeing that subject line will have just skipped your post if they
havent already killfiled you.  Get a grip.

> i just got ActivePerl517. when i run any of the sample scripts, the dos
> window opens quickly then closes. i don't know what the programs do or how
> to run my own programs. can somebody help me please.
> 

Assuming you have simply just clicked on the files in Explorer or
whatever then that is the behaviour I would expect.  You need to run 
the majority of programs from the command line by cd'ing to the directory
in which the program is and then typing (for instance):

   C:\PERL\EG > perl travesty

Of course I have know way to know if this will match your setup.  If you
dont know how to use the command interpreter on your system then theres
not much we can do to help you.  You will be delighted to discover that
the Activestate distribution will install all of the documentation as HTML
under an obvious link in your Start Menu - I would recommend that you
familiarise yourself with this before going any further.

/J\



-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 05 Jun 1999 19:20:09 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: I'm looking for some virgin men, send me a message and what you're in to.
Message-Id: <7jbt7h$ja6$1@xenon.inbe.net>

In article <7jbpva$nea$6@newsfeed.smartt.com>, joey@hecnyyvr.com (Jen Balcmon) wrote:
>I'm looking for some virgin men, send me a message and what you're in to.

Have you tried Virgin Megastore ? Sounds like the place to be for what you're 
asking...

Talk about throwing perl to swines,

Michel.


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

Date: 5 Jun 1999 18:55:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Issuing remote commands without Telnet...
Message-Id: <7jbrqu$4mj$1@gellyfish.btinternet.com>

On Sat, 5 Jun 1999 16:28:10 +0100 Thurley wrote:
> I need to issue commands on my ISPs servers to "make" Perl modules etc.  The
> problem is that they don't support Telnet.
> Is there any way around this?  Can I make the modules without Telnet?
> 

I would say not - although you could make yourself some program that
could do all the steps via the CGI any ISP that is going to allow you
CGI without telnet access is likely to have placed your CGI program
in chroot'ed environment where the necessary tools arent available.

If you have some module that you need to use and the only access you
have is via FTP you might be able to get away with putting the .pm files
into your directory - if and only if the module has no dependencies and
does not have any binary components that need to compiled - you can do
this with CGI.pm and not with GD.pm for instance.  If you do this you
will also need to pay attention to the subdirectories - MIME::Lite for
instance will need to have the Lite.pm place in a subdirectory MIME (I'm
not actually sure whether that particular module will work like that but
you can see what  I mean).

Of course this information comes with no guarantees and if any asks I
didnt tell you ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 5 Jun 1999 21:42:24 +0200
From: "Bruno Baguette" <bruno.baguette@francemel.com>
Subject: It don't work !  What are my mistakes ???
Message-Id: <7jbuci$ke4$1@xenon.inbe.net>

Hello,

I've make a little Perl Script, but it doesn't work !!!
What is my mistake(s) ???

Here is the full source :

# I read the data send to me by a form with a POST method

&ReadParse(*input);


$name=($input{'name'});
$firstname=($input{'firstname'});
$old=($input{'old'});

# And i send an html

print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>What i've received</title>";
print "</head><body>";
print "<b>Name:</b>$name<br>";
print "<b>First Name:</b>$firstname<br>";
print "<b>Old:</b>$old<br>";
print "</body></html>";

When i launch this script with netscape, netscape say that the document
contains no data...

WHAT ARE MY MISTAKES ???

----------------------------------------------------------------------------
--
Bruno Baguette  (bruno.baguette@francemel.com)




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

Date: Sat, 5 Jun 1999 12:51:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: It don't work !  What are my mistakes ???
Message-Id: <Pine.GSO.4.02A.9906051248510.14655-100000@user2.teleport.com>

On Sat, 5 Jun 1999, Bruno Baguette wrote:

> Subject: It don't work !  What are my mistakes ???

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I've make a little Perl Script, but it doesn't work !!!
> What is my mistake(s) ???

In what way does it not work? What error message does Perl give you?

> # I read the data send to me by a form with a POST method

Ah, it's a CGI program. When you're having trouble with a CGI program in
Perl, you should first look at the please-don't-be-offended-by-the-name
Idiot's Guide to solving such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Good luck!

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



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

Date: Sat, 5 Jun 1999 22:10:48 +0200
From: "Bruno Baguette" <bruno.baguette@francemel.com>
Subject: Re: It don't work !  What are my mistakes ???
Message-Id: <7jc01u$lg3$1@xenon.inbe.net>

Maybe you can help me...

I just want to have a little CGI in perl wich receive the data from a POST
form and print this data in a HTML sheet...

I'm sure that it should be a very little source, and to easy for the Perl
Master your are !  ;-)

Can you tell me where can i find that script ?

Or if you have this script, can you mail me this to
bruno.baguette@francemel.com  ???

Sorry for my bad english ! (I'm living in belgium!)

Thanks in advance !
-------------------------------------------
Bruno Baguette
E-Mail : bruno.baguette@francemel.com





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

Date: Sat, 5 Jun 1999 13:22:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: It don't work !  What are my mistakes ???
Message-Id: <Pine.GSO.4.02A.9906051317150.14655-100000@user2.teleport.com>

On Sat, 5 Jun 1999, Bruno Baguette wrote:

> I just want to have a little CGI in perl wich receive the data from a
> POST form and print this data in a HTML sheet...

It's easy to write such a thing with the CGI module, or a similar one.

> I'm sure that it should be a very little source, and to easy for the
> Perl Master your are !  ;-)

Flattery will get you everywhere, but are you trying to get someone else
to write a program for you?

> Can you tell me where can i find that script ?

If you want merely to find programs, there are plenty of archives out
there. Start with Yahoo.

Have I misunderstood what you're asking for? If you think that might be
the case, please ask again in your native language; probably someone here
will be able to answer you. Cheers!

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



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

Date: 5 Jun 1999 14:52:34 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: know Perl to maintain Perl (was: Re: I pass an array...)
Message-Id: <37598e12@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Jonathan Feinberg <jdf@pobox.com> writes:
:Is there a word or phrase missing from that sentence?

Yes, there is, but I'm now too far away to check the right version.
I just flew to Usenix.  Perl BOF here in Monterey Tuesday @ 6pm.
Anyone welcome.

--tom
-- 
    "...this does not mean that some of us should not want, in a rather
    dispassionate sort of way, to put a bullet through csh's head."
		Larry Wall in <1992Aug6.221512.5963@netlabs.com>


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

Date: Sat, 05 Jun 1999 16:35:33 -0500
From: "T. Wheeler" <thewheel@stlnet.com>
Subject: Re: msql, dbi, apache, linux
Message-Id: <37599825.6CA0A705@stlnet.com>

As per the FAQ, usually when you have a
problem like this it revolves around the
differences in your environment.

Think about it:  You have environmental
variable ($PATH, $USER. etc) set up in your
 .profile (or similar) file, but they are
different than that of the user who owns the
web server process (typically user nobody).

If you are on a UNIX-like machine, amd you
have appropriate privileges, issue the
command:

$su - nobody

and see what happens.

Tom Wheeler

Stefan Kuhlins wrote:
> 
> The following simple CGI-script runs at the command prompt, but not as
> http://localhost/cgi-bin/test.pl
> because auto/DBI/connect.al is not found.
> (The content of @INC is in both cases the same!)
> Any ideas?
> 
> Thanks in advance,
>   Stefan
>


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

Date: Sat, 05 Jun 1999 16:31:02 -0500
From: "T. Wheeler" <thewheel@stlnet.com>
Subject: Re: Problem with opening 2 files at once. Please Help!!!!
Message-Id: <37599716.D5E5A19B@stlnet.com>

What is the $datafile variable set to on the
linux version?   Are you positive?  Try
setting it to a literal 'phone.dat' just to
see if you are right.


Tom Wheeler

Chris Manolis wrote:
> 
> Can anyone please help me.  I wrote the following script to capture
> outgoing calls from my
> PBX.  The file c:/temp/phone.dat is used as a test file and contains
> some sample incoming data.
> What I try to do is read the incoming data and create separate files
> based on date.
> 
> SAMPLE INCOMING DATA:
> 05 23  <---- this is the date
> 
> 0722 0004 7   9  71         4557705   275                            5
> 0     16
> 
> 0810 0012 7   9  71         4557705   275                            5
> 0     10
> 
> 05 24
> 
> 0812 0004 7   9  76         9353282   223                            5
> 0     07
> 
> 0825 0005 7   9  71         4551700   223                            5
> 0     08
> 
> 0844 0034 7   9  71     18008091463   211                            7
> 0     15
> 
> The Script works fine on an WinNT PC but when I try to run it on a LINUX
> PC I get the error
> 
> Can't write file : No such file or directory at pbx line 27, <INPUT>
> chunk 1.
> 
> line 27 contains this:
>          open (OUTPUT, ">> /root/$datafile") or die "Can't write file :
> $!";
> 
> The only diference between the WinNT and Linux are the INPUT and OUTPUT
> paths.
> 
> Please HEEEELLLLLPPPPP!!!!!!!!!!!!!
> 
> Please email your replies to
> cmanolis@clementpappas.com
> 
> Thanks Chris Manolis
> --------------------------- BEGIN SCRIPT
> -------------------------------------------------
> 
> open (INPUT, "c:/temp/phone.dat")       # Open file for read OR device
>      or die "Couldn't Open the file : $!\n";
> 
> while(<INPUT>) {
>         $in_data=$_; # Read first record
>         $in_datecheck = substr($in_data,5,2);
>         if ($in_datecheck=~/^[\r\n]+$/) # Check if record contains just the
> date
>                 {
>                         $in_datemm=substr($in_data,0,2);
>                         $in_datedd=substr($in_data,3,2);
>                         $datafile="pbx$in_datemm$in_datedd.dat";
>                 }
>         else {                  # If the record does not contain the date read record fields
> 
>                         $in_time = substr($in_data,0,4);
>                         $in_duration = substr($in_data,5,4);
>                         $in_outcalln = substr($in_data,20,15);
>                         $in_ext = substr($in_data,36,5);
>                         $in_chanel = substr($in_data,76,3);
> 
>                                 if ($in_time ne "\n") # If the in_time field DOES NOT contain new
> line and CR codes
>                                                       # Then add record to data file
>                                                 {
>                                 open (OUTPUT, ">> c:/temp/$datafile") or die "Can't write file :
> $!";
>                                 print OUTPUT $in_datemm," ",$in_datedd," ",$in_time,"
> ",$in_duration," ",$in_outcalln,$in_ext,$in_chanel,"\n";
>                                 close(OUTPUT);
>                                                 }
>                   }
> 
> }
> close(INPUT);
> -------------------------------- END SCRIPT
> ----------------------------------------

-- 
------------------------------------------------
thewheel@stlnet.com


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

Date: 5 Jun 1999 20:45:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Question regarding semaphores
Message-Id: <7jc28n$4n8$1@gellyfish.btinternet.com>

On Tue, 25 May 1999 15:15:42 -0500 John Hilgedick wrote:
> I'd like to use semaphores in my cgi scripts.  I've looked at the semaphore
> module (which works on servers under System V - but not others) and am
> looking for something more flexible.
> 
> I have 2 questions in this area:
> 
> 1. Does anyone know of an existing semaphore module that works on "most"
> servers?
> 

As far as I understand it semaphores have to be implemented at the OS 
kernel level - so unless someone was going to take intake account all of
the possible variations and write a super module (which would be a
nightmare because it would have to manage a separate XS component for
each OS) then no I dont think you can do that - you have the Sys V semaphores
and I believe some Win32::Semaphore and maybe people have implemented
Semaphore modules on other systems that export the ability to use them
to user programs like AmigaOS.

> 2. Is there any reason why I can't implement semaphores myself using
> "flock"?
> 

You might try to emulate that but I dont think that you will ever achieve
the atomicity that is required for true sempahores - but you might want
to check out some good book on OS design before you go along with that
judgement.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 05 Jun 1999 20:16:41 +0100
From: Bruno Girin <bruno@toutatis.demon.co.uk>
Subject: Re: split strings
Message-Id: <37597799.DBCA4E18@toutatis.demon.co.uk>

This is a multi-part message in MIME format.
--------------A3B03AD463B16C0BF26C9515
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tom Phoenix wrote:

> On Sat, 5 Jun 1999, Kevin wrote:
>
> > (my problem is I have to get the date under UNIX with $date=localtime;
> > but when the day number is <10, there are 2 spaces
>
> Maybe you really want the individual time/date items, which you can get if
> you use localtime in a list context. Good luck!

Indeed, that would probably be the easiest. Try the short script attached.

Bruno

--
Bruno Girin
Home: bruno@toutatis.demon.co.uk - http://www.toutatis.demon.co.uk
Work: bruno.girin@monis.co.uk - http://www.monis.co.uk



--------------A3B03AD463B16C0BF26C9515
Content-Type: text/plain; charset=us-ascii; name="time.perl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="time.perl"

#!/usr/local/bin/perl

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$rmon=$mon+1;
$ryear=$year+1900;
$txtday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday];
$txtmon = (Jan,Feb,Mar,Apr,Mey,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon];
print "$hour:$min:$sec on $txtday $mday $txtmon $ryear\n";
print "This is day number $yday in the current year\n";

--------------A3B03AD463B16C0BF26C9515--



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

Date: Sat, 5 Jun 1999 08:16:12 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: split strings
Message-Id: <ce4bj7.94l.ln@magna.metronet.com>

Kevin (mpajot@club-internet.fr) wrote:

: I just want to split a string on the "space" ((...)=split(/ /, $string,2)),
: but there is a problem when 2 paces follows themselves ("toto  toto toto"
: for exemple).


   (...)=split(/ +/, $string,2);
                 ^
                 ^ split on one or more space characters

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


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

Date: Sat, 05 Jun 1999 20:49:03 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: split strings
Message-Id: <33g63.8460$mu5.3252@news.rdc1.ct.home.com>


Tad McClellan <tadmc@metronet.com> wrote in message
news:ce4bj7.94l.ln@magna.metronet.com...
: Kevin (mpajot@club-internet.fr) wrote:
:
: : I just want to split a string on the "space" ((...)=split(/ /,
$string,2)),
: : but there is a problem when 2 paces follows themselves ("toto  toto
toto"
: : for exemple).
:
:    (...)=split(/ +/, $string,2);
:                  ^
:                  ^ split on one or more space characters

Actually, for this I prefer

(...)=split(' ',$string,2);

In no way better, but since someone went to the trouble of making this an
option it somehow just seems more perlish to me.  Thankfully TIMTOWTDI.

AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
The beginning of wisdom is the definitions of terms.
  Socrates





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

Date: 05 Jun 1999 14:57:37 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: The artistic license and perl:
Message-Id: <yl1zfqb99q.fsf@windlord.stanford.edu>

Chris Nandor <pudge@pobox.com> writes:

> Well, part of my point is that you won't provide any specific examples
> of how they are used, or how they could be used for Bad.

Sure.  I've only been doing it for the past two posts, after all....

> But unless there's precedent for them being necessarily treated as
> separate things, I'm not sure I will accept that this is a problem.

The fact that licenses treat them as necessarily separate things rather
sets that precendent, I'd say.

> Russ Allbery wrote:
>> Of course you can call it Perl.  Where in point 5 does it say you can't
>> call it Perl?

> Where it says that you cannot advertise this Package as a product of
> your own.  If you make it proprietary, and still call it Perl, you are
> therefore claiming Perl to be "a product of your own".

Um.  No, you're not.  You're calling it Perl and claiming that the parts
you added to it are a product of your own and then selling the whole
thing.  Unix vendors do this with X all the time.  You're selling "an
expanded and enhanced version of the freeware Perl programming language,"
which is precisely what a marketing department would advertise it as.

So I've now named three separate ways that the Artistic License can be
used by someone like Microsoft to fork a proprietary version of Perl and
still call it Perl.  You've not refuted any of the three except with
handwaving about how you don't *think* a jury would accept that argument,
and agreed that one part of the license should be changed.  I think I'm
making my point, frankly.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sat, 05 Jun 1999 20:53:11 +0100
From: Bruno Girin <bruno@toutatis.demon.co.uk>
Subject: Re: Using Or to evaluate multiple values
Message-Id: <37598026.154B4D7F@toutatis.demon.co.uk>

John Smith wrote:

> elsif (($DATA{'city_text'} || $DATA{'city'}) eq
> ("MOUNT EDEN" || "SUNOL"))
>  {
>  print "Cities in Alameda County Rock!";
>  }
>
> Is there an elegant way to list all the cities
> that apply to this print statement in one elsif
> statement?

Try the following:

elsif (($DATA{'city_text'} || $DATA{'city'}) =~ /^(MOUNT EDEN|SUNOL)$/ )
{
    print "Cities in Alameda County Rock!\n";
}

--
Bruno Girin
Home: bruno@toutatis.demon.co.uk - http://www.toutatis.demon.co.uk
Work: bruno.girin@monis.co.uk - http://www.monis.co.uk





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

Date: 05 Jun 1999 14:10:18 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Using Or to evaluate multiple values
Message-Id: <m36752v26t.fsf@moiraine.dimensional.com>

Bruno Girin <bruno@toutatis.demon.co.uk> writes:

> Try the following:
> 
> elsif (($DATA{'city_text'} || $DATA{'city'}) =~ /^(MOUNT EDEN|SUNOL)$/ )
> {
>     print "Cities in Alameda County Rock!\n";
> }

bzzzzt!

@DATA{qw/city_text city/} = ( 'uh-oh', 'MOUNT EDEN' );

Next, please.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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