[11353] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4953 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 21 02:07:29 1999

Date: Sat, 20 Feb 99 23:00:23 -0800
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, 20 Feb 1999     Volume: 8 Number: 4953

Today's topics:
    Re: can I run perl on Win 98?????? t_alter@hotmail.com
    Re: Database performance (Abigail)
    Re: DBD::Oracle, Apache DBI, mod_perl (Abigail)
    Re: Excel and perl <casfaq@locutus.ofB.ORG>
        FAQ 4.10: How do I find the week-of-the-year/day-of-the <perlfaq-suggestions@perl.com>
        FAQ 4.11: How can I compare two dates and find the diff <perlfaq-suggestions@perl.com>
        FAQ 4.5: Why doesn't & work the way I want it to?   <perlfaq-suggestions@perl.com>
        FAQ 4.6: How do I multiply matrices?   <perlfaq-suggestions@perl.com>
        FAQ 4.7: How do I perform an operation on a series of i <perlfaq-suggestions@perl.com>
        FAQ 4.8: How can I output Roman numerals?   <perlfaq-suggestions@perl.com>
        FAQ 4.9: Why aren't my random numbers random?   <perlfaq-suggestions@perl.com>
    Re: File Upload / Retaining File Name (Michael Smith)
    Re: FMTEYEWTK: Sorting <spamsux-tex@habit.com>
    Re: HELP w/ SOCKETS + PORTS!!! - NEW QUESTION HERE!! <support@mekagames.com>
        Oracle/perl warning (was: Re: DBD::Oracle question) ajs@ajs.com
        Perl for Beginners? <reeves@ata.attmil.ne.jp>
    Re: Perl for Beginners? (Dana Booth)
    Re: Perl script and Access 95 <vamp71@freemail.gr>
        Reading mailspool <tobin@uclink4.berkeley.edu>
        Redirecting STDIN from keyboard to a program. <gregj@uidaho.edu>
    Re: Redirecting STDIN from keyboard to a program. <tchrist@mox.perl.com>
    Re: Statistics for comp.lang.perl.misc (Abigail)
        Verifying username/password <tobin@sji.org>
    Re: y2k utility ^___^ <mpersico@erols.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 21 Feb 1999 04:04:18 GMT
From: t_alter@hotmail.com
Subject: Re: can I run perl on Win 98??????
Message-Id: <7ao0ju$1iq$1@nnrp1.dejanews.com>

Thanks to all of the wise guys ....
Actually it was my mistake. I really should have asked "HOW"!
Well I will give a try to activestate

Thanks again

Tom

In article <MPG.11381c7b8d67d832989a64@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> [Posted and a courtesy copy mailed.]
>
> In article <7alqde$9n0$1@nnrp1.dejanews.com> on Sat, 20 Feb 1999
> 08:06:09 GMT, t_alter@hotmail.com <t_alter@hotmail.com> says...
> > How? Plaese inform, time is running out.
> >
> > In article <36cdcb27.0@news.cgocable.net>,
> >   "Dave Mckeown" <davemck@cgocable.net> wrote:
> > > yes you can
> ...
> > > <t_alter@hotmail.com> wrote in message
> > > news:7akdfb$4p8$1@nnrp1.dejanews.com...
> > > >Hi everybody;
> > > >I am starting to learn perl. Can I do it with my Win98 PC?
> > > >I have been informed that I will have to go for Either UNIX or WinNT for
> > > that.
>
> Well, you asked 'Can I do it...', not 'How can I do it...', so some wise
> guys answered what you asked.  I think you are owed an apology and a
> straight answer.
>
> <URL:http://www.activestate.com/>
>
> Look for ActivePerl; download and install it.  I have found it to be
> very clean and neat, and trivial to install.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 21 Feb 1999 02:48:38 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Database performance
Message-Id: <7ans66$pdc$1@client2.news.psi.net>

Inc. (employment@owlscreech.com) wrote on MCMXCVII September MCMXCIII in
<URL:news:7ai8sa$179s@enews2.newsguy.com>:
&& Hi,
&& 
&&     For a database containing approximately 700,000 records,
&&     of the following which would be give the best performance
&&     using x86 Linux and a Perl interface?


Number of records is hardly relevant. It depends on what you do with it,
and how it's organized. I've seen application getting into problems
running queries on a table with 15,000 rows, while not having any
performance problems when dealing with another table with over 3,000,000
rows.

It's the operation and the structure that matters.




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


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

Date: 21 Feb 1999 05:21:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: DBD::Oracle, Apache DBI, mod_perl
Message-Id: <7ao551$qv1$1@client2.news.psi.net>

Al Funk (afunk@dailydrill.com) wrote on MM September MCMXCIII in
<URL:news:36CF86FA.670877ED@dailydrill.com>:
?? WXVwLCB0aGF0IHdhcyB0aGUgcHJvYmxlbS4uLiBJIGhhZCBjaGVja2VkIHRoZSBwZXJtaXNz
?? aW9ucyBmb3IgdGhlIGZpbGVzDQphbmQgdGhlaXIgaW1tZWRpYXRlIHBhcmVudCBkaXJlY3Rv
?? cnksIGJ1dCBvbmUgb2YgdGhlIHByZWRlY2Vzc29yDQpkaXJlY3RvcmllcyB3YXMgcnd4LS0t
?? LS0tLg0KDQpUaGFua3MgZm9yIHRoZSB0aXAuDQoNCi1BbA0KDQoNCiJLdWNlcmEsIFJpY2gi
?? IHdyb3RlOg0KDQo+IENoZWNrIHRoZSBwZXJtaXNzaW9ucy4uLm1ha2Ugc3VyZSB0aGV5J3Jl
?? IHJ3eHJ3eHJ3eCAodHJ5IHItLXItLXItLSkuDQo+IFdlYiBzZXJ2ZXJzIHJ1biB0aGVtc2Vs
?? dmVzIGFzIG5vYm9keS4uLg0KPg0KPiA+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+
?? ID4gRnJvbTogQWwgRnVuayBbU01UUDphZnVua0BkYWlseWRyaWxsLmNvbV0NCj4gPiAnL3Vz
?? ci9saWIvcGVybDUvc2l0ZV9wZXJsLzUuMDA1L2k2ODYtbGludXgvYXV0by9EQkQvT3JhY2xl
?? L09yYWNsZS5zbycNCj4gPiBmb3IgbW9kdWxlIERCRDo6T3JhY2xlOiBsaWJjbG50c2guc28u
?? MS4wOiBjYW5ub3Qgb3BlbiBzaGFyZWQgb2JqZWN0DQo+ID4gZmlsZTogTm8gc3VjaCBmaWxl
?? IG9yIGRpcmVjdG9yeSBhdA0KPiA+IC91c3IvbGliL3Blcmw1LzUuMDA1MDIvaTY4Ni1saW51
?? eC9EeW5hTG9hZGVyLnBtIGxpbmUgMTY5Lg0KPiA+DQo+ID4gVGhlIGZpbGUgT3JhY2xlLnNv
?? IGV4aXN0cy4NCj4gPg0KPiA+IEhvd2V2ZXIsIHJ1bm5pbmcgdGhlIHNhbWUgY29kZSBmcm9t
?? IHRoZSBjb21tYW5kIGxpbmUgZG9lcyBub3QgY2F1c2UNCj4gPiBhbnkNCj4gPiBwcm9ibGVt
?? LCBldmVuIHdpdGggdGhlIGlkZW50aWNhbCBlbnZpcm9ubWVudCB2YXJpYWJsZXMhDQo=

Can't locate object method "IEhvd2V2ZXIsIHJ1bm5pbmcgdGhlIHNhbWUgY29kZSBmcm9t"
via package 
"IHRoZSBjb21tYW5kIGxpbmUgZG9lcyBub3QgY2F1c2UNCj4gPiBhbnkNCj4gPiBwcm9ibGVt"



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


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

Date: Sun, 21 Feb 1999 00:27:14 -0500
From: Russell Schulz <casfaq@locutus.ofB.ORG>
Subject: Re: Excel and perl
Message-Id: <19990221.002714.0F8.rnr.w164w@locutus.ofB.ORG>

syarbrou@nospam.enteract.com (Steve .) writes:

> I have an excel spreadsheet that I want to extract the data from for
> manipulation.  Is there a way in perl to read an excel spreadsheet?

if you really CAN'T save the file in a publicly-documented format such
as tab-delimited, CSV, or SYLK, then check out the other links in the
comp.apps.spreadsheets FAQ:

The FAQ list for comp.apps.spreadsheets can be found on the Internet:
  <ftp://rtfm.mit.edu/pub/usenet/comp.apps.spreadsheets/faq>
  <http://www.faqs.org/faqs/spreadsheets/faq/>
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 20 Feb 1999 22:22:07 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.10: How do I find the week-of-the-year/day-of-the-year?  
Message-Id: <36cf97ff@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I find the week-of-the-year/day-of-the-year?

    The day of the year is in the array returned by localtime() (see the
    section on "localtime" in the perlfunc manpage):

        $day_of_year = (localtime(time()))[7];

    or more legibly (in 5.004 or higher):

        use Time::localtime;
        $day_of_year = localtime(time())->yday;

    You can find the week of the year by dividing this by 7:

        $week_of_year = int($day_of_year / 7);

    Of course, this believes that weeks start at zero. The Date::Calc module
    from CPAN has a lot of date calculation functions, including day of the
    year, week of the year, and so on. Note that not all businesses consider
    ``week 1'' to be the same; for example, American businesses often
    consider the first week with a Monday in it to be Work Week #1, despite
    ISO 8601, which considers WW1 to be the first week with a Thursday in
    it.

-- 
"Espousing the eponymous /cgi-bin/perl.exe?FMH.pl execution model is like 
reading a suicide note -- three days too late."
	    --Tom Christiansen <tchrist@mox.perl.com>


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

Date: 20 Feb 1999 23:22:09 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.11: How can I compare two dates and find the difference?  
Message-Id: <36cfa611@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How can I compare two dates and find the difference?

    If you're storing your dates as epoch seconds then simply subtract one
    from the other. If you've got a structured date (distinct year, day,
    month, hour, minute, seconds values) then use one of the Date::Manip and
    Date::Calc modules from CPAN.

-- 
    "It's okay to be wrong temporarily." --Larry Wall


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

Date: 20 Feb 1999 18:01:21 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.5: Why doesn't & work the way I want it to?  
Message-Id: <36cf5ae1@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  Why doesn't & work the way I want it to?

    The behavior of binary arithmetic operators depends on whether they're
    used on numbers or strings. The operators treat a string as a series of
    bits and work with that (the string `"3"' is the bit pattern
    `00110011'). The operators work with the binary form of a number (the
    number `3' is treated as the bit pattern `00000011').

    So, saying `11 & 3' performs the "and" operation on numbers (yielding
    `1'). Saying `"11" & "3"' performs the "and" operation on strings
    (yielding `"1"').

    Most problems with `&' and `|' arise because the programmer thinks they
    have a number but really it's a string. The rest arise because the
    programmer says:

        if ("\020\020" & "\101\101") {
            # ...
        }

    but a string consisting of two null bytes (the result of `"\020\020" &
    "\101\101"') is not a false value in Perl. You need:

        if ( ("\020\020" & "\101\101") !~ /[^\000]/) {
            # ...
        }

-- 
"A ship then new they built for him/of mithril and of elven glass" 
    --Larry Wall in perl.c from the v5.0 perl distribution,
	citing Bilbo from Tolkien's LOTR


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

Date: 20 Feb 1999 18:21:59 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.6: How do I multiply matrices?  
Message-Id: <36cf5fb7@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I multiply matrices?

    Use the Math::Matrix or Math::MatrixReal modules (available from CPAN)
    or the PDL extension (also available from CPAN).

-- 
I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has intended us to forgo their use.
                --Galileo Galilei


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

Date: 20 Feb 1999 19:22:01 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.7: How do I perform an operation on a series of integers?  
Message-Id: <36cf6dc9@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I perform an operation on a series of integers?

    To call a function on each element in an array, and collect the results,
    use:

        @results = map { my_func($_) } @array;

    For example:

        @triple = map { 3 * $_ } @single;

    To call a function on each element of an array, but ignore the results:

        foreach $iterator (@array) {
            some_func($iterator);
        }

    To call a function on each integer in a (small) range, you can use:

        @results = map { some_func($_) } (5 .. 25);

    but you should be aware that the `..' operator creates an array of all
    integers in the range. This can take a lot of memory for large ranges.
    Instead use:

        @results = ();
        for ($i=5; $i < 500_005; $i++) {
            push(@results, some_func($i));
        }

-- 
    If I allowed "next $label" then I'd also have to allow "goto $label",
    and I don't think you really want that...  :-) [now works in perl5!]
            --Larry Wall in <1991Mar11.230002.27271@jpl-devvax.jpl.nasa.gov>


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

Date: 20 Feb 1999 20:22:03 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.8: How can I output Roman numerals?  
Message-Id: <36cf7bdb@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  How can I output Roman numerals?

    Get the http://www.perl.com/CPAN/modules/by-module/Roman module.

-- 
"I'd rather have :rofix than const."
	    --Dennis Ritchie


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

Date: 20 Feb 1999 21:22:06 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 4.9: Why aren't my random numbers random?  
Message-Id: <36cf89ee@csnews>

(This excerpt from perlfaq4 - Data Manipulation 
    ($Revision: 1.43 $, $Date: 1999/01/26 09:57:23 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq4.html
if your negligent system adminstrator has been remiss in his duties.)

  Why aren't my random numbers random?

    If you're using a version of Perl before 5.004, you must call `srand'
    once at the start of your program to seed the random number generator.
    5.004 and later automatically call `srand' at the beginning. Don't call
    `srand' more than once--you make your numbers less random, rather than
    more.

    Computers are good at being predictable and bad at being random (despite
    appearances caused by bugs in your programs :-).
    http://www.perl.com/CPAN/doc/FMTEYEWTK/random, courtesy of Tom Phoenix,
    talks more about this.. John von Neumann said, ``Anyone who attempts to
    generate random numbers by deterministic means is, of course, living in
    a state of sin.''

    If you want numbers that are more random than `rand' with `srand'
    provides, you should also check out the Math::TrulyRandom module from
    CPAN. It uses the imperfections in your system's timer to generate
    random numbers, but this takes quite a while. If you want a better
    pseudorandom generator than comes with your operating system, look at
    ``Numerical Recipes in C'' at http://www.nr.com/ .

-- 
#ifdef USE_STD_STDIO    /* Here is some breathtakingly efficient cheating */
    --Larry Wall, from sv.c in the v5.0 perl distribution


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

Date: 21 Feb 1999 06:27:07 GMT
From: smith@io.com (Michael Smith)
Subject: Re: File Upload / Retaining File Name
Message-Id: <slrn7cv9q3.50c.smith@schultz.io.com>

On Sat, 20 Feb 1999 12:30:18 -0500, Matt Melton
<mmelton@together.net> wrote:

>Using cgi-lib.pl and Steven Brenners fup.cgi, I am able to get the file to
>upload via a web browser to the correct directory, but the script renames
>the file.  I would like to be able to keep the original file name, though I
>don't know how to do this.  

Matt: After the print statement at about line 72 of that script, add
this line:

   rename "$cgi_sfn{'upfile'}","$cgi_lib::writefiles/$cgi_cfn{'upfile'}";

This should preserve the original filename used on the remote
machine. If it doesn't seem to work, though, try this line instead:

   rename "$cgi_data{'upfile'}","$cgi_lib::writefiles/$cgi_cfn{'upfile'}";

But, for what it's worth, I recommend (as Jonathan Stowe does in his
followup to you) that you try using the CGI.pm library instead. As
Jonathan points out, CGI.pm just makes things much easier.

Also, I think fup.cgi was intended as just a simple demonstration.
In one of the free script archives (like the CGI Resource Index
<http://www.cgi-resources.com>) you can probably find an upload
script you'll like better -- preferably one that uses CGI.pm (look
for "use CGI;" or "use CGI qw(:standard);" near the top).


Using CGI.pm and dealing with overwrites and security
-------------------------------------------------------------------
To show you the difference CGI.pm can make, here's how you can read
in name/value pairs from an upload form using it ('source' is the
original name of the file on the remote machine, and 'destination'
is specified in the HTML upload form).

      use CGI qw(:standard);
      $query = new CGI;
      $filename = $query->param('source');
      $path = $query->param('destination');

As far as security goes, here's something simple you can add no
matter which CGI library you're using (same variables as above).

      die if (!open(UPLOAD, ">$path\/$filename"));

And, once the file has actually been written to the server:

      chmod (0444, "$path\/$filename");

This will set read-only permissions on the file. With that and the
other line in place, you should be able to prevent most overwrites.

Also, it's a good idea to make sure that any file-upload script you
use actually checks the filename and path passed on from the remote
user/upload form. For example, you'll want the script to ensure that
$filename is actually a valid filename on your system, and that
$path isn't sending a file somewhere you don't want it to go.

The best general source of information on matters of security is the
section on CGI scripts in (CGI.pm author) Lincoln Stein's Web
security FAQ <http://www.w3.org/Security/Faq/>. Even if you're just
using scripts (not actually writing them) this FAQ is a "must read".


Regards,

   Mike Smith
   
-- 
Michael Smith    Austin, Texas
smith@io.com


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

Date: Sat, 20 Feb 1999 20:31:42 -0800
From: Austin Schutz <spamsux-tex@habit.com>
Subject: Re: FMTEYEWTK: Sorting
Message-Id: <36CF8C2E.4061@habit.com>

> 
> CODE 0.0
> 
>  :require 5; # if you don't have perl 5 by now, why NOT? :-)
>  :$str =
>  :      join "\n",
>  :      map { $_->[0] }
>  :      sort { $a->[1] <=> $b->[1] }
>  :      map { [$_, (split)[-1]] }
>  :      split /\n/,
>  :      $str;
>  :
>  :Hugo> Reply by mail (if any).
>  :
>  :(oops :-)
> 
> Oh for cryin' out loud, Randal! You expect a new perl programmer to make
> heads or tails of that>? :-) You're postings JAPHs for solutions, which
> isn't going to help a lot. You'll probably manage to scare these poor people
> away from the language forever? :-)
> 

< large instructional email snipped>

	I don't think its necessarily important to simplify code
to make it readable/usable for the less experienced. The real thing
missing here IMO are comments explaining what is being done and why.

	Austin


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

Date: 21 Feb 1999 03:05:42 GMT
From: "MekaGames Staff" <support@mekagames.com>
Subject: Re: HELP w/ SOCKETS + PORTS!!! - NEW QUESTION HERE!!
Message-Id: <01be5d46$5c9c65c0$fb8baccf@default>

I'm trying to check a UDP port and not a TCP port. How can I do this in
perl??

- Kaveh

MekaGames Staff <support@mekagames.com> wrote in article
<01be5d21$25490940$a089accf@default>...
> Hello to all,
> I'm having a very simply problem, but I need this problem solved as soon
as
> possible so please email me at kpahlevan@hotmail.com if you have a
solution
> to the following problem:
> 
> I have the following script:
> 
> #!/usr/bin/perl
> use IO::Socket;
> 
> @hosts = ('ftp.microsoft.com','ftp.netscape.com','ftp.cuteftp.com');
> $port = 21;
> 
> #####################################################################
> 
> print "Content-type: text/html\n\n";
> print "Here are the results of your port-checking:<br><hr>\n";
> 
> foreach $host (@hosts) {
> 	if ($remote = IO::Socket::INET -> new (
> 		Proto => "tcp",
> 		PeerAddr => $host,
> 		PeerPort => $port) || die "Could not connect to $!\n")
> 	{
> 		print "<hr>$host : $remote<br>\n";
> 	}
> }
> 
> The problem is, the script only gives a response for the sites that it
can
> reach, and does not pring "Count not connect to $!" when it's unable to
> connect to a site. If you can help me out here, please do so!! Also, this
> is not absolutely necessary, I'd like to make it so if after 10 seconds
it
> still hasn't been able to check the port, it can assume it's a closed
port.
> Please help me in any way you can. Thank you.
> 
> - Kaveh Pahlevan
> 


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

Date: Sun, 21 Feb 1999 01:36:12 GMT
From: ajs@ajs.com
Subject: Oracle/perl warning (was: Re: DBD::Oracle question)
Message-Id: <7annuc$ql6$1@nnrp1.dejanews.com>

In article <7aidrs$dv2$1@nnrp1.dejanews.com>,
  ajs@ajs.com wrote:
> Is the following DBD::Oracle (for inserting a row with a null value) supposed
> to work?
>
> # Assume a $db which is a valid, connected DBD::Oracle handle
> $field = undef;
> $prep = $db->prepare('insert into table_foo values (:1)');
> $prep->bind_param(1, $field, {TYPE => SQL_VARCHAR, NULLABLE => 1});
> $prep->execute;

I've since solved some of this problem, and here's a warning to anyone who
wants to do more with Oracle from perl than run a static query: use the "-8"
option when you compile. Thus, go into DBD-Oracle-xx.xx and type "perl
Makefile.PL -8". This is assuming version 0.59. The bug that I've found
results in an incorrect handling of undefined values in bound variables. I've
tracked it down to a spot in the "documentation" that comes with Oracle8-eval
which says that OCIBindByNmae will ignore the field that specifies that the
value is null. This is not code that I know well, so I will have to look at
it more, but be warned, the above code, if you need to do such, may not work
unless you use -8 (thus shutting off Oracle version 8 support).

The "NULLABLE" attribute also seems to be ignored by DBD::Oracle, which I
consider a bit of a bug. It's stored into a field of the placeholder structure
called "nullok", but then never used.

-AJS

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 21 Feb 1999 12:54:16 +0900
From: "Steel_Rhino" <reeves@ata.attmil.ne.jp>
Subject: Perl for Beginners?
Message-Id: <7anvlj$9qg$1@news.atsugi.attmil.ne.jp>

I am working towards my MCSE certification and I have run across several
references to the language called Perl. I downloaded Active perl from Active
state and I have no clue as to how it works. I'm really new to programming
lanuages, so if anyone can give a direction as to where I may download some
FAQ's, manuals or any other type of information on how to use this script
type lanuage I would appreciate it very much.

           Thanks in advance.




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

Date: Sat, 20 Feb 1999 20:41:50 -0800
From: dana@oz.netDELETE.CAPS (Dana Booth)
Subject: Re: Perl for Beginners?
Message-Id: <MPG.11392e6bfc64611989682@news.oz.net>

In article <7anvlj$9qg$1@news.atsugi.attmil.ne.jp>, 
reeves@ata.attmil.ne.jp says...
> I am working towards my MCSE certification and I have run across several
> references to the language called Perl. I downloaded Active perl from Active
> state and I have no clue as to how it works. I'm really new to programming
> lanuages, so if anyone can give a direction as to where I may download some
> FAQ's, manuals or any other type of information on how to use this script
> type lanuage I would appreciate it very much.

The best book you could get is called "Programming Perl", it's an 
O'Reilly book. It costs about 29 bucks at any decent bookstore. 
This book will tell you more in 20 minutes than this NG could in 
five days. :)

It's very easy to learn enough Perl to be productive, very quickly, 
and it can also be as complex as you wish. Good luck.

-- 

-----------------------------------
Dana Booth <dana@oz.netDELETE.CAPS>
Tacoma, Wa., USA
-----------------------------------


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

Date: Sun, 21 Feb 1999 06:03:59 +0200
From: "John Chronakis" <vamp71@freemail.gr>
Subject: Re: Perl script and Access 95
Message-Id: <7ao095$1qq$1@ns1.otenet.gr>


>I have Microsoft Access 95 and use Dreamweaver 2.0 and Fireworks/Photoshop
>4.01 for my web sites.  What I want is to be able to use a MS Access
>database to update new entries and delete old entries of movies and there
>release dates and then be able to generate a htm/html file etc to display
>the listings on specific pages.


Hi,
The best way to access an "Access" database from perl in a win32 machine is
the DBI module with the DBD::ODBC driver.

DBI (DataBase Interface) provides a set of commands like connect, execute
(SQL query) , fetchrow etc that can be used from your program to access a
database using SQL commands. These are the same for every database you want
to access, and the DBD (DataBaseDriver) module translates them to the native
language of the database.

With the DBI you can write perl scripts that will work from mSQL and mySQL
on a unix machine to Access and Oracle, without the need to change anything
in your code !!!
I have used successfully my scripts for creating, updating and retrieving
data from MS Access in my home and the same  time uploading them to the
linux server and accessing postgreSQL databases by just changing the
database name.

More info can be found at
http://www.hermetica.com/technologia/DBI/

The win32 versions of the DBI and DBD::ODBC can be downloaded using ppm, if
you have an ActiveState perl.
You can download them and the compile and install them manualy but it can be
tricky

John





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

Date: Sat, 20 Feb 1999 19:03:28 -0800
From: Tobin Fricke <tobin@uclink4.berkeley.edu>
Subject: Reading mailspool
Message-Id: <36CF7780.28DE41C7@sji.org>


I'd like to read and parse the unix mailspool (/var/spool/mail/username)
such that I can count the messages, and selectively get the text of a
given message if needed.

Any advice?

Thank you,
Tobin Fricke <tobin@sji.org>


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

Date: Sun, 21 Feb 1999 01:23:37 +0000
From: Greg Johnson <gregj@uidaho.edu>
Subject: Redirecting STDIN from keyboard to a program.
Message-Id: <36CF6019.54FC3BC4@uidaho.edu>

I am trying to read a line from the keyboard and pass that information
into a program called festival. As soon as I read from the keyboard
however, festival stops functioning. Here is what I am trying to do.

$pid = open(WRITEME, "| festival") or die "couldnt fork: $!\n";

while(<STDIN>){
   print WRITEME "(SayText \"$_\")";
}

close(WRITEME) or die "Couldnt close: $!\n";

The code works if I write it like this, but it takes a few seconds for
festival load and I would like to avoid this slowdown.:

while(<STDIN>){
   pid = open(WRITEME, "| festival") or die "couldnt fork: $!\n";
   print WRITEME "(SayText \"$_\")";
   close(WRITEME) or die "Couldnt close: $!\n";
}


TIA.
       Greg Johnson




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

Date: 20 Feb 1999 18:36:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Redirecting STDIN from keyboard to a program.
Message-Id: <36cf6302@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Greg Johnson <gregj@uidaho.edu> writes:
:I am trying to read a line from the keyboard and pass that information
:into a program called festival. As soon as I read from the keyboard
:however, festival stops functioning. Here is what I am trying to do.
:
:$pid = open(WRITEME, "| festival") or die "couldnt fork: $!\n";
:
:while(<STDIN>){
:   print WRITEME "(SayText \"$_\")";
:}

% man perlfaq5
    ...
    How do I flush/unbuffer an output filehandle?  
    Why must I do this?

--tom
-- 
    "You can't have filenames longer than 14 chars.  
     You can't even think about them!"
        --Larry Wall in Configure from the perl distribution


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

Date: 21 Feb 1999 03:07:29 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <7ant9h$pli$1@client2.news.psi.net>

Greg Bacon (gbacon@cs.uah.edu) wrote on MCMXCIV September MCMXCIII in
<URL:news:7a9jb4$adm$1@info.uah.edu>:
{} Following is a summary of articles spanning a 7 day period,
{} 
{} Top 10 Posters by Number of Posts
{} =================================
{} 
{}          (kb)   (kb)  (kb)  (kb)
{} Posts  Volume (  hdr/ body/ orig)  Address
{} -----  --------------------------  -------
{} 
{}    46    71.9 ( 32.9/ 29.5/ 18.3)  Jonathan Stowe <gellyfish@btinternet.com>
{} 
{} Top 10 Crossposters
{} ===================
{} 
{} Articles  Address
{} --------  -------
{} 
{}      112  haslawww@friko7.onet.pl (Best Passwords to sex pages )



Hmmm.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: Sat, 20 Feb 1999 19:29:08 -0800
From: Tobin Fricke <tobin@sji.org>
Subject: Verifying username/password
Message-Id: <36CF7D84.F2F65049@sji.org>


How do I verify that a given username/password pair is valid on a system
with shadowed passwords?

More specifically, the FAQ says that the getpw* routines should work if
Perl is properly installed.  On my system, getpwname returns "x", which
is the string in /etc/passwd which represents that the password is
shadowed (and thus that the crypted version is in another file).  How do
I cause my perl installation to be "properly configured" and thus return
the crypted password? 

Thanks,
Tobin Fricke <tobin@sji.org>


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

Date: Sat, 20 Feb 1999 21:55:28 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: y2k utility ^___^
Message-Id: <36CF75A0.97F43E4A@erols.com>

To:     AM_Dev
cc:     Edward Aquilina@Lazard NYC, Robert Warshaw@Lazard NYC, Frank
Dellapolla@Lazard NYC
Subject:        Y 2 K

Dear Boss:

I hope that I haven't misunderstood your instructions because, to be
honest, none of this Y to K problem makes any sense to me.  At any
rate, I have finished the conversion of all of the months on all the
company
calendars for next year (year 2000).  The calendars have returned from
the printer and are ready to be distributed with the following new
months:

Januark
Februark
Mak
Julk

Yours Truly
IS Manager


Greg Ward wrote:
> 
> Uri Guttman <uri@home.sysarch.com> wrote:
> > don't apologize, just do it more compactly:
> >
> > perl -pi.y2k -e 'tr/y/k/'
> 
> Wouldn't
> 
>    perl -pi.y2k -e 'tr/yY/kK/'
> 
> be better?
> 
>         Greg
> --
> Greg Ward - software developer                    gward@cnri.reston.va.us
> Corporation for National Research Initiatives
> 1895 Preston White Drive                      voice: +1-703-620-8990 x287
> Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

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

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