[19302] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1497 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 11 18:05:31 2001

Date: Sat, 11 Aug 2001 15:05:11 -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: <997567511-v10-i1497@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 11 Aug 2001     Volume: 10 Number: 1497

Today's topics:
    Re: <frames> & CGIWRAP <jtjohnston@courrier.usherb.ca>
        [ANNOUNCE] HTTP::WebTest 1.06 <ilya@martynov.org>
        A persistant 'study'? (D. Bron)
        ANNOUNCE: IO-stringy 2.x uploaded to CPAN (Eryq)
        ANNOUNCE: Text::Iconv 1.2 <mxp@dynalabs.de>
        Can read, but can't write (sowbug)
    Re: Can read, but can't write (Tad McClellan)
        CGI Filter <bones10@email.msn.com>
        cvs and perl-modules <pilsl_@goldfisch.at>
    Re: DBI:CSV SQL 'order by' problem <neisius@earthlink.net>
        FAQ: How can I use a filehandle indirectly? <faq@denver.pm.org>
        How to get stderr and stdout of a subprocess? <roy@panix.com>
        how to test $X le 'z' <jprok@snet.net>
    Re: how to test $X le 'z' <ilya@martynov.org>
    Re: my final word - i'll listen, though [Re: Pattern Ma <krahnj@acm.org>
    Re: NET::FTP and other file operations <gerhardpremovethis@inch.com>
    Re: perldoc is like Greek to a beginner?? (Mark Jason Dominus)
    Re: perldoc is like Greek to a beginner?? (Mark Jason Dominus)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 11 Aug 2001 18:54:05 GMT
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: Re: <frames> & CGIWRAP
Message-Id: <3B757D91.9C959500@courrier.usherb.ca>

Why not? Good, safe practice no? Lock it to read, just in case someone
is writing at same time? Take no chances ... Obviously not doing it
anyways because of the #


> I am curious why you are locking a filehandle opened
> for read only.
> Godzilla!



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

Date: 11 Aug 2001 14:05:11 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: [ANNOUNCE] HTTP::WebTest 1.06
Message-Id: <tnb48hfts20i63@corp.supernews.com>


The URL

    http://martynov.org/tgz/HTTP-WebTest-1.06.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-1.06.tar.gz
  size: 60811 bytes
   md5: 991300e6ea655d90b34b8fcadde3e9fd

NAME
    HTTP::WebTest - Test remote URLs or local web files

DESCRIPTION
    This module runs tests on remote URLs or local web files containing
    Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report.

    The test specifications can be read from a parameter file or input as
    method arguments. If you are testing a local file, Apache is started on
    a private/dynamic port with a configuration file in a temporary
    directory. The module displays the test results on the terminal by
    default or directs them to a file. The module optionally e-mails the
    test results.

    Each URL/web file is tested by fetching it from the web server using a
    local instance of an HTTP user agent. The basic test is simply whether
    or not the fetch was successful. You may also test using literal strings
    or regular expressions that are either required to exist or forbidden to
    exist in the fetched page. You may also specify tests for the minimum
    and maximum number of bytes in the returned page. You may also specify
    tests for the minimum and maximum web server response time.

    If you are testing a local file, the module checks the error log in the
    temporary directory before and after the file is fetched from Apache. If
    messages are written to the error log during the fetch, the module flags
    this as an error and writes the messages to the output test report.

Changes since 1.05:

   * Some files required for local web files testing mode were missing
     in last HTTP-WebTest distributions.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




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

Date: 11 Aug 2001 18:29:12 GMT
From: DBron@Flashmail.NOSPAM.com (D. Bron)
Subject: A persistant 'study'?
Message-Id: <Xns90FA936A43A3EDBronOfNYC@166.84.0.240>

Hello,

Is it possible to save the study() of a string?  I have a script 
that searches a very large text file.  The text file never 
changes, but the regular expressions which search it do.  I'd 
like to use study() on the text file once, and thereafter use 
that study() each time I run my script (with different regular 
expressions).  Actually, I'd prefer to somehow save the study() 
of each line of the file, and be able to reference them later 
somehow (perhaps with an array).  Can I do this, and if so, how?

Thanks for any help,

-D. Bron


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

Date: 9 Aug 2001 08:34:33 -0700
From: eryq@zeegee.com (Eryq)
Subject: ANNOUNCE: IO-stringy 2.x uploaded to CPAN
Message-Id: <tnb48a3b1sit5c@corp.supernews.com>

The first public 2.x version of the IO-stringy bundle has been uploaded
to PAUSE, and will be winging to a CPAN site near you.

OVERVIEW: This bundle provides lots of pure perl, in-core I/O related stuff; 
particularly the ability to read/write from scalars, arrays of scalars.
Arrays of \n-terminated lines have an even more-efficient handle class.
You can get the full scoop here:

	http://www.zeegee.com/code/perl/IO-stringy
	http://www.zeegee.com/code/perl/IO-stringy/docs

NEW IN THIS RELEASE: IO::Scalar, IO::ScalarArray, and IO::Lines now
inherit from IO::Handle and consult $/, as nature intended.  
That means you really can use in-core I/O handles exactly as
any other kind of IO::Handle.  Big thanks to Doug Wilson for this. 

The Alpha notice on the docs will be retracted in a few days,
provided that no glaring holes are found.  Other than that, it
should be almost completely backwards-compatible with 1.x.
 
Enjoy.  Yell if it breaks.  Opinions are always welcome.




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

Date: 11 Aug 2001 13:01:40 +0200
From: Michael Piotrowski <mxp@dynalabs.de>
Subject: ANNOUNCE: Text::Iconv 1.2
Message-Id: <tnb48uc0v7ql68@corp.supernews.com>

I've just uploaded a new version of the Text::Iconv module to CPAN.
The main changes are:

   - converting undef now always returns undef
   - should compile without warnings on platforms where the second
     argument to iconv() is const char** (this seem to be all except
     HP-UX)

When it has migrated to its final destination, you should be able to
find it via
  
   <http://search.cpan.org/search?dist=Text-Iconv-1.2>
  
It's also immediately available from
  
   <http://www.dynalabs.de/mxp/perl/Text-Iconv-1.2.tar.gz>  
   <ftp://ftp.linguistik.uni-erlangen.de/pub/perl/Text-Iconv-1.2.tar.gz>

Here's an excerpt from the README:
  
   This module provides a Perl interface to the iconv() codeset
   conversion function, as defined by the Single UNIX Specification.
   For more details see the POD documentation embedded in the file
   Iconv.pm.

In other words (and if you aren't into terminology), this module lets
you convert text from one character set into another character set
using the iconv library, which is very likely to be already installed
on your system (if it's a UNIX or UNIX-like system).  You can also use
this module with a separate iconv implementation, such as Bruno
Haible's (see <http://clisp.cons.org/~haible/packages-libiconv.html>).

-- 
Michael Piotrowski, M.A.                                  <mxp@dynalabs.de>




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

Date: 11 Aug 2001 11:31:00 -0700
From: brianwharris@hotmail.com (sowbug)
Subject: Can read, but can't write
Message-Id: <c5d7d22b.0108111030.7580a715@posting.google.com>

I'm trying to write to an html file in htdocs with my perl script
that's in cgi-bin. Using Unix with Apache. The script is executing
fine. I'm not getting any errors, but it will simply not write to the
file. I have even given all permissions to htdocs to everyone. It will
write to the file if and only if I put it in the same directory.
Please help!


$file2 = "/htdocs/favlinks.html";                     
open (INFILE, ">$file2") || die("favlinks.html does not exist: $!");
print INFILE "\<html\>" . "\<head\>" . "\<title\>" . "\<\/title\>";
print INFILE "\<\/head\>" . "\<body\>" . "\n";
print INFILE "<CENTER>" . "<TABLE BORDER=1>";

for ($i = 0; $i<=$#array; $i++)
{
	print INFILE "<TR>" . "<TD>" . $array[$i] . "\n" . "<TD>" .
$array2[$i];
}

print INFILE "</TABLE>" . "</CENTER>";
print INFILE "\<\/body\>" . "\<\/html\>";
close (INFILE);


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

Date: Sat, 11 Aug 2001 14:42:31 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Can read, but can't write
Message-Id: <slrn9nav4n.4nh.tadmc@tadmc26.august.net>

sowbug <brianwharris@hotmail.com> wrote:
>I'm trying to write to an html file in htdocs with my perl script
>that's in cgi-bin. Using Unix with Apache. 


Sounds like you are writing a Perl program that runs in
a CGI environment...


>The script is executing
>fine. I'm not getting any errors, 


Then you have already looked at your server logs to make sure
that the die() didn't execute?


>but it will simply not write to the
>file. 


>I have even given all permissions to htdocs to everyone. 


That is a very very very poor attempted solution.

Hope you have good backups, and no private information there...


>It will
>write to the file if and only if I put it in the same directory.


The same directory as what?


>Please help!


If the die() is not executing, then I don't see how it can
not be writing.

I'd bet the die() _is_ executing though, so find the message in
the server log and $! will tell you why the open() failed.


>$file2 = "/htdocs/favlinks.html";                     
>open (INFILE, ">$file2") || die("favlinks.html does not exist: $!");
       ^^
       ^^

That is a might strange choice of filehandle for a file opened
for OUTput. Do you get bonus points for confusing yourself?


>print INFILE "\<html\>" . "\<head\>" . "\<title\>" . "\<\/title\>";


Not a single one of those backslashes are needed. Do you get
paid by the character?

   print INFILE "<html><head><title></title>";

Isn't that easier to read and understand?


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


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

Date: Mon, 6 Aug 2001 13:22:21 -0600
From: "bones10" <bones10@email.msn.com>
Subject: CGI Filter
Message-Id: <uBb9c2qHBHA.264@cpmsnbbsa07>

Hi,

I"m just learning perl. I'd like to create a CGI filter in perl, where the
perl script is given a URL to a web page and the perl script then reads
through the html file, possibly modifying it, and sends the results back out
to the browser. The URL to the web page could be restricted to refer a web
page on the server.

The problem I'm running into is in finding where the html file actually
exists on the server. I'd rather not hard code server side paths in the url
that invokes the perl script.

Any suggestions?

What is the best way to do this?

Thanks,

- bones




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

Date: Sat, 11 Aug 2001 23:14:09 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: cvs and perl-modules
Message-Id: <3b75a021$1@e-post.inode.at>


Hope this is not too offtopic here, but I get a big problem when using CVS 
on my perl-modules:

When I run 'make' on an fresh outchecked project I get the following error:
---
Makefile out-of-date with respect to Makefile.PL
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
/usr/bin/perl "-I/usr/lib/perl5/5.6.0/i386-linux" "-I/usr/lib/perl5/5.6.0" 
Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for goldfisch::genericSQL2
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command.  <==
false
make: *** [Makefile] Error 1
---

As soon as I rerun make, the whole blib-structure is recreated and I cant 
commit to CVS, cause the CVS-subdirs in blib are missing ...

whats the trick ?

thnx,
peter


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

Date: Sat, 11 Aug 2001 18:08:51 GMT
From: "Bill Neisius" <neisius@earthlink.net>
Subject: Re: DBI:CSV SQL 'order by' problem
Message-Id: <Twed7.2719$ZM2.246866@newsread2.prod.itd.earthlink.net>


"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3B74CF5C.5A3265F4@earthlink.net...

> my $number = qr[\A
> (?>\s*) # leading whitespace ok when numerifying a string.
> (?>[-+]?) # optional plus/minus.
> (?>\d+\.\d*|\.\d+) # required mantissa
> (?>[eE][-+]?\d+)?  # optional exponent
> (?>\s*) # trailing whitespace ok, too
> \z]x;

I think you missed a "?" up there.  Should be:

    (?>\d+\.\d*|\.?\d+) # required mantissa

otherwise "123" isn't a number.

Looks like this will correct the problem in the original
sort... but now I'm having doubts about the design of
the whole sort routine.

If the string or numeric comparison depends on the
data in the field, aren't you likely to get some
'unusual' sorts when some of the rows match the
numeric pattern and some of them don't?
For example, the list:
    '100', '+101', '100A', '102'
is 'sorted' based on this routine...

Maybe I shouldn't worry about it... but since CSV only
has the 'character' column data type, shouldn't the sort
only use string compares?  Otherwise the results
are unpredictable.






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

Date: Sat, 11 Aug 2001 18:17:00 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How can I use a filehandle indirectly?
Message-Id: <wEed7.42$V3.175066112@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How can I use a filehandle indirectly?

    An indirect filehandle is using something other than a symbol in a place
    that a filehandle is expected. Here are ways to get indirect
    filehandles:

        $fh =   SOME_FH;       # bareword is strict-subs hostile
        $fh =  "SOME_FH";      # strict-refs hostile; same package only
        $fh =  *SOME_FH;       # typeglob
        $fh = \*SOME_FH;       # ref to typeglob (bless-able)
        $fh =  *SOME_FH{IO};   # blessed IO::Handle from *SOME_FH typeglob

    Or, you can use the "new" method from the FileHandle or IO modules to
    create an anonymous filehandle, store that in a scalar variable, and use
    it as though it were a normal filehandle.

        use FileHandle;
        $fh = FileHandle->new();

        use IO::Handle;                     # 5.004 or higher
        $fh = IO::Handle->new();

    Then use any of those as you would a normal filehandle. Anywhere that
    Perl is expecting a filehandle, an indirect filehandle may be used
    instead. An indirect filehandle is just a scalar variable that contains
    a filehandle. Functions like "print", "open", "seek", or the "<FH>"
    diamond operator will accept either a read filehandle or a scalar
    variable containing one:

        ($ifh, $ofh, $efh) = (*STDIN, *STDOUT, *STDERR);
        print $ofh "Type it: ";
        $got = <$ifh>
        print $efh "What was that: $got";

    If you're passing a filehandle to a function, you can write the function
    in two ways:

        sub accept_fh {
            my $fh = shift;
            print $fh "Sending to indirect filehandle\n";
        }

    Or it can localize a typeglob and use the filehandle directly:

        sub accept_fh {
            local *FH = shift;
            print  FH "Sending to localized filehandle\n";
        }

    Both styles work with either objects or typeglobs of real filehandles.
    (They might also work with strings under some circumstances, but this is
    risky.)

        accept_fh(*STDOUT);
        accept_fh($handle);

    In the examples above, we assigned the filehandle to a scalar variable
    before using it. That is because only simple scalar variables, not
    expressions or subscripts of hashes or arrays, can be used with
    built-ins like "print", "printf", or the diamond operator. Using
    something other than a simple scalar varaible as a filehandle is illegal
    and won't even compile:

        @fd = (*STDIN, *STDOUT, *STDERR);
        print $fd[1] "Type it: ";                           # WRONG
        $got = <$fd[0]>                                     # WRONG
        print $fd[2] "What was that: $got";                 # WRONG

    With "print" and "printf", you get around this by using a block and an
    expression where you would place the filehandle:

        print  { $fd[1] } "funny stuff\n";
        printf { $fd[1] } "Pity the poor %x.\n", 3_735_928_559;
        # Pity the poor deadbeef.

    That block is a proper block like any other, so you can put more
    complicated code there. This sends the message out to one of two places:

        $ok = -x "/bin/cat";                
        print { $ok ? $fd[1] : $fd[2] } "cat stat $ok\n";
        print { $fd[ 1+ ($ok || 0) ]  } "cat stat $ok\n";           

    This approach of treating "print" and "printf" like object methods calls
    doesn't work for the diamond operator. That's because it's a real
    operator, not just a function with a comma-less argument. Assuming
    you've been storing typeglobs in your structure as we did above, you can
    use the built-in function named "readline" to reads a record just as
    "<>" does. Given the initialization shown above for @fd, this would
    work, but only because readline() require a typeglob. It doesn't work
    with objects or strings, which might be a bug we haven't fixed yet.

        $got = readline($fd[0]);

    Let it be noted that the flakiness of indirect filehandles is not
    related to whether they're strings, typeglobs, objects, or anything
    else. It's the syntax of the fundamental operators. Playing the object
    game doesn't help you at all here.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           05.07
-- 
    This space intentionally left blank


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

Date: Sat, 11 Aug 2001 15:31:46 -0400
From: Roy Smith <roy@panix.com>
Subject: How to get stderr and stdout of a subprocess?
Message-Id: <roy-548952.15314611082001@news1.panix.com>

I want to run a shell command and capture (separately) both the stdout and 
stderr.  Short of mucking about with fork()/exec() myself, if there any way 
to do this?  The one example I found was to do:

   system ("command > /tmp/stdout 2> /tmp/stderr")

and then open /tmp/std{out,err} and read them back one at a time.  This 
would work, but seems kind of clunky.  Anything better?


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

Date: Sat, 11 Aug 2001 17:33:59 -0400
From: john prokopek <jprok@snet.net>
Subject: how to test $X le 'z'
Message-Id: <3B75A4C7.3103A35F@snet.net>

I seem to be having a problem testing for the value of a character
variable.
the code is as follows

for ( $letter = 'a' ; $letter le 'z'; $letter++)
{
 print $letter."\n";
}


Now I would think this would print the letters a to z but 
instead it prints  a to zz.

What am I doing wrong?

thanks for the help


-- 
John D. Prokopek
jprokopek@snet.net


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

Date: 12 Aug 2001 01:49:25 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: how to test $X le 'z'
Message-Id: <87hevegtcq.fsf@abra.ru>


jp> I seem to be having a problem testing for the value of a character
jp> variable.
jp> the code is as follows

jp> for ( $letter = 'a' ; $letter le 'z'; $letter++)
jp> {
jp>  print $letter."\n";
jp> }


jp> Now I would think this would print the letters a to z but 
jp> instead it prints  a to zz.

jp> What am I doing wrong?

You are using ++ for string. In Perl operator ++ used with string is
magical (see 'perldoc perlop' chapter 'Auto-increment and
Auto-decrement') so

    $letter = 'z';
    $letter ++;
    print $letter;

will print 'aa' instead of '{' (next char in ASCII table after 'z').

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Sat, 11 Aug 2001 18:22:55 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: my final word - i'll listen, though [Re: Pattern Matching: Which  subpattern (rather than substring) was matched?]
Message-Id: <3B757800.E0017A4C@acm.org>

Simon Best wrote:
> 
> Thanks for your offerings, but I've pretty much settled on something
> like this:
> 
>         sub MatchyThing( $@ )
>         {
>             my ( $string, @patterns ) = @_;
> 
>             for( my $offset = 0; $offset <= length $string; ++$offset )
>             {
>                 foreach $pattern ( @_ )
>                 {
>                     if( substr( $string, $offset ) =~ m/^$pattern/ )
>                     {
>                         return ( $pattern, $offset );
>                     }
>                 }
>             }
>             return ();
>         }
> 
> It works through the string gradually, checking all the patterns at each
> offset from the start of the string.  That way, the amount of pattern
> searching is reduced to something like the amount of pattern searching
> that would be done with:
> 
>         my $patterns = '(' . join( ')|(', @patterns ) . ')';
>         $string =~ m/$patterns/;
> 
> The pattern match /^$pattern/ is the key to it, as it limits each
> pattern match attempt to the start of each substring.  (Though it
> doesn't work with patterns that already start with ^, but it wouldn't be
> difficult to add an extra bit to the function to handle such cases.)

Yes, use \Q and \E to handle this.

                if( substr( $string, $offset ) =~ m/^\Q$pattern\E/ )


John
-- 
use Perl;
program
fulfillment


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

Date: Sat, 11 Aug 2001 16:38:03 -0400
From: "Gerhard" <gerhardpremovethis@inch.com>
Subject: Re: NET::FTP and other file operations
Message-Id: <9l453r$7c2v2$1@ID-35855.news.dfncis.de>

Well, there was no bug at all, it had to do with when the buffer to the file
is flushed.  But thanks for your help anyway

Gerhard

"gnari" <gnarinn@hotmail.com> wrote in message
news:997377163.753419280052185.gnarinn@hotmail.com...
> In article <9kt24u$6hdbo$1@ID-35855.news.dfncis.de>,
> Gerhard <gerhardpremovethis@inch.com> wrote:
> >I'm not sure if anyone else has come across this, but here it is:
> >
> >I have this short script that retrieves some files using Net::FTP.  In it
I
> >also want to do some logging to a text file.
> >Seems that when I do a $ftp->get($file);   I can no longer log to a text
> >file.  (print LOG "[$when] $script: $msg\n";)  LOG is of course the
handle
> >to that text file.
> >
> >Is there something about the $ftp->get() that knocks out other file
handles?
> >
>
> I am sure it is just a bug in your code.
>
> post a short complete script that exhibits your problem and we will
> take a look at it. the odds are that just by doing that you will find the
> problem yourself.
>
> gnari




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

Date: Sat, 11 Aug 2001 19:25:56 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: perldoc is like Greek to a beginner??
Message-Id: <3b758694.ac$52@news.op.net>

In article <3b74127b.86043433@news.compuserve.com>,
 <MSherrill@compuserve.com> wrote:
>When I read that, it dawned on me that I don't know *any* syntax for
>regular expressions besides the Unix-ish derivatives.  What are the
>alternatives on other platforms? 

Regular expressions predate unix, and the notation hasn't varied much
since they were invented.  (Originally by neurologists describing the
behavior of state machines(!!))  The original conception only had
concatenation *, and |, and used + in place of |, but it's the same
idea.  When Ken Thompson showed in 1968 that regexes could be used to
describe an effective pattern matching language, he followed the
existing notation.  He then incorporated his idea into Unix.

>*Are* there alternatives on other platforms?

Consider the unix and DOS shell languages for matching filenames:

        a*.jp?

is equivalent to the regex /^a.*\.jp.$/

Very few systems have the same power as regexes.  People occasionally
propose notations like this:

        <regex>
        <start-anchor/>
        <literal value="a">
        <star><anychar /></star>
        <literal value=".jp">
        <anychar />
        <end-anchor/>
        </regex>

but as far as I know none has even been implemented until just
recently because there wasn't enough stupidity stockpiled in one place
to make it seem like a good idea.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sat, 11 Aug 2001 19:40:25 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: perldoc is like Greek to a beginner??
Message-Id: <3b758a29.125$2c7@news.op.net>

In article <slrn9n8lec.8dn.abigail@alexandra.xs4all.nl>,
Abigail <abigail@foad.org> wrote:
>Or XML, the not al all popular and extremely verbose language.

<element name="addressBook">
  <zeroOrMore>
    <element name="card">
      <element name="name">
        <anyString/>
      </element>
      <element name="email">
        <anyString/>
      </element>
      <optional>
        <element name="note">
          <anyString/>
        </element>
      </optional>
    </element>
  </zeroOrMore>
</element>

I did not make this up.

        http://www.thaiopensource.com/trex/tutorial.html

Now, it's interesting to note that this can be written in an
equivalent format which is much more readable and compact:

        (element "addressBook"
          (zeroOrMore
            (element "card" 
              (element "name"  (anyString))
              (element "email" (anyString))
              (optional (element "note" (anyString))))))


I think it's a tribute to the loathing that people have for Lisp that
the XML version is deemed superior.  The XML version is harder to
parse, harder to read, harder to edit, and takes up three times as
much screen space and 60% more disk space.  The only benefit that the
XML version appears to have is that it doesn't look like Lisp, which
everyone thinks they hate.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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


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