[13677] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1087 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 15 17:16:03 1999

Date: Fri, 15 Oct 1999 14:15:38 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <940022137-v9-i1087@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Oct 1999     Volume: 9 Number: 1087

Today's topics:
        newbie syntax help (Kristjan Varnik)
    Re: newbie syntax help (Brett W. McCoy)
    Re: newbie syntax help <uri@sysarch.com>
    Re: newbie syntax help <msalter@bestweb.net>
        panic:  leave_scope inconsistency <mayers@psi.com>
    Re: panic:  leave_scope inconsistency <laurensmith@sprynet.com>
    Re: Perl and Excel <marcel.grunauer@lovely.net>
        Perl/ODBC Advice <maloneyd@bms.com>
        Perl <sombra@roadrunner.com>
    Re: Perl <dcarroll@austin.rr.com>
    Re: Perl (Craig Berry)
    Re: Perl <laurensmith@sprynet.com>
    Re: Perl <webmaster@webdream.com>
    Re: Perl4->Perl5 Migration <rootbeer@redcat.com>
    Re: problems with date::manip <inna@raykhman.com>
    Re: QMAIL AND PERL (Larry Rosler)
        rasterizing text script? (Steve Siegel)
    Re: References to a list <ftidev@fhb.clickcharge.com>
    Re: References to a list (Abigail)
        Running Perl script locally on a win98 machine <martinc@propage.qc.ca>
    Re: Running Perl script locally on a win98 machine <newsposter@cthulhu.demon.nl>
    Re: Running Perl script locally on a win98 machine (Brett W. McCoy)
    Re: Server Side Fonts <marcel.grunauer@lovely.net>
    Re: Setuid script using Net::FTP <rootbeer@redcat.com>
        Substituting Only Within Matched Substring <monty@primenet.com>
        test <jhg@acm.org>
        THANKS FOR ALL THE HELP <mark@compumix.com>
    Re: Time in $time (Craig Berry)
    Re: tr// question (Eric Dew)
    Re: What does $| = 1 mean? <aqumsieh@matrox.com>
    Re: What is best..? (Michael Budash)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 15 Oct 1999 19:16:31 GMT
From: kav200@omicron.acf.nyu.edu (Kristjan Varnik)
Subject: newbie syntax help
Message-Id: <j4LN3.31$l66.2450@typhoon.nyu.edu>


I am trying to run this piece of code but I keep getting
an error I don't understand.

Argument "filename.jpg" isn't numeric in eq at myftp.pl line 106.

Please explain why I get that error and how to fix it...

#slightly modified code
sub foo {
    opendir (DIR, './jpgs') || die "opendir - $!\n";
    my @dir= readdir(DIR);
    $name="mom.jpg";
    foreach $list (@dir) {
	if ($list ==$name) {      #line106
            $status=1;
	};
    };
};


thank you


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

Date: Fri, 15 Oct 1999 19:20:29 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: newbie syntax help
Message-Id: <slrn80evs1.6hl.bmccoy@moebius.foiservices.com>

Also Sprach Kristjan Varnik <kav200@omicron.acf.nyu.edu>:

>I am trying to run this piece of code but I keep getting
>an error I don't understand.
>
>Argument "filename.jpg" isn't numeric in eq at myftp.pl line 106.
>
>Please explain why I get that error and how to fix it...
>
>#slightly modified code
>sub foo {
>    opendir (DIR, './jpgs') || die "opendir - $!\n";
>    my @dir= readdir(DIR);
>    $name="mom.jpg";
>    foreach $list (@dir) {
>	if ($list ==$name) {      #line106
>            $status=1;
>	};
>    };
>};

If you're comparing two strings (which is what you appear to be doing
here), you have to use 'eq', not '==', which is for numerical variables
only.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: 15 Oct 1999 15:25:47 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: newbie syntax help
Message-Id: <x7u2nsh1dw.fsf@home.sysarch.com>

>>>>> "KV" == Kristjan Varnik <kav200@omicron.acf.nyu.edu> writes:

  KV> Argument "filename.jpg" isn't numeric in eq at myftp.pl line 106.

  KV>     $name="mom.jpg";

  KV> 	if ($list ==$name) {      #line106
                  ^^

read perlop. perl has different equality tests for string and numbers.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 15 Oct 1999 20:02:34 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: newbie syntax help
Message-Id: <Pine.BSF.4.05.9910151556250.7079-100000@monet.bestweb.net>

On Fri, 15 Oct 1999, Kristjan Varnik wrote:

KV>Date: Fri, 15 Oct 1999 19:16:31 GMT
KV>From: Kristjan Varnik <kav200@omicron.acf.nyu.edu>

KV>I am trying to run this piece of code but I keep getting
KV>an error I don't understand.
KV>
KV>Argument "filename.jpg" isn't numeric in eq at myftp.pl line 106.

KV>	if ($list ==$name) {      #line106

I'll give you a hint, the following two lines do not do the same thing:

  if ($list == $name) {
  if ($list eq $name) {

run 'perldoc perlop' and lookup equity operators.




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

Date: Fri, 15 Oct 1999 14:17:30 -0400
From: "Mayer, Shane" <mayers@psi.com>
Subject: panic:  leave_scope inconsistency
Message-Id: <38076FBA.2C24C0AA@psi.com>

A cron job I have written (perl 5.00401) occasionally dies with the
error message:

panic:  leave_scope inconsistency

The camel is kind of vague in regards to this error, and none of the
previous posts to this newsgroup asking about this error have any
responses.
Does anyone have any experience with this error ( i.e. what caused the
error and how it was fixed )?
I'm just looking for some insight on where to start looking for the
cause of this problem.

Thanks,
Shane Mayer



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

Date: Fri, 15 Oct 1999 11:54:52 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: panic:  leave_scope inconsistency
Message-Id: <7u7ta9$cns$1@brokaw.wa.com>


Mayer, Shane wrote in message <38076FBA.2C24C0AA@psi.com>...
>A cron job I have written (perl 5.00401) occasionally dies with the
>error message:
>
>panic:  leave_scope inconsistency
Excerpted from perldiag:
==
These messages are classified as follows (listed in increasing order of
desperation):

    (W) A warning (optional).
    (D) A deprecation (optional).
    (S) A severe warning (mandatory).
    (F) A fatal error (trappable).
    (P) An internal error you should never see (trappable).
    (X) A very fatal error (nontrappable).
    (A) An alien error message (not generated by Perl).
 ...
panic: leave_scope inconsistency
(P) The savestack probably got out of sync. At least, there was an
invalid enum on the top of it.
==

Since the documentation says that you should never see this error, I
will assume you are lying.

No, of course not.  :-)  Are you running with -w and 'use strict'
enabled?

Lauren




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

Date: Fri, 15 Oct 1999 19:38:43 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Perl and Excel
Message-Id: <qZAHOLZpOLNTxFZPuGjqpqIJVmzB@4ax.com>

On Fri, 15 Oct 1999 10:23:32 -0700, "Gala Grant" <gala@sonic.net>
wrote:

> I need to use Perl to open an Excel Spreadsheet and pull out info, and then
> dynamically create a web page based on the pulled info.  Does anyone have
> any info on using Perl to manipulate Excel?  Is there a module or any text
> about it somewhere?

perldoc Win32::OLE


-- 
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;


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

Date: Fri, 15 Oct 1999 18:50:17 +0000
From: "Daniel P. Maloney" <maloneyd@bms.com>
Subject: Perl/ODBC Advice
Message-Id: <38077769.80E19F5A@bms.com>

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

I have a file that is used by a lab instrument to store setup
parameters. The instrument vendor tells me that it's an ODBC compliant
database table. I need a list of assay names from the table, and they
tell me that the fields I need are called ASSAYNAME and ASSAYCODE. They
also say that they use Paradox as the underlying format.

My questions - what's the "right way" to do this in Perl? I looked at
the docs for DBD::ODBC and DBI, but I think I'm missing something. Do I
need an ODBC driver for Linux? Should I just bag it all and parse the
table as a binary file and hope for the best? Any tips appreciated..

Dan Maloney
--------------EDC04AAC34EC024410D30A67
Content-Type: text/x-vcard; charset=us-ascii;
 name="maloneyd.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Daniel P. Maloney
Content-Disposition: attachment;
 filename="maloneyd.vcf"

begin:vcard 
n:Maloney;Daniel
tel;pager:860 473-3645
tel;cell:203 410-1304
tel;fax:203 677-6417
tel;home:as if...
tel;work:203 677-7135
x-mozilla-html:TRUE
url:http://hollywood.wfd.pri.bms.com
org:Bristol-Myers Squibb Co.
version:2.1
email;internet:maloneyd@bms.com
title:Research Automation Engineer
note:Opinions expressed are mine alone...
adr;quoted-printable:;;5 Research Parkway=0D=0ADept. 114;Wallingford;CT;06492;USA
x-mozilla-cpt:;-11296
fn:Maloney, Daniel
end:vcard

--------------EDC04AAC34EC024410D30A67--



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

Date: Fri, 15 Oct 1999 18:08:10 GMT
From: berna <sombra@roadrunner.com>
Subject: Perl
Message-Id: <s0ercajnr0175@corp.supernews.com>

I need to run perl on my Win98 system.  Can you send me an executable on cd 
?
Can I run perl without running linux?  Does the winLinux2000 final beta 
work well?

Please help!

Thank you

------------------  Posted via CNET Help.com  ------------------
                      http://www.help.com/


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

Date: Fri, 15 Oct 1999 18:30:58 GMT
From: Don Carroll <dcarroll@austin.rr.com>
Subject: Re: Perl
Message-Id: <380772E1.95066A8B@austin.rr.com>

We run it under NT at work , did you look on winfiles.com

berna wrote:

> I need to run perl on my Win98 system.  Can you send me an executable on cd
> ?
> Can I run perl without running linux?  Does the winLinux2000 final beta
> work well?
>
> Please help!
>
> Thank you
>
> ------------------  Posted via CNET Help.com  ------------------
>                       http://www.help.com/



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

Date: Fri, 15 Oct 1999 18:46:45 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl
Message-Id: <s0etklthr0149@corp.supernews.com>

berna (sombra@roadrunner.com) wrote:
: I need to run perl on my Win98 system.  Can you send me an executable
: on cd?

I can't, but there are books with supplemental CDs which have a Windows
port of Perl on them.  Even better, you can download it for free; visit
<http://www.perl.com/pub/language/info/software.html#win32>.

: Can I run perl without running linux?

Sure.  There are those who would put this question in the "Can I hit
myself repeatedly on the head with a large mallet?" category, however. :) 

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: Fri, 15 Oct 1999 11:59:09 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Perl
Message-Id: <7u7tia$ap9$1@brokaw.wa.com>


berna wrote in message ...
>I need to run perl on my Win98 system.
Cool.

>  Can you send me an executable on cd ?
I'm not sure what you'd do with a hello world executable.  But then
again, I can't mail that either, you haven't specified an address.

>Can I run perl without running linux?
Yes, definitely.

>  Does the winLinux2000 final beta work well?
Even if I knew what in the world winLinux2000 final beta was, I'd still
proclaim this to be off-topic in this newsgroup.

>Please help!

www.activestate.com

>Thank you
You're welcome.

Lauren




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

Date: Fri, 15 Oct 1999 20:39:57 GMT
From: "Craig Vincent" <webmaster@webdream.com>
Subject: Re: Perl
Message-Id: <xiMN3.276$cF.492@198.235.216.4>

> I need to run perl on my Win98 system.  Can you send me an executable on
cd

Have you looked at activestate.com?  They supply a windows 95/98/NT port of
perl.
http://www.activestate.com/ActivePerl/download.htm

Sincerely,

Craig Vincent




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

Date: Fri, 15 Oct 1999 13:53:03 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl4->Perl5 Migration
Message-Id: <Pine.GSO.4.10.9910151352340.25558-100000@user2.teleport.com>

On Thu, 14 Oct 1999, Daniel W. Burke wrote:

> Subject: Perl4->Perl5 Migration

> I'm curious to hear anyone elses comments/experiences in
> doing the same thing, i.e. things to watch out for, or very
> good resources to check out.

In addition to perltrap?

Cheers!

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



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

Date: Fri, 15 Oct 1999 19:39:33 -0400
From: inna raykhman <inna@raykhman.com>
Subject: Re: problems with date::manip
Message-Id: <38079105.A54B2FCE@raykhman.com>




> i am trying to use date::manip in my cgi/perl script.
> i do the following:
> my $end_dt=&UnixDate("today", "%m/%d/%Y 17:00");
> $start_dt = &Date_PrevWorkDay($end_dt, 1);
>
> and i get: "ERROR: Invalid year", even though the $start_dt="10/14/1999
> 17:00".

thanks to everyone, i found the problem.  i was using an older version of
Date::Manip - 5.30.  and the UnixDate() was returning "10/14/1999 17:0" and
that was screwing up every other date function that took that as input.  i
changed that to manually add "17:00" and it works fine now.

inna



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

Date: Fri, 15 Oct 1999 12:30:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: QMAIL AND PERL
Message-Id: <MPG.1271209cbd02756f98a099@nntp.hpl.hp.com>

In article <8lIN3.720$25.31646@nntp1> on Fri, 15 Oct 1999 12:09:39 -
0400, Dave Kaufman <david@gigawatt.com> says...
> Chris Burton <Chris@fatlarry.karoo.co.uk> wrote...
> > ... i can't get the perl
> > programme to write the RECIPIENT variable to a file called email
> >
> > open (emailfile,">>email");
> 
> first, you should be checking the return value from open() to see if it
> failed, for instance:
> 
> open (emailfile,">>email") or die "error opening emailfile: $!";
> # $! will contain the last O/S error such as "permission denied" etc...
> 
> > print emaiilfile $ENV{'RECEIPIENT'};
> 
> might be a cut-and-paste error, but you've misspelled RECIPIENT in that
> line...

Also, if you use the '-w' flag (and if you don't, why not?), you will be 
warned about using all lower-case letters for a filehandle.  The 
convention is to use all upper-case letters.

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


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

Date: Fri, 15 Oct 1999 20:09:59 GMT
From: stevesny@ibm.net (Steve Siegel)
Subject: rasterizing text script?
Message-Id: <380789b7.10401142@news1.ibm.net>

Anyone know of a script -- or has any ieas -- regarding taking a list of text items
and rasterizing them?

Thanks,

Steve

PS - an email reply would be appreciated


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

Date: Fri, 15 Oct 1999 14:33:19 -0400
From: Patrick Sweeney <ftidev@fhb.clickcharge.com>
Subject: Re: References to a list
Message-Id: <3807736F.5FEB9A2@fhb.clickcharge.com>

Thanks for the reply.  I had forgotten that references can be created
without the backslash operator.





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

Date: 15 Oct 1999 15:45:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: References to a list
Message-Id: <slrn80f4io.q8s.abigail@alexandra.delanet.com>

Patrick Sweeney (ftidev@fhb.clickcharge.com) wrote on MMCCXXXVI September
MCMXCIII in <URL:news:380764DB.146F3962@fhb.clickcharge.com>:
## Is this the best way of getting a reference to a list?

Hack the sources of Perl, as currently, you cannot take a reference
of a list.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== 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: Fri, 15 Oct 1999 13:46:14 -0400
From: Martin Cloutier <martinc@propage.qc.ca>
Subject: Running Perl script locally on a win98 machine
Message-Id: <38076866.548767B@propage.qc.ca>

I am trying to run my scripts Locally on my win 98 machine using
Netscapo or Explorer as the user interface.
and cannot seem to make it work.
I am calling the CGI scrip from a form, but am not getting an answer
from the Script (although the script works well on the internet.

can anyone steer me in the right direction

Martin Cloutier



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

Date: 15 Oct 1999 18:46:09 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Running Perl script locally on a win98 machine
Message-Id: <7u7sph$qmd$2@internal-news.uu.net>

Martin Cloutier <martinc@propage.qc.ca> wrote:
> I am trying to run my scripts Locally on my win 98 machine using
> Netscapo or Explorer as the user interface.
> and cannot seem to make it work.
> I am calling the CGI scrip from a form, but am not getting an answer
> from the Script (although the script works well on the internet.

  Just for the record, you did install a web server, right? Check it's
error log and see what's there. If you need help configuring a webserver
you probably should ask in a newsgroup devoted to webservers. (sorry,
can't remember one at the moment).

Erik



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

Date: Fri, 15 Oct 1999 18:53:29 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Running Perl script locally on a win98 machine
Message-Id: <slrn80eu9c.6hl.bmccoy@moebius.foiservices.com>

Also Sprach Martin Cloutier <martinc@propage.qc.ca>:

>I am trying to run my scripts Locally on my win 98 machine using
>Netscapo or Explorer as the user interface.
>and cannot seem to make it work.
>I am calling the CGI scrip from a form, but am not getting an answer
>from the Script (although the script works well on the internet.
>
>can anyone steer me in the right direction

Are you running the CGI script through a web server?  They won't
necessarily work just by opening the file up locally with a browser.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: Fri, 15 Oct 1999 19:43:28 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Server Side Fonts
Message-Id: <c5EHONEJyHA0rcigTy161It6GuH0@4ax.com>

On Thu, 14 Oct 1999 21:00:06 GMT, "Moyer Family"
<moyerfamily@kscable.com> wrote:

> Is there any way to display a font that the user doesn't have, but you have
> the file on your site?  If not in Perl with CGIs, does anyone that knows
> JavaScript also(as I do) know it can be done there.

I suppose the same way you display a page that's not originating on
the user's machine: within the confines of HTML and HTTP.

Try asking in some server- or Javascript-related group.

> Please email the
> response to
> bozodaclown2001@hotmail.com, because I don't check this Newsgroup very
> often!  Thanks,    Keith.

Tough. Usenet isn't write-only.


-- 
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;


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

Date: Fri, 15 Oct 1999 14:03:19 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Setuid script using Net::FTP
Message-Id: <Pine.GSO.4.10.9910151356430.25558-100000@user2.teleport.com>

On Fri, 15 Oct 1999, Lars Erik wrote:

> I'm writing a script that scans some ftp servers and lists their
> files. To do this I had to use icmp ping, 

Not to be contrary, but maybe you didn't _have_ to use that. You could
simply try to make the connection - after all, a site may have an FTP
server but not be pingable. For example, ftp.microsoft.com.

> and therefore also had to use a setuid wrapper to make it work.

Or maybe you could have made your perl script setuid, if your kernel (or
perl binary) supports that.

> However, it seems like Net::FTP doesn't like this setuid thing,
> because everything hangs when I try to make a new ftp object.

Sounds like a bug in Net::FTP or one of the underlying modules....

> The messages I get in my error log are:
> Odd number of elements in hash assignment at
> /usr/lib/perl5/site_perl/5.005/Net/FTP.pm line 47.

 ...or maybe in the way someone is calling it? That line is part of new() -
I'd guess that someone is calling new() with the wrong number of args. You
may be able to step up to that point in the debugger to see who's doing
that. To use the debugger when set-id, you'll have to put the -d option on
the #! line.

Good luck!

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



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

Date: 15 Oct 1999 17:33:21 GMT
From: Jim Monty <monty@primenet.com>
Subject: Substituting Only Within Matched Substring
Message-Id: <7u7oh1$ddb$1@nnrp02.primenet.com>

There's gotta be a better way to do this:

    if (/^(\S+\s+)(\S.*  .*)/s) {
        ($label, $value) = ($1, $2);
        $value =~ s/  +/ /g;
        $_ = $label . $value;
    }

What is it?

(I want to get rid of the use of variables.)

-- 
Jim Monty
monty@primenet.com
Tempe, Arizona USA


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

Date: Fri, 15 Oct 1999 21:04:08 GMT
From: Jim Garrison <jhg@acm.org>
Subject: test
Message-Id: <380796D0.461570DB@acm.org>


-- 
Jim Garrison (jhg@acm.org) PGP Keys: RSA 0x04B73B7F DH 0x70738D88


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

Date: Fri, 15 Oct 1999 21:15:30 +0200
From: Mark Bakker <mark@compumix.com>
Subject: THANKS FOR ALL THE HELP
Message-Id: <38077D52.3A88D30F@compumix.com>

Thank You All!

Mark Bakker wrote:

> I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
> how do I do this? I can't Use print "%04d-%02d etc... because I do not print
> this string but I have to put It in a MySQL database...
>
> Please help..

With kind regards, Mark Bakker

Mark Bakker



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

Date: Fri, 15 Oct 1999 18:49:33 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Time in $time
Message-Id: <s0etpt15r0175@corp.supernews.com>

Uri Guttman (uri@sysarch.com) wrote:
: >>>>> "CB" == Craig Berry <cberry@cinenet.net> writes:
: 
:   CB>   my $timestr = strftime '%Y-%m-%d %H:%M:%S', localtime;
: 
: golf, anyone?
: 
: strftime '%Y-%m-%d %T', localtime;

Cool, thanks, hadn't noticed that very useful formatting token.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: 15 Oct 1999 20:23:14 GMT
From: edew@netcom.com (Eric Dew)
Subject: Re: tr// question
Message-Id: <7u82fi$o77$1@nntp3.atl.mindspring.net>

In article <7u5m2j$m74$1@hops.adnc.com>, Dan Berman <dan.berman@ubl.com> wrote:
>i want to replace every instance of ".gif" with "_t.gif"
>im not sure where i need to put backslashes or anything to get the syntax
>right. i tried
>$thumb =~ tr/\.gif/_t\.gif/; but that changed "image.gif" to ".mate_t.g" all
>help appreciated. thanks
>
>
I don't think tr(anslate) is the right choice.  Maybe s(ubstitute) is
better.  Maybe $thumb =~ s|\.gif|_t\.gif| would work.

EDEW



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

Date: Fri, 15 Oct 1999 14:31:54 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: What does $| = 1 mean?
Message-Id: <x3y670879wm.fsf@tigre.matrox.com>


Nanda <kilminjaro@hotmail.com> writes:

> 
> Hello Everyone,
> 
>  I am modifying a perl script written by somebody else. It is written
> for HP-UX systems. One of the lines at the top of the script is $| = 1
> and the comment after it says 'Turn line blocking off'
> 
>  I dont know what it means. Can somebody explain it a little bit. What
> would happen if this line was removed?

From perlvar:
     $|      If set to nonzero, forces a flush right away and
             after every write or print on the currently selected
             output channel.  Default is 0 (regardless of whether
             the channel is actually buffered by the system or
             not; $| tells you only whether you've asked Perl
             explicitly to flush after each write).  Note that
             STDOUT will typically be line buffered if output is
             to the terminal and block buffered otherwise.
             Setting this variable is useful primarily when you
             are outputting to a pipe, such as when you are
             running a Perl script under rsh and want to see the
             output as it's happening.  This has no effect on
             input buffering.  (Mnemonic: when you want your
             pipes to be piping hot.)

--Ala



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

Date: Fri, 15 Oct 1999 11:03:19 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: What is best..?
Message-Id: <mbudash-1510991103200001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <380768BA.487C1C4F@bigfoot.com>, Mat Tillett
<u2orange@bigfoot.com> wrote:

>Hi,
>
>        I am in thought of writing a cgi script that allow users to multiselect
>items from an online database.  Now to store their selected choices I
>could either write a file out to the server by using their IP number and
>storing the data within that file or I could do it as a cookie.  What is
>best..? >

sounds like a shopping cart to me...

IMHO:

if you're trying to establish some kind of 'session' paradigm (where
multiple web pages will be displayed and acted upon before the 'selected
choices' are processed), then don't use the file-named-IP-address idea.
some isp's use a proxy setup that could effectively assign a different IP
address each time a single surfer initiates a request (clicks a link,
clicks a button, etc.), thereby losing the identity of the user. if you're
going to write a file, come up with a unique session id (that a whole
other discussion) and pass it along with every request as a hidden form
field or part of a query_string.

you can also use cookies if they're turned on, and fall back to files if
they're not. i did that on a recent commerce site with good results.

hth-

> Please bear in mind that if I write a file to the server, I
>have then got to figure out when they have left the site (abnormaly) how
>to check and remove the file immediately.

why immediately? will you elaborate?
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 1087
**************************************


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