[18451] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 619 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 18:07:47 2001

Date: Tue, 3 Apr 2001 15:05:24 -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: <986335524-v10-i619@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 3 Apr 2001     Volume: 10 Number: 619

Today's topics:
        All-time "answer golf" winner! (was Re: array control i (Tad McClellan)
    Re: Any good way to split a very large string? <uri@sysarch.com>
    Re: Any good way to split a very large string? <pillgrim@mail.ru>
    Re: Any good way to split a very large string? <uri@sysarch.com>
    Re: array control issues (Abigail)
    Re: array control issues <david@kasey.umkc.edu>
    Re: Broken pipe and TCP_ERROR Error with cgi script tha <jimhayes@lucent.com>
    Re: Broken pipe and TCP_ERROR Error with cgi script tha nobull@mail.com
    Re: Call a script from a script <david@kasey.umkc.edu>
    Re: cannot fork? (Ryan McGuigan)
        CGI and GD troubles <bcoon@sequenom.com>
    Re: Chroot and IO::Socket::INET <admin@gatordev.net>
        Deleting one line from a file <david_j_findlay@yahoo.com.au>
    Re: Deleting one line from a file (Abigail)
        Digest::MD5 vs MD5 <david@freemm.org>
    Re: Digest::MD5 vs MD5 (John Joseph Trammell)
    Re: Does localtime() handle daylight savings jtaylo04@nospam.mail.orion.org
    Re: Email Gurus - Help! <wayne.keenan@ntlworld.com>
    Re: Javascript <wayne.keenan@ntlworld.com>
    Re: list all files in a directory <sjaaknabuurs@hetnet.nl>
    Re: list all files in a directory <wayne.keenan@ntlworld.com>
    Re: list all files in a directory (Tad McClellan)
        lookup javascript cookie using perl <wo_ah_ho@yahoo.com>
    Re: Multithreaded scripts on Win32 platforms. <pillgrim@mail.ru>
    Re: Newbies welcome <mischief@velma.motion.net>
    Re: parrot!?! <mischief@velma.motion.net>
        Perl for Unix Sparc (solaris 7.0) <milliwave@rfengineering.freeserve.co.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 3 Apr 2001 16:47:33 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: All-time "answer golf" winner! (was Re: array control issues)
Message-Id: <slrn9ckdn4.dqh.tadmc@tadmc26.august.net>


Top-posted because I don't want to obfuscate it.

This has to be an all-time winner for providing a direct answer
to the question asked in the least number of characters.

Abigail's posts regularly earn smirks from me, but this one 
was an outright guffaw.

ROTFL


Abigail <abigail@foad.org> wrote:
>danny webster (dsw@naughty.onetel.net.uk) wrote on MMDCCLXXII September
>MCMXCIII in <URL:news:slrn9cjmr8.dfa.dsw@naughty.onetel.net.uk>:
><> Hi there.
><> 
><> I posted yesterday, but I had no joy wqith the response.
><> 
><> What im trying to do, is pull out or add a virtualhost to a file (httpd.conf)
><> 
><> A vhost entry starts with <VirtualHost domain.com>
><> and ends with </VirtualHost>
><> 
><> I need to read in the top line, then the config between, up to the 
><> </VirtualHost> part.
><> 
><> There may be hundreds of them, or just a few. Then I need to add each one to
><> a separate array, which I can thne manipulate etc.
><> 
><> How can I go about this?
>
>
>..
>
>
>
>Abigail


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 03 Apr 2001 18:09:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Any good way to split a very large string?
Message-Id: <x7zodxua7c.fsf@home.sysarch.com>

>>>>> "AG" == Aleksandr Guidrevitch <pillgrim@mail.ru> writes:

  AG> Uri Guttman <uri@sysarch.com> writes:
  >> while( $long_string =~ /(some_regex_that_matches_section)/g ) {
  >> 
  >> process $1 ;

  AG> And try to use pointers.

huh???

what pointers?

perl has no pointers.

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: Tue, 3 Apr 2001 21:25:54 +0300
From: "Aleksandr Guidrevitch" <pillgrim@mail.ru>
Subject: Re: Any good way to split a very large string?
Message-Id: <9ad4m5$409hc$1@ID-82007.news.dfncis.de>

Hi !

>   AG> And try to use pointers.
>
> huh???
>
> what pointers?
>
> perl has no pointers.
>
Sorry, I mean references :) (perlref)

Aleks




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

Date: Tue, 03 Apr 2001 20:40:35 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Any good way to split a very large string?
Message-Id: <x7wv91u37g.fsf@home.sysarch.com>

>>>>> "AG" == Aleksandr Guidrevitch <pillgrim@mail.ru> writes:

  AG> Sorry, I mean references :) (perlref)

which is still meaningless unless you can make a regex return references
to inside a string. you can do that with substr but not directly with
m///.

and if you do the while m///g loop like i said, you won't need refs as
you will only process one element at a time and that should fit into
memory just fine.

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: Tue, 3 Apr 2001 20:38:44 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: array control issues
Message-Id: <slrn9ckd6k.vis.abigail@tsathoggua.rlyeh.net>

danny webster (dsw@naughty.onetel.net.uk) wrote on MMDCCLXXII September
MCMXCIII in <URL:news:slrn9cjmr8.dfa.dsw@naughty.onetel.net.uk>:
<> Hi there.
<> 
<> I posted yesterday, but I had no joy wqith the response.
<> 
<> What im trying to do, is pull out or add a virtualhost to a file (httpd.conf)
<> 
<> A vhost entry starts with <VirtualHost domain.com>
<> and ends with </VirtualHost>
<> 
<> I need to read in the top line, then the config between, up to the 
<> </VirtualHost> part.
<> 
<> There may be hundreds of them, or just a few. Then I need to add each one to
<> a separate array, which I can thne manipulate etc.
<> 
<> How can I go about this?


 ..



Abigail
-- 
   my $qr =  qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
      $qr =~  s/$qr//g;
print $qr, "\n";


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

Date: Tue, 03 Apr 2001 15:43:46 -0500
From: "David L. Nicol" <david@kasey.umkc.edu>
To: danny webster <dsw@naughty.onetel.net.uk>
Subject: Re: array control issues
Message-Id: <3ACA3602.180018FD@kasey.umkc.edu>

danny webster wrote:

> I was doing something like:
> 
>  if ($conf[$i] =~ /^<VirtualHost \D+>/i) {
>                          while ($conf[$i] !~ /^<\/VirtualHost/i) {
>         # stuff.
> 
>         }
> }
> 
> But  I was having problems skipping thru the lines before the </VirtualHost>
> (as in reading them into a new array).

Here's your problem.  Do you see the difference?

  if ($conf[$i] =~ /^<VirtualHost \D+>/i) {
                          while ($conf[++$i] !~ /^<\/VirtualHost/i) {
         # stuff.
 
         }
 }



-- 
                      David Nicol 816.235.1187 dnicol@cstp.umkc.edu
      "Of course, incompetence is a double-edged banana." -- Barlow


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

Date: Tue, 03 Apr 2001 20:56:10 +0100
From: Jim Hayes <jimhayes@lucent.com>
Subject: Re: Broken pipe and TCP_ERROR Error with cgi script that doesn't happen  in   command line mode
Message-Id: <3ACA2ADA.70704520@lucent.com>

Hi,
Thanks for your attention and time.

Ah, an important point I forgot to mention.
If the input isn't read from and to files, the script executes perfectly, in
spite of the same delay being present.

An aspect of this is flushing? ( flushing the tcp link and output, quite how
and why, I'm not sure)


If it's possible to  print to standard output as opposed to a buffered
output, this shouldn't happen ?.  :-))
Maybe if it's possible to send a soothing noise to the client( a few
characters maybe ?), this may also help

Thanks,

Jim

nobull@mail.com wrote:

>
> So the client says 'There was a communication problem' and the server
> says the client the client dropped the connection.
>
> I suspect what you have here is an impatient HTTP client that is
> falsely inferring a communications error and dropping the connection
> (and hense aborting the request) to the server if the response takes
> longer than it thinks is reasonable.
>
> This has nothing to do with Perl.



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

Date: 03 Apr 2001 19:27:20 +0100
From: nobull@mail.com
Subject: Re: Broken pipe and TCP_ERROR Error with cgi script that doesn't happen in   command line mode
Message-Id: <u9itklsut3.fsf@wcl-l.bham.ac.uk>

Jim Hayes <jimhayes@lucent.com> writes:

> This error happens whether I use my local server(running apache or the
> Company web server)
> 
> NETSCAPE BROWSER ERROR
> ###########################################################
>  Problem Report                   There was a communication problem.
>  Message ID                         TCP_ERROR
>  Problem Description             The system was unable to communicate
> with the server.
>  Possible Problem Cause       The Web server may be down.
>                                            The Web server may be too
> busy.
>                                            The Web server may be
> experiencing other problems, preventing it from responding to clients.
>                                            The communication path may be
> experiencing problems.
> 
>  Possible Solution                 Try connecting to this server later.
> ############################################################
> 
> APACHE SERVER LOG shows the following:
> ############################################################
> [Tue Apr  3 18:06:38 2001] [info] [client 192.11.186.113] (32)Broken
> pipe: client stopped connection before send body completed
> [Tue Apr  3 18:18:36 2001] [info] [client 192.11.186.113] (32)Broken
> pipe: client stopped connection before send body completed
> ############################################################

So the client says 'There was a communication problem' and the server
says the client the client dropped the connection.

I suspect what you have here is an impatient HTTP client that is
falsely inferring a communications error and dropping the connection
(and hense aborting the request) to the server if the response takes
longer than it thinks is reasonable.

This has nothing to do with Perl.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 03 Apr 2001 15:39:17 -0500
From: "David L. Nicol" <david@kasey.umkc.edu>
Subject: Re: Call a script from a script
Message-Id: <3ACA34F5.6BEF3892@kasey.umkc.edu>

NOSPAM@mail.ru wrote:
> 
> Hi,
> 
> Inside a perl script, I want call another one.
> 
> (I don't need to go back to the first script after)
> 
> How can I do by a simple way ?
> 
> Thanks

	do "otherscript.pl"; exit;


-- 
                      David Nicol 816.235.1187 dnicol@cstp.umkc.edu
      "Of course, incompetence is a double-edged banana." -- Barlow


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

Date: Tue, 03 Apr 2001 18:10:00 GMT
From: ryan@mail.cardweb.com (Ryan McGuigan)
Subject: Re: cannot fork?
Message-Id: <Yloy6.135$%r6.6878@news.abs.net>

jackkon@pchome.com.tw wrote:
: hi.....all
: I  adopt some code from my book and run it.
: I run the server.pl first and then client.pl.
: When the client.pl runs, I find the error below
: "Uncaught exception from user code:
:         cannot fork: Illegal seek"
: my system is linux6.2

So, you are from the future?  Or are you referring to _REDHAT_ 6.2?

Ryan


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

Date: Tue, 03 Apr 2001 12:16:46 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: CGI and GD troubles
Message-Id: <3ACA219E.59F6A931@sequenom.com>

I have run into several troubles using CGI.pm and the GD.pm, and after
several days of reading everything I can find, I still have not solved
them.

What I am have done is  to have a web page where a pop_up menu switches
between dynamically generated images on the page.

If for example I select image 1, an image is dynamically generated with
GD, showing my image with a bar drawn on it (for example), with data
from our db represented in different colors.  This image is also an
image map, so that all data set images are clickable, resulting in a
'zoom' on a specific data set.  I can then either click on the image to
zoom in or select another image via the pop_up menu.

Hopefully this makes sense! :)

I have gotten this working already, but there are some fundamental
issues that I am not sure about.

1.  In GD, there is a way to load existing images rather than generate
everything dynamically.  Is it more efficient to read in an image
'template' from disk and draw some small images on it, or to create the
whole thing from scratch?  This is a 600x400 image, the drawn images are
roughly 20X300 (there are only 3 of them).

2.  Currently, I am generating the image and writing it to disk, then
building the map around the image tag.  I have found some articles in
usenet that describe how to generate inline images by using binmod
STDOUT and printing the GD image to stdout.  But every article I found
required the proper header tag for an image.  My image will be in a
form.  Is it possible to generate this inline image as an imagemap in a
form?  If so can someone point me in the right direction?

3.  Everything I have done so far is straight scripting.  I am a
biologist by background, but have been programming in a proprietary
scripting language (a cross between perl and python syntax) for a couple
years so only the OO stuff in perl is somewhat new to me (well, okay
perl is kinda new too :).  Im afraid I dont know what the
advantages/disadvantages are for OOP for CGI and HTML projects.  If
there is a huge gain to do this in OO fashion, I will do it, otherwise
what I have will be fine.

So far, as I say, everything seems to be working okay but I have just
started this project and wish to correct my course at the beginning if
needed rather than discover some huge performace issue when I am done,
due to design flaws because I didnt find something out I should have.

Thanks in advance for any suggestions and advice!

Bryan





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

Date: Tue, 03 Apr 2001 18:47:59 GMT
From: Scott <admin@gatordev.net>
Subject: Re: Chroot and IO::Socket::INET
Message-Id: <3AC9C48D.CBD0E252@gatordev.net>



Garry Williams wrote:

>   $ man -s 4 protocols
>   ...
>   SYNOPSIS
>        /etc/inet/protocols
>
> --
> Garry Williams

Thank you, thank you, thank you.  I did lookup the man page but I skimmed
over it.
I had it in my head I was missing a library when all along it was only a file
that the
module needed to lookup the tcp protocol value.

Scott



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

Date: Wed, 4 Apr 2001 16:58:52 +1000
From: David Findlay <david_j_findlay@yahoo.com.au>
Subject: Deleting one line from a file
Message-Id: <SBqy6.8536$45.50114@newsfeeds.bigpond.com>

I am trying to delete one line from a text file using the second example on 
this page: http://www.perlmonks.org/index.pl?node_id=19436&lastnode_id=1839 
When I feed push(@outtext,$_); with the line of text I want removed, 
nothing happens. Seeing I have gone to all the trouble of being able to 
feed it this line, what do i do to get rid of the line, without totally 
rearranging my code. Thanks,

David


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

Date: Tue, 3 Apr 2001 22:01:56 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Deleting one line from a file
Message-Id: <slrn9cki2k.vis.abigail@tsathoggua.rlyeh.net>

David Findlay (david_j_findlay@yahoo.com.au) wrote on MMDCCLXXIII
September MCMXCIII in <URL:news:SBqy6.8536$45.50114@newsfeeds.bigpond.com>:
() I am trying to delete one line from a text file using the second example on 
() this page: http://www.perlmonks.org/index.pl?node_id=19436&lastnode_id=1839 
() When I feed push(@outtext,$_); with the line of text I want removed, 
() nothing happens. Seeing I have gone to all the trouble of being able to 
() feed it this line, what do i do to get rid of the line, without totally 
() rearranging my code. Thanks,


What do you expect should happen if you do:

    push @outtext, $_;



Abigail
-- 
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Tue, 03 Apr 2001 18:17:51 GMT
From: "David M. Lloyd" <david@freemm.org>
Subject: Digest::MD5 vs MD5
Message-Id: <Pine.LNX.4.21.0104031310380.2486-100000@homebody.freemm.org>

Is this what I ought to be expecting?

#### {
[usrodl@tomservo usrodl]$ perl -MMD5 -MDigest::MD5

my $str = "HELLO!!!!";

my $a = MD5->hash($str);
my $b = Digest::MD5->md5($str);

print unpack("H*", $a)."\n";
print unpack("H*", $b)."\n";
5ffee591af6a4578557e8e83fe58a41b
54c712c94ecdea3757dc732c8d15e517
#### }

In the MD5 manpage, it says this:

> The `MD5' module is depreciated.  Use `Digest::MD5' instead.

> The current `MD5' module is just a wrapper around the `Digest::MD5'
> module.  It is provided so that legacy code that rely on the old
> interface still work and get the speed benefit of the new module.

> In addition to the methods provided for `Digest::MD5' objects, this
> module provide the class methods MD5->hash() and MD5->hexhash() that
> basically do the same as the md5() and md5_hex() functions provided by
> `Digest::MD5'.

This is not compatible with the results I got.  What did I do wrong?  MD5
seems 'right' and Digest::MD5 seems 'wrong'...

- D

<david@freemm.org>



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

Date: Tue, 03 Apr 2001 18:27:28 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: Digest::MD5 vs MD5
Message-Id: <slrn9ck3f2.c26.trammell@bayazid.hypersloth.net>

On Tue, 03 Apr 2001 18:17:51 GMT, David M. Lloyd <david@freemm.org> wrote:
[snip]

[ ~ ] perl -MMD5 -MDigest::MD5
my $a = MD5->hash($str);
my $b = Digest::MD5->md5($str);
my $c = Digest::MD5::md5($str);
my $d = Digest::MD5::md5("Digest::MD5",$str);

for ($a,$b,$c,$d) { print unpack("H*",$_), "\n" }

d41d8cd98f00b204e9800998ecf8427e
5070500f95a02ed4fa17a9321e81ffe4
d41d8cd98f00b204e9800998ecf8427e
5070500f95a02ed4fa17a9321e81ffe4
[ ~ ]

You want to use Digest::MD5::md5, not Digest::MD5->md5.
Didn't we just do this?



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

Date: Tue, 03 Apr 2001 20:45:25 GMT
From: jtaylo04@nospam.mail.orion.org
Subject: Re: Does localtime() handle daylight savings
Message-Id: <FDqy6.77$L53.365@news.more.net>

Yes! We have NT 4.0 too and are also having problems with some commercial
software that uses perl on a NT 4.0. If anyone has any answers, please
email me at jstaylo@coxnet.org as I'm not a frequent reader of this NG.

Jack

Your_Name_Here <ramu_chidambaram@agilent.com> wrote:
| Hi,
|    Does anyone know whether localtime functions handles the daylight
| savings correctly on WINNT 4.0
| If I run the below two lines, I still see the old timings. Rebooting my
| machine has not helped. 

| ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
| print "time $mday-$months[$mon]-$year.$hour:$min:$sec\n";

| Thanks for the help,
| chidam

-- 
      During branding, cowboys have sore calves. 


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

Date: Tue, 03 Apr 2001 21:34:23 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Email Gurus - Help!
Message-Id: <3ACA33CF.DFD24BB5@ntlworld.com>

Ive lost your script, please send it again (preferably just to me, to avoid
wasting space)

Zachary Kent wrote:

> "wayne.keenan" <wayne.keenan@ntlworld.com> wrote in message
> news:3AC8DA52.320E5FBA@ntlworld.com...
> >
> > Zachary Kent wrote:
> >
> > >
> > > I don't know what to do with the line:
> > >     echo /usr/bin/mimencode $filename
> > >
> >
> > use backticks to capture the output of the command, so it becomes:
> >
> > print MAIL `/usr/bin/mimencode $filename`;
> >
>
> Thanks wayne,
>
> However, I am still having trouble with the script in general.  The print
> content-type statements are just printing and thats all.  This is the body
> of the email I am recieving from the program:
>
> Content-Type: multipart/mixed;
> Boundary="sendfile-attachment-boundary"--sendfile-attachment-boundaryContent
> -Type: text/plain; charset=us-asciiThis is a MIME encoded message. If your
> mail softwarecannot properly handle the attached file, you may needto get a
> MIME-aware mailer.--sendfile-attachment-boundaryContent-Type:
> application/octet-stream; name="test.log"Content-Transfer-Encoding:
> base64Content-Disposition: attachment;
> filename="test.log"--sendfile-attachment-boundary--
>
> How do I print those content-types and boundaries so that sendmail *does
> stuff* rather than *print stuff*?
>
> And, please if there are other errors in the script, let me know.  I do not
> know much about sendmail (other than the basics) and not much about
> mime-types.
>
> Thanks Perl-gurus,
> Zach



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

Date: Tue, 03 Apr 2001 19:38:26 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Javascript
Message-Id: <3ACA18A2.E5FFDAF7@ntlworld.com>

ce?

Emanuele Di Dedda wrote:

> Scusate. Ho sbagliato a spedire una email.
> Sono sicuramente OT.



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

Date: Sat, 31 Mar 2001 17:48:16 +0200
From: "sjaak nabuurs" <sjaaknabuurs@hetnet.nl>
Subject: Re: list all files in a directory
Message-Id: <eXiQvLHvAHA.228@net005s.hetnet.nl>

Hi

just simple

 opendir (DIR,"$dir") or die "$cgi_path/$city not excist";
 @dir = readdir(DIR);
 closedir (DIR);



--

Sjaak Nabuurs

Visit www.CityTower.com and create your own citytower
and become the centre of internet in your city.





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

Date: Tue, 03 Apr 2001 21:51:30 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: list all files in a directory
Message-Id: <3ACA37D2.F9D63788@ntlworld.com>



sjaak nabuurs wrote:

> Hi
>
> just simple  :  opendir (DIR,"$dir") or die "$cgi_path/$city not
> excist";
>

just more informative:  opendir (DIR,"$dir") or die "failed to open:
$cgi_path/$city , because of this REAL reason: $!";

(e.g. permissions)



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

Date: Tue, 3 Apr 2001 15:49:18 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: list all files in a directory
Message-Id: <slrn9cka9u.dnd.tadmc@tadmc26.august.net>

sjaak nabuurs <sjaaknabuurs@hetnet.nl> wrote:
>
>just simple


But it lists (errr, no it doesn't list anything either...) _more_
than just files. I don't remember if that was what the OP really 
wanted or not...


> opendir (DIR,"$dir") or die "$cgi_path/$city not excist";
               ^    ^

Useless use of quotes.  $dir alone will work fine there.

Misleading diagnostic message (doubly so.  first it reports the 
wrong directory name, second it might exist and still fail, 
"Permission denied" for instance). 

Left out helpful info from the diagnostic message. You should
include the $! special variable.

   opendir(DIR, $dir) or die "could not open '$dir'  $!";

> @dir = readdir(DIR);
> closedir (DIR);


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 3 Apr 2001 14:37:37 -0400
From: "Jason Wong" <wo_ah_ho@yahoo.com>
Subject: lookup javascript cookie using perl
Message-Id: <9ad5dk$rbd$1@bcrkh13.ca.nortel.com>

Does anyone how to do this? Is this do-able?

I look up some doc on cookie & perl but it seems that a cookie can be
retrieved using perl if that cookie is set in perl.

Thanks

Jason




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

Date: Tue, 3 Apr 2001 21:29:44 +0300
From: "Aleksandr Guidrevitch" <pillgrim@mail.ru>
Subject: Re: Multithreaded scripts on Win32 platforms.
Message-Id: <9ad4t8$4bech$1@ID-82007.news.dfncis.de>

I use a port from www.dynamicstate.com
It forks well :)

Best regards
Aleks




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

Date: Tue, 03 Apr 2001 20:50:30 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Newbies welcome
Message-Id: <tckdsm5gbe7mb9@corp.supernews.com>

In comp.lang.perl.misc Tracy Coyle <tccoyle@chorus.net> wrote:
> Chris Stith wrote in message ...

>>>>Do not ever be afraid of asking a question...
>>
>>Except when it's already answered for you.


> $t = "SELECT * FROM sessiontable WHERE pageID = $page";

> I apologize for using a php/mysql example but I spent 3 hours trying to find
> out why this query was not working.  I reviewed both php and mysql
> documentation til my head hurt.   First rule of programming...if it doesn't
> work, check the syntax (but that is not in the FAQ...)

No, but it's as obvious as checking the cable when you can't ping
your router.

>>> who was the brain that thought giving programmers access to manipulating
>>> memory directly was a good idea??!!   Moved to Java....someone
> recommended
>>
>>Those who _need_ to access memory directly in programs, such as
>>driver programmers, OS programmers, embedded device programmers, etc
>>think dirct memory access is a good idea.


> So you would agree giving that type of memory access to someone on a remote
> machine is not a good idea?   I believe that manipulating memory on the
> machine the code resides on is acceptable, sometimes desirable, even
> occasionally necessary.

Who's talking about giving people the ability to do direct memory access
from a remote machine? Last time I checked, C++ and the sort had to be
compiled, and ran on one machine at a time. It's a pain to coerce C++
to evaluate code on the fly, so I don't know what you're trying to say.

>>> This newsgroup, like the others crossposted are excellant places to learn
>>> and teach.
>>
>>To learn and teach what is not already taught in the FAQs. When you
>>learn at a university, there are these things called `prerequisite
>>courses', but I guess for you that means universities are bad places
>>to learn.

> I am unsure how you make this assumption (remote memory manipulation maybe!)
> but I think universities are fine places to learn.  Unfortunately, many
> people have lives and responsibilities and can not return to school to learn
> new tasks/skills.  When I was in college, they taught COBOL and RPG II.
> Java, C did not exist and the internet was still in its not-so-public
> infancy.

The analogy I was making is that if you hate the idea of a newsgroup
having preqrequisites, then you are just as likely to hate the idea
that you can't study nuclear medicine without first studying biology
and chemistry.

> And despite the excellant resources I have found for working with mysql and
> php, my experience is that the simplist questions are "so obvious" that no
> one addresses them formally.  And you miss the point of FAQ's (frequently
> asked questions)...they don't teach anything....they answer specific
> questions....what if you don't know the right question...??

I miss no point about FAQs. You make too many assumptions. You should
read a book or the standard non-FAQ docs with the software before you
look in the FAQ. You should then check the FAQ for a question before
you ask the question here. Prerequisites are prerequisites.

>>>  To those that answer, thank you.  To those that post, there are
>>> others just like you out here, to those that lurk and learn, no question
> is
>>> stupid to the 50 others with the same question...
>>
>>The questions in the FAQs aren't stupid. No one says they are, otherwise
>>they'd probably not be in the FAQ. It's perfectly acceptable to not know
>>the answer to a question that's in a FAQ list. What's not acceptable is
>>to ask several hundred or a few thousand people to answer the same
>>question that was answered yesterday or that was answered on your hard
>>drive all along.

> Even you suggest 'stupid' questions "probably not be in the FAQ"....how do
> you know a stupid question?  You know the answer?   Sorry, but freshmen do
> not always know as much as seniors....if you don't like the questions
> freshmen ask....don't read them.

If it's not in the FAQ, then no one will tell you to go read the FAQ when
you ask it. If it really is too simple to be in the FAQ, then it's probably
been asked enough that it will be. If it is in the FAQ and you've checked
the FAQ, you won't need to ask it here. It's really that simple. They are
called Frequently Asked Questions because they are.

Here you infer that I'm a college senior. I haven't been in college for
over five years, thanks. 

>>I have set followups to where this thread belongs: alt.dev.null;
>>I would have used alt.horse.dead.beating, but StuporNews doesn't
>>seem to carry that.


> Obviously you have missed the intent of the thread...to welcome newbies....

The intent of the thread is to inform people new to Usenet or to certain
groups that no sort of manners is expected of them. The thread repeatedly
states that it's okay to ask the same questions that ar ein the FAQs, that
it's okay not to read documentation, and that anyone who asks you to do
such things is just being rude. Read the thread. Know what the thread says.
Then maybe you can try to say the thread isn't trying to tear down all the
expectations of common courtesy expected on Usenet. When you do make such
a statement, those who have read along at home will be able to judge the
truth in your statements for themselves.

-- 
Christopher E. Stith
If they can get you asking the wrong questions, they don't
have to worry about the answers.
  -- Thomas Pynchon, Gravity's Rainbow



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

Date: Tue, 03 Apr 2001 20:27:38 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: parrot!?!
Message-Id: <tckchqdpam0occ@corp.supernews.com>

Logan Shaw <logan@cs.utexas.edu> wrote:
> In article <0vRx6.2$yi2.2520@vic.nntp.telstra.net>,
> Wyzelli <wyzelli@yahoo.com> wrote:
>>"Dave Brondsema" <brondsem@my-deja.com> wrote in message
>>news:DmRx6.127121$W05.24571769@news1.rdc1.mi.home.com...
>>> I would use dollar_underscore all the time!
>>>
>>
>>Is that pronounced "dollar underscore underscore" ?
>>
>>Just imagine talking someone through that..."No the second one is
>>spelled out,  What?, NO, the first one is an underscore.  NO There
>>aren't any spaces!... Just type dollar underscore underscore..." hehe

> From the BSD "fortune: program:

> 	"Wouldn't the sentence 'I want to put a hyphen between the words Fish
> 	and And and And and Chips in my Fish-And-Chips sign' have been clearer
> 	if quotation marks had been placed before Fish, and between Fish and
> 	and, and and and And, and And and and, and and and And, and And and
> 	and, and and and Chips, as well as after Chips?"

So, I guess unsolicited bulk email is Spam, and unsolicited bulk
snail mail we could call `and'. Just a thought.

Chris

-- 
Christopher E. Stith
Programming is a tool. A tool is neither good nor evil. It is
the user who determines how it is used and to what ends.



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

Date: Tue, 3 Apr 2001 22:32:52 +0100
From: "Milliwave" <milliwave@rfengineering.freeserve.co.uk>
Subject: Perl for Unix Sparc (solaris 7.0)
Message-Id: <9adfe4$b05$1@newsg4.svr.pol.co.uk>

Hello,

I currently have Perl 5.001 on a solaris 7.0 operating system. It has come
to my attention
that certain perl modules like the constant.pm and various extras are not
present within the
library. Is there anywhere I can find these basic contant.pm and math
modules and put them
in the existing library? If so where can I get hold of such modules?

What's the most uptodate version of Perl which is available for the Solaris
operating system?
On sun's freeware web site, the most uptodate version for the Solaris 7.0
operating system
is perl5.005. Where can I find the binaries for perl?

Your help is grately appreciated.




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

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 V10 Issue 619
**************************************


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