[12272] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5873 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 3 11:07:23 1999

Date: Thu, 3 Jun 99 08:01:35 -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           Thu, 3 Jun 1999     Volume: 8 Number: 5873

Today's topics:
        know Perl to maintain Perl (was: Re: I pass an array... (Greg Bacon)
    Re: Loading modules at run time - Solution <tchrist@mox.perl.com>
    Re: Loading modules at run time - Solution (M.J.T. Guy)
        mail problems... still :) <office@asc.nl>
    Re: ORACLE_HOME set var <dirkse@my-deja.com>
    Re: ORACLE_HOME set var <fruffet@kaptech.com>
    Re: Perl scripts won't run on Linux <dms@rtp-bosch.com>
    Re: Problem with Regexp (Larry Rosler)
    Re: Problem with Regexp <tchrist@mox.perl.com>
    Re: Problem with Regexp (Tad McClellan)
    Re: Re Better than Perl <dms@rtp-bosch.com>
        stupid ISP? <office@asc.nl>
        Test <mikescot@americasm01.nt.com>
        Thanks! Re: multi-dimensional arrays <dana@nowhere.com>
    Re: The artistic license and perl: <gbartels@xli.com>
    Re: The artistic license and perl: (Chris Nandor)
    Re: Time Error (Larry Rosler)
    Re: Time Error <cs004@wg.waii.com>
    Re: Trying to make custom start page for users via cook (SiKnight)
    Re: two questions, pls help <gellyfish@gellyfish.com>
    Re: uninitialized value? what am i doing wrong? <gellyfish@gellyfish.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 3 Jun 1999 14:07:34 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: know Perl to maintain Perl (was: Re: I pass an array...)
Message-Id: <7j6276$5pn$2@info2.uah.edu>

In article <Ioi53.1688$nn.500792@news.shore.net>,
	Scratchie <upsetter@ziplink.net> writes:
: Greg Bacon <gbacon@itsc.uah.edu> wrote:
: : Down this path lies madness.
: 
: Please elaborate on this. Are you implying that I should never let anyone
: else maintain my code, or that I should insure that anyone who ever does
: has at least the same understanding of perl that I did the week I wrote
: that script?

Why is Perl the only programming language that seems to be cursed with
this bizarre requirement of political correctness?  You never hear of
C programmers writing something in a particular way because it would
be easier for someone who doesn't understand C.  Lisp programmers
certainly wouldn't bow to the nonbelievers.  What makes Perl programmers
such a bunch of bleeding hearts?  Please don't construct the straw man
of C programmers not putting IOCCC entries in production code.  There
is a difference between clear code, intentionally obfuscated code, and
intentionally dumbed down code.

Would you write software documentation in a certain way because it
would make maintenance easier for someone who doesn't know English?

Greg
-- 
VMS is a text-only adventure game. If you win you can use Unix.
    -- Bill Davidsen


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

Date: 3 Jun 1999 08:10:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Loading modules at run time - Solution
Message-Id: <37568cd6@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Jan van Rensburg <jan.van.rensburg@epiuse.com> writes:
:a solution at last, thanks to a java programmer:
:
:instead of:
:
:	use $somemodule;
:
:i did a:
:
:	eval("use $somemodule;");  
:
:why didn't i think of this before... is this bad style though?

See Ram:12 for details; two recipes that should help are:

    Trapping Errors in require or use
    Delaying use Until Run-Time

If you don't have the book, at least you get grep the
code you've ftp'd in.

Note however that performing a use at run-time is nearly
useless, since its too late for any compiler-hinting behaviour 
to have any effect.  Might as well just run do a require 
instead.  Usually.

--tom
-- 
    Perl programming is an *empirical* science!  
	    --Larry Wall in <10226@jpl-devvax.JPL.NASA.GOV>


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

Date: 3 Jun 1999 14:21:10 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Loading modules at run time - Solution
Message-Id: <7j630m$89t$1@pegasus.csx.cam.ac.uk>

Jan van Rensburg  <jan.van.rensburg@epiuse.com> wrote:
>a solution at last, thanks to a java programmer:
>
>instead of:
>
>	use $somemodule;
>
>i did a:
>
>	eval("use $somemodule;");  
>
>why didn't i think of this before... is this bad style though?

Although eval "" is generally best avoided, here you have little choice.

The problem is that the special interpretation of the argument by use
and require (adding on .pm, converting :: to / to get the right file
name ... ) only happens if the argument is a *literal* bareword.
So if you don't use eval "", you'd have to do that work by hand.
Your attempt

        {require $somename;
                 import $somename qw(function);
        }

was failing because it was looking for file Pingtime instead for
Pingtime.pm.

In the particular case you could write

        {require "$somename.pm";
                 import $somename qw(function);
        }

but that will only work for "top level" modules.


Mike Guy


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

Date: Thu, 3 Jun 1999 16:50:29 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: mail problems... still :)
Message-Id: <7j64qc$qmm$1@zonnetje.NL.net>

hiya

i've got this program running like a breeze now , but unfortunately , i
can't seem to recieve mail from it..

i've invested almost 3/4 hours into this program today , and i still can't
see why it can't mail ..

plz , there must be some perl-guru's still alive around this time ..
could you take a look at it , and suggest changes , or rewrite what you
think needs to be done ..

tnx!!
buZz

btw. don't mind the string values , they're in dutch :)

-=[code]=-

$sendmail = "\usr\bin\sendmail"

open (MAIL, "|$sendmail -oi -t") || die ("Content-Type: text/html
\n\n<html><body>Error opening pipe to $sendmail: $!\n</body></html>\n");
print MAIL ("To: office\@asc.nl\n",
            "Subject: [Site] Contactformulier.\n");
print MAIL "\n\n";
print MAIL "-=-=-=-\n";
print MAIL "Bedrijf : $bedrijf\n" if defined $bedrijf;
print MAIL "Contactpersoon : $contact\n" if defined $contact;
print MAIL "Geslacht Contactpersoon : $geslacht\n" if defined $geslacht;
print MAIL "Straat : $straat\n" if defined $straat;
print MAIL "Postcode : $postcode\n" if defined $postcode;
print MAIL "Plaats : $plaats\n" if defined $plaats;
print MAIL "Email : $client_email\n" if defined $client_email;
print MAIL "Telefoon nummer : $tel_nummer\n" if defined $tel_nummer;
print MAIL "Fax nummer : $fax_nummer\n" if defined $fax_nummer;
print MAIL "Ik wil gebeld worden voor een afspraak\n" if defined $belme;

print MAIL "\n-=-=-=-\n";

print MAIL "Verder commentaar :\n$comments\n" if defined $comments;
print MAIL "\n\n";

print MAIL "mvg. Uw website.\n";

close(MAIL);
open (EIND,"dank.htm");
print "Content-type:text/html\n\n";
while ($regel=<EIND>) {print "$regel\n";}
close(EIND);

-=[code ends]=-






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

Date: Wed, 02 Jun 1999 21:07:36 GMT
From: fred dirkse <dirkse@my-deja.com>
Subject: Re: ORACLE_HOME set var
Message-Id: <7j46ei$thj$1@nnrp1.deja.com>

In article <7j3mnu$njt$1@nnrp1.deja.com>,
  edejauser@my-deja.com wrote:
[snip]
> ORACLE_HOME environment variable not set!
[snip]

Try $ENV{ORACLE_HOME}='/usr/app/oracle/...' before connect
or the datasource in the DBI->connect can be fully qualified
or use username/password@servicename

See DBI pod doc or DBI-FAQ section 4.4

--
just another squirrel hacker, fred


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


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

Date: Thu, 3 Jun 1999 15:23:26 +0200
From: "Fred Ruffet" <fruffet@kaptech.com>
Subject: Re: ORACLE_HOME set var
Message-Id: <7j5vko$bsi$1@gatekeeper.ornano.kapt.com>

Eh, eh... I've already seen this think somewhere else... Oh ! That was on my
system.
I'm using Linux server so I don't know lots of Solaris... :)
Anyway, when using a webbrowser and runing CGI script, a new session is
launched and your identity is changed, on linux, to "nobody". I mean that
User ID is not yours, but a generic user's one. Your marvellous user env
variables are not set.

Solution is to reset env variables (only the one you need) at the start of
your script.
$ENV{ORACLE_HOME}="/usr/oracle";
 $ENV{ORACLE_PATH}="/usr/oracle/bin";
 $ENV{ORACLE_SID}="thebasename";
 $ENV{ORACLE_USERID}="user/pass"
$ENV{PATH}.=":/usr/oracle/bin";

Regards,

Fred

edejauser@my-deja.com a icrit dans le message
<7j3mnu$njt$1@nnrp1.deja.com>...
>I have a web application that is written in Perl that accesses an Oracle
>database. The environment is: Solaris 2.6 and Netscape Entreprise Server
>
>The error message is:
>ORACLE_HOME environment variable not set!
>The implicit webuser and a global profile have:
>export ORACLE_HOME
>and is used properly by all ServerSideJavaScript(Livewire) applications.
>
>The Perl code runs well when is executed from personal Unix account:
>export ORACLE_HOME
>is placed inside the personal .profile under this account
>Running it at the command line uses this already set shell variable, but
>from web application does not.
>
>What would you recommend to solve this problem?
>
>Thanks for your help,
>Dan
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.




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

Date: Tue, 01 Jun 1999 08:53:40 -0400
From: Doug Seay <dms@rtp-bosch.com>
To: jmoram@my-deja.com
Subject: Re: Perl scripts won't run on Linux
Message-Id: <3753D7D4.37ADE9B3@rtp-bosch.com>

jmoram@my-deja.com wrote:
> 
> I've just set up at a Linux box as an intranet server. Perl seems to be
> installed ok, but I can't seem to run scripts.

Why do you think that perl is properly installed?  I'm just being the
devil's advocate on this one.

> The GNU C compiler is installed

Are we talking perl or C?  This is not important.

> and I've made sure the scripts are executable,

Good, that is a common error.

> but when I give
> the command to run them, I get this message:
> $ bash: command not found <scriptname>

There are two ways I can get that message.  One is to put it in my PATH,
but to not rehash things.  That is basically BASH not finding the
script.  Use an explicit path (~/bin/script_name) to get around that
one.

If it still doesn't work, your problem is that your path to the perl
interpreter inside the script is bad.  The rules for the this are (more
or less - this is off the top of my head)

if the first byte of the file (first character on first line) is a "#",
the it is a script.  If the second byte is a white space (blank, \n,
etc) it is a script for the interpreter specified in the $SHELL
variable.  If that second byte (second character on first line) is a "!"
then what follows is the explit path to the interpreter.  After that can
come optional switches.

This means your file should start with something like

	#!/usr/bin/perl -w

Of course, if your perl is installed in /usr/local/bin/perl, /bin/perl
or even /tmp/perl_with_a_strange_name, you will need to modify your #!
line accordingly.  My advice is to ensure that /usr/bin/perl and
/usr/local/bin/perl *both* point to a working copy of perl.  I have one
be a symlink to the other (I used to install in /usr/local/bin/perl, but
now I use /usr/bin/perl).

Note that when installing Perl, you get options as to where to put it,
and an option to create a link from /usr/bin/perl to wherever you chose,
so you should have seen this if you installed it yourself.  Well, I got
that prompt with the 5.004 release, I haven't upgraded in a while.

> Is there a config file I need to modify? Any suggestions would be
> appreciated. Thanks in advance.

Sure enough.  I have used Perl on Linux since I got around to installing
Linux back in the 1.2.* days.  Perl worked perfectly and I have never
had any Linux specific problems.  There is no reason to think that Linux
and Perl don't play together well.

- doug


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

Date: Thu, 3 Jun 1999 06:16:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem with Regexp
Message-Id: <MPG.11c020155e11c5cf989b5c@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7j1l0s$75o$1@nnrp2.deja.com> on Tue, 01 Jun 1999 21:57:47 
GMT, stuckenbrock@my-deja.com <stuckenbrock@my-deja.com> says...
 ... 
> I want to match (for example) "Cake" or "Cookies" (insensitive) but both
> have NOT to be leaded by (also for example) "Apple". So that I will
> match "Plumcake","Plumcookies", only "Cake",only "Cookies" but not
> "Applecake" or "Applecookies".

Negative look-behind assertions (new in Perl 5.005) make this easy.

#!/usr/local/bin/perl -w
use strict;
require 5.005;

/(?<!apple)c(ake|ookies)/i and print "Matched $_\n"
    for qw(Plumcake Plumcookies Cake Cookies Applecake Applecookies);
__END__

Output:

Matched Plumcake
Matched Plumcookies
Matched Cake
Matched Cookies

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


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

Date: 3 Jun 1999 07:51:21 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Problem with Regexp
Message-Id: <37568859@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, stuckenbrock@my-deja.com writes:
:I want to match (for example) "Cake" or "Cookies" (insensitive) but both
:have NOT to be leaded by (also for example) "Apple". So that I will
:match "Plumcake","Plumcookies", only "Cake",only "Cookies" but not
:"Applecake" or "Applecookies".

    m#(?<!apple)(cake|cookies)#i

Which only gets cake or cookies in $1, not the preceding bits.
If you want the whole thing in $1,

    m#\b((?!apple)\w*?(?:cake|cookies))#i


man perlre.

--tom
-- 
I'm not writing any more tapes, ever.  --Andrew Hume


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

Date: Thu, 3 Jun 1999 04:48:48 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Problem with Regexp
Message-Id: <ghf5j7.k0i.ln@magna.metronet.com>

stuckenbrock@my-deja.com wrote:

: i've got a Problem with Regular Expressions. I want to do the following:

: I want to match (for example) "Cake" or "Cookies" (insensitive) but both
: have NOT to be leaded by (also for example) "Apple". So that I will
: match "Plumcake","Plumcookies", only "Cake",only "Cookies" but not
: "Applecake" or "Applecookies".

: I tried
: /(Apple){0}(Cake|Cookies)/i
: but no way. Cake or Cookies are also found if they're leaded by Apple.

: Hope someone can help me.


   You want a "negative lookbehind assertion" then, as described
   in 'perlre.pod'. 


      if ( /(?<!Apple)(Cake|Cookies)/i )
         { print "matched '$_'\n" }
      else
         { print "NO match for '$_'\n" }


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


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

Date: Tue, 01 Jun 1999 15:41:00 -0400
From: Doug Seay <dms@rtp-bosch.com>
Subject: Re: Re Better than Perl
Message-Id: <3754374C.88ED07F6@rtp-bosch.com>

John Q Public wrote:
> 
> We are doing a service to the Unix community.

That remains to be seen.  From your posting, I remain doubtful.

> Unicon and Icon are free, we stand to make no profit by them.  We are taking our precious time to notify Unix users of a fantastic and little-known tool which can eliminate their Perly worries.  Posting to 4 Unix groups without any profit motive does not qualify as spam, kid.

That depends on how you define spam.  I stick with the simple "willfully
off-topic == spam", although many people require the BI >= 20 or some
sort of commercial content for a post to be spam.

I don't care how much you do/don't make off of this uber-tool.  The
money stuff is a non-issue with me.

> In fact our major discovery is that the Unix related newsgroups are heavily censored, in general, by people whose fat petards sit in plush sysadmin seats where their pay is tied to knowledge of esoteric script languages that should be replaced with modern software technology.  The more newsgroups hear about Unicon, the better.

Say what?  How do sysadmin's censor newsgroups?  I would like to see
some of your "major discovery" so I protect myself from the evil folks
with "fat petards".  They sound dangerous.  I'd like to see what the
Government is doing to protect me from them.

> The only ID you will get is that we are not the authors of Unicon nor their representatives.

That changes what?  You are one of the most blatant "anonymous
coward"[*] types that I've seen in a while.

> We hope other anonymous newsgroup posters will provide links to other interesting and useful tools like Unicon.  We certainly thank the team of programmers that notified us about Unicon.

And if they do so on comp.lang.perl.misc, they'll be off-topic, and I'll
consider those posts to be spam.

[*] AC is a term from /. which you should visit often if you plan on
saving the Unix community from those "fat petards" in the comfy chairs.

- doug

PS: You come across sounding paranoid.


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

Date: Thu, 3 Jun 1999 15:26:24 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: stupid ISP?
Message-Id: <7j5vt2$n5v$1@zonnetje.NL.net>

hiya

 i just mailed my isp for the 2853-th time , and finally they replied ...

 i wanted a copy of the perl logs , but they said that perl doesn't make
logs! , is this true , or should i be flaming there asses off right now?

 cul8r
 buZz




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

Date: Thu, 03 Jun 1999 08:46:29 -0500
From: "M. S. Scott" <mikescot@americasm01.nt.com>
Subject: Test
Message-Id: <37568734.2F8FDD5@americasm01.nt.com>

Perl monger wanna-be




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

Date: Thu, 03 Jun 1999 21:45:45 -0400
From: dana <dana@nowhere.com>
Subject: Thanks! Re: multi-dimensional arrays
Message-Id: <37572FC9.96C09468@nowhere.com>

Thank you VERY much to both Greg and Colin.  You know something? . . . I think
that this newsgroup has become significantly more friendly within the past 2
years.  Wasn't too long ago that all I would get would be one line responses
(e.g., "check the FAQ") and sarcastic comments.

Anyway . . . thanks!

-Diana

Greg Bacon wrote:

> In article <37563EF2.DD6B2E17@nowhere.com>,
>         dana <dana@nowhere.com> writes:
> : Okay, so how do we do this with perl?  I haven't quite gotten the hang
> : of KEYS so I am hoping that this isn't the direction that I have to go.
> : My problem is basically that I have an undetermined number of text
> : variables with a number associated with each text variable.  For
> : example,
> :
> : text0  = 22
> : text1  = 34
> : text2  = 38
> : text3  = 21
> : text4  = 98
> : text5  = 42
> : .
> : .
> : and so on . . .
>
> Here's a simple version:
>
>     my @text;
>     while (<>) {
>         chomp;
>
>         next unless /^text(\d+)\s*=\s*(\d+)/;
>
>         $text[$1] = $2;
>     }
>
> I say simple because if you have a repeated item (say, two text0 items),
> you'll lose the previous.
>
> : How do I store this info in an array (or something similar)?  I will
> : never know what "textX" will be and I will never know how many I will
> : have.  Any help on this topic would be greatly appreciated.
>
> Here's a slightly more advanced version:
>
>     my @text;
>     while (<>) {
>         chomp;
>
>         next unless /^text(\d+)\s*=\s*(\d+)/;
>
>         push @{ $text[$1] }, $2;
>     }
>
> If you had input like
>
>     text0 = 22
>     text0 = 42
>
> then $text[0] would be a reference to an array containing 22 and 42.
>
> I'm just glad you don't want to use text0 et alia as variable names. :-)
>
> Hope this helps,
> Greg
> --
> Be warned that being an expert is more than understanding how a system is
> supposed to work.  Expertise is gained by investigating why a system doesn't
> work.
>     -- Brian Redman



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

Date: Thu, 03 Jun 1999 09:33:06 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: The artistic license and perl:
Message-Id: <37568412.51E97B40@xli.com>

Tom Christiansen wrote:
> 
> Whyever would you want to hurt Perl by infecting it with infinitely
> reaching strings of the notorious GPV?  That would merely reduce its
> freedom and restrict people from using it.  What a terrible idea!
> 
> --tom
> --
>     "I just hope I'm never promoted to the level of my incontinence."
>         --Larry Wall

I didn't say the Artistic license should  be replaced with the Gnu
pulblic
licence. I think that the artistic license may have problems with it
that
could be alleviated by either fixing the license, or going to a new
license.

my gut tells me that the artistic license is sufficiently enough of
a mess that either 1) companies who support open source wont get
into Perl stuff because of a bad license, or 2) companies who do NOT
support open source will try to use the AL to make a proprietary
fork in Perl. (or worse, BOTH).

What I would like to see are companies with a model similar to
Red Hat or Netscape, except their focus is Perl, and they 
add functionality to Perl, and return it to the open source
community. I think the AL is preventing that from happening.


Greg


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

Date: Thu, 03 Jun 1999 14:49:20 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: The artistic license and perl:
Message-Id: <pudge-0306991049240001@192.168.0.77>

In article <37568412.51E97B40@xli.com>, Greg Bartels <gbartels@xli.com> wrote:

# my gut tells me that the artistic license is sufficiently enough of
# a mess that either 1) companies who support open source wont get
# into Perl stuff because of a bad license, or 2) companies who do NOT
# support open source will try to use the AL to make a proprietary
# fork in Perl. (or worse, BOTH).

If they are illogically paranoid about the AL, they can use the GNU GPL.

If they make a proprietary version of perl and distribute it, they are
probably going to break the terms of the license.  But as long as they
change the name of it to something else, I don't really care.  Make your
proprietary version.  Be a loser.  Have everyone think you are lame.  Go
for it.

# What I would like to see are companies with a model similar to
# Red Hat or Netscape, except their focus is Perl, and they 
# add functionality to Perl, and return it to the open source
# community. I think the AL is preventing that from happening.

Nonsense.  Can you give one example of how this is happening, or how it
reasonably could happen?  Like I said, they could always use Perl under
the GNU GPL (which is what Linux is under, as are most of the components
Linux distributions ship with), and you can distribute your own code under
any license you want.  The AL cannot reasonably be a barrier for use of
Perl, because it is completely optional.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 3 Jun 1999 05:57:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Time Error
Message-Id: <MPG.11c01b81e057cc9c989b5b@nntp.hpl.hp.com>

In article <7j1qos$4g5$1@nnrp1.deja.com> on Tue, 01 Jun 1999 23:35:56 
GMT, Howard Jow <ppith@my-deja.com> says...
 ...
>    You can use the
> following script if your box has the "date" command.
 ...
> $today = `date`;
> 
> $today =~ m/([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\
> s+([^\s+]+)\s+/;

It would be hard to do this less portably or more expensively (though 
someone here will rise to the challenge :-).

perldoc -f localtime 

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


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

Date: Tue, 01 Jun 1999 12:45:58 -0500
From: Arthur Haas <cs004@wg.waii.com>
Subject: Re: Time Error
Message-Id: <37541C56.644DEAAD@wg.waii.com>

Frank de Bot wrote:

> I've some little trouble with the time. Today it's 1 june . But my
> script thinks it's 2 june. It has the same problem with other dates at
> the start of each month. Here's the script I use. If you have a better
> one, I would love to hear from it.
>
>  ($sec,$min,$hour,$mday,$mon,$year,$wday) =
> (gmtime(time))[0,1,2,3,4,5,6];
>  @months = ('January','February','March','April','May','June',
>    'July','August','September','October','November','December');
>  @days =
> ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturdat');
>
>    if ($sec < 10)  { $sec = "0$sec"; }
>    if ($min < 10)  { $min = "0$min"; }
>    if ($hour < 10)  { $hour = "0$hour"; }
>    if ($mday <10) { $mday = "0$wday"; }

if ($mday < 10) {$mday = 0$mday;}

There's one bug.

>
>    if ($mon <10) { $mon = "0$mon"; }
>
> --
>                           \\\|///
>                         \\  - -  //
>                          (  @ @  )
> /----------------------oOOo-(_)-oOOo--------------------\
> |                                                       |
> |                                                       |
> | My Email:  debot@xs4all.nl                            |
> | Homepages: http://www.debot.nl/ppi/                   |
> |           http://www.searchy.net/                    |
> |                                                       |
> \-------------------------------Oooo--------------------/
>                         oooO    (   )
>                        (   )    ) /
>                        \ (     (_/
>                         \_)

--
###############################
# Art Haas
# (713) 689-2417
###############################





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

Date: 3 Jun 1999 09:54:05 -0500
From: knightrdr@nospam.com (SiKnight)
Subject: Re: Trying to make custom start page for users via cookie and perl.  Help please?
Message-Id: <375696ae.45654082@news1.newscene.com>

On 30 May 1999 11:21:48 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>On 28 May 1999 14:15:08 -0500 SiKnight wrote:
>> [SNIP]
>Oh thats a shame.  I think that you will probably want to ask in a group
>that is interested in such matters - comp.infosystems.www.authoring.cgi
>
>/J\
So, you're telling me that this group isn't interested in matters in
PERL?  Gee, I guess the name of the newsgroup is deceiving...

SiKnight



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

Date: 3 Jun 1999 14:29:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: two questions, pls help
Message-Id: <3756834f@newsread3.dircon.co.uk>

jbell@263.net wrote:
> Hi, all,
> 
> I have two newbie questions:
> 
> 1.
> under unix(not during compilation), how do I change the default @ISA
> library search paths?
> 

Er - I dont think you mean @ISA - which is an array containing the modules
which will be searched to provide any methods which are not availbale in
the current package ; but @INC which is an array of the locations of the
paths Perl will look at in order to find a Module file.

You might want to look at perlfaq7:

=head2 How do I keep my own module/library directory?



> 2.my perl  files can only run with the command "perl MyFile", how can I
> make MyFile itself an excutable(without "perl" in front of it)?
> 

Check out the perlrun manpage.


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: 3 Jun 1999 14:08:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: uninitialized value? what am i doing wrong?
Message-Id: <37567e56@newsread3.dircon.co.uk>

Bastiaan S van den Berg <office@asc.nl> wrote:
> Use of uninitialized value at verwerk.cgi line 99.
> Use of uninitialized value at verwerk.cgi line 100.
> Use of uninitialized value at verwerk.cgi line 101.
> 
> 
> that's all i get back from my majorly simple perl program
> 
> i 'initialize' the scalars with :
> 
> $prijslijst_ap=$forms{"prijslijst_ap"};
> $prijslijst_dell=$forms{"prijslijst_dell"};
> $prijslijst_hp=$forms{"prijslijst_hp"};
> $prijslijst_fp=$forms{"prijslijst_fp"};
> 
> and then i use them with :
> 
> if ($prijslijst_ap ne "") {print "Ik wil een prijslijst van Account
> Plus\n";}
> if ($prijslijst_dell ne "") {print "Ik wil een prijslijst van Dell\n";}
> if ($prijslijst_hp ne "") {print "Ik wil een prijslijst van Hewlett
> Packard\n";}
> if ($prijslijst_fp ne "") {print "Ik wil een prijslijst van F-Prot\n";}
> 
> but then i get the errors you see at the top ..
> 
> does anyone have an idea what i'm doing wrong?
> 

No because we dont know or if any values got into your hash $forms -
judging by the name from some CGI parsing routine right ?  Why dont you
print out what you have in your variables to see if the they do indeed have
something in them.

If you just want to get rid of the warning where you know that the hash
keys might not have been defined then you can either use 'defined' or
you can do something like :

$prijslijst_ap=$forms{"prijslijst_ap"} || '';

But you cant avoid reading the documentation - saying that you dont like it
will do you no good whatsoever - you can always set about arranging a
translation.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

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

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