[23163] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5384 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 18 09:05:39 2003

Date: Mon, 18 Aug 2003 06:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 18 Aug 2003     Volume: 10 Number: 5384

Today's topics:
        Accessing an F key (yoram)
    Re: Accessing an F key <gellyfish@gellyfish.com>
    Re: Accessing an F key <peter@semantico.com>
    Re: comp.lang.perl.open.discussion rfc in alt.config (aka ? the Platypus)
        file size test error (Tamas)
    Re: file size test error <abigail@abigail.nl>
    Re: how to rename 200 files in many sub-directories? <noreply@gunnar.cc>
    Re: how to rename 200 files in many sub-directories? <geoff.cox@blueyonder.co.uk>
    Re: how to rename 200 files in many sub-directories? <krahnj@acm.org>
    Re: how to rename 200 files in many sub-directories? <geoff.cox@blueyonder.co.uk>
    Re: Hudson River <tassilo.parseval@rwth-aachen.de>
    Re: Hudson River <tassilo.parseval@rwth-aachen.de>
    Re: Hudson River <me@privacy.net>
    Re: mod_perl 2 Setup ? <welton_bob@nospam_hotmail.com>
    Re: mod_perl 2 Setup ? <rbaba99@caramail.com>
    Re: Order of evaluation of expressions <abigail@abigail.nl>
    Re: Problem with join and unicode <flavell@mail.cern.ch>
        Strange problem with perl-oracle <alessandro.lagostena@tin.it>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 18 Aug 2003 01:36:48 -0700
From: yoramd@ealaddin.com (yoram)
Subject: Accessing an F key
Message-Id: <9a61996d.0308180036.2b886751@posting.google.com>

Hi,

Does someone know how can I access an F key using an html link,
javascript, form object.

I need to open a full screen window (like pressing F11) after a link
or a button was pressed in the web page.

Thanks


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

Date: Mon, 18 Aug 2003 08:51:37 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accessing an F key
Message-Id: <ts00b.15$Yx6.4859@news.dircon.co.uk>

yoram <yoramd@ealaddin.com> wrote:
> 
> Does someone know how can I access an F key using an html link,
> javascript, form object.
> 
> I need to open a full screen window (like pressing F11) after a link
> or a button was pressed in the web page.
> 

You will want to ask this question in a javascript or browser specific
newsgroup.  There will be no Perl content in the answer.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Mon, 18 Aug 2003 10:01:40 +0100
From: Peter Hickman <peter@semantico.com>
Subject: Re: Accessing an F key
Message-Id: <3f4095f5$0$12653$afc38c87@news.easynet.co.uk>

yoram wrote:
> Hi,
> 
> Does someone know how can I access an F key using an html link,
> javascript, form object.
> 
> I need to open a full screen window (like pressing F11) after a link
> or a button was pressed in the web page.
> 
> Thanks

Man walk into a butchers

Man:     "I would like a pair of size 9 shoes please"
Butcher: "Sir, we are a butchers not a shoe shop"
Man:     "Whats the difference, steaks and shoes come form the same animal"
Butcher: "We are skilled in the art of butchery, you should seek a cobbler"
Man:     "Look I've come here looking for shoes. Are you going to help me"
Butcher: * Demonstrates the use of a cleaver *
Man:     "Aaaargh......"
Butcher: "Leave this establishment and darken our door no more"



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

Date: Mon, 18 Aug 2003 12:12:47 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@dformosa.zeta.org.au>
Subject: Re: comp.lang.perl.open.discussion rfc in alt.config
Message-Id: <slrnbk1glu.6cf.dformosa@dformosa.zeta.org.au>

On Sun, 17 Aug 2003 22:07:38 -0700, hudson
<scripts_you_know_the_drill_@hudsonscripting.com> wrote: 
> On Mon, 18 Aug 2003 00:28:21 GMT, "David Formosa (aka ? the Platypus)"
><dformosa@dformosa.zeta.org.au> wrote:
> 
>>>   comp.lang.perl.misc.according-to-hudson
>>
>>Comes off a misc.
> 
> hehe...can we do this??

I'm awfully tempted to newgroup alt.fan.hudson

-- 
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.


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

Date: 18 Aug 2003 01:50:38 -0700
From: tamashee@yahoo.com (Tamas)
Subject: file size test error
Message-Id: <a10ea509.0308180050.62193d2b@posting.google.com>

Hi,
   I am getting two different results on testing a file size. Any explanations?

Preamble: 
   use constant SIZE_LIMIT => 1000;
   my $fl = "/dir/oneBigFile";

Scenario 1:
   my $size = -s $fl;
   if ($size > SIZE_LIMIT) {
      print "Got big file\n";
   }

Scenario 2:
   if (-s $fl > SIZE_LIMIT) {
      print "Got big file\n";
   }


Why does prog snippet (1) works fine but not (2), if $fl is > 1000 bytes.
Thanks in advance,
--
Tamas


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

Date: 18 Aug 2003 08:55:19 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: file size test error
Message-Id: <slrnbk153n.srs.abigail@alexandra.abigail.nl>

Tamas (tamashee@yahoo.com) wrote on MMMDCXXXIX September MCMXCIII in
<URL:news:a10ea509.0308180050.62193d2b@posting.google.com>:
,,  Hi,
,,     I am getting two different results on testing a file size. Any explanations?
,,  
,,  Preamble: 
,,     use constant SIZE_LIMIT => 1000;
,,     my $fl = "/dir/oneBigFile";
,,  
,,  Scenario 1:
,,     my $size = -s $fl;
,,     if ($size > SIZE_LIMIT) {
,,        print "Got big file\n";
,,     }
,,  
,,  Scenario 2:
,,     if (-s $fl > SIZE_LIMIT) {
,,        print "Got big file\n";
,,     }
,,  
,,  
,,  Why does prog snippet (1) works fine but not (2), if $fl is > 1000 bytes.
,,  Thanks in advance,


What do you think we are? Gurus that work with divine powers?
You say you get two different results, but you don't tell use which
two results you got.

I'm only getting identical results.


Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


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

Date: Mon, 18 Aug 2003 10:32:50 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <bhq30h$1thh0$1@ID-184292.news.uni-berlin.de>

Geoff Cox wrote:
> Getting close now! I have not yet understood to to use Archive::Zip
> code though - could you give me a few lines of code to show how
> you get the names of the zip files, extract the doc file within the
> zip file and then rename it?!  I know this is asking a lot but am
> stuck at the moment and cannot find any basic tutorial stuff for
> this!

Have you considered to check the module docs?
http://search.cpan.org/author/NEDKONZ/Archive-Zip-1.06/lib/Archive/Zip/FAQ.pod

The distribution includes quite a few examples:
http://search.cpan.org/src/NEDKONZ/Archive-Zip-1.06/examples/

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 18 Aug 2003 11:00:34 +0100
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <gn81kv813hstfn1bqnflte9j1c1tmf5vo0@4ax.com>

On Mon, 18 Aug 2003 10:32:50 +0200, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:

Gunnar,

thanks for the info - have been there but having difficulty getting
started! 

I can traverse the directories and expand the zip files using
File::Find but not so far with Archive::Zip ...

How do I use Archive::Zip to go through all the sub-directories of say
c:\docs without having to give all the sub-directory paths? 

Also how do I rename the 1 MS Word doc which is in each zip file to
have the name of the parent zip file?

Thanks

Geoff


>Geoff Cox wrote:
>> Getting close now! I have not yet understood to to use Archive::Zip
>> code though - could you give me a few lines of code to show how
>> you get the names of the zip files, extract the doc file within the
>> zip file and then rename it?!  I know this is asking a lot but am
>> stuck at the moment and cannot find any basic tutorial stuff for
>> this!
>
>Have you considered to check the module docs?
>http://search.cpan.org/author/NEDKONZ/Archive-Zip-1.06/lib/Archive/Zip/FAQ.pod
>
>The distribution includes quite a few examples:
>http://search.cpan.org/src/NEDKONZ/Archive-Zip-1.06/examples/



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

Date: Mon, 18 Aug 2003 10:25:57 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <3F40A99D.5A57D6B8@acm.org>

Geoff Cox wrote:
> 
> On Sun, 17 Aug 2003 17:53:08 GMT, Bart Lateur <bart.lateur@pandora.be>
> wrote:
> 
> >With Perl? Nah.... you'd better use Archive::Zip. From the docs:
> 
> Getting close now! I have not yet understood to to use Archive::Zip
> code though - could you give me a few lines of code to show how you
> get the names of the zip files, extract the doc file within the zip
> file and then rename it?!  I know this is asking a lot but am stuck at
> the moment and cannot find any basic tutorial stuff for this!


Something like this:

use warnings;
use strict;

use File::Find;
use Archive::Zip;

my $dir = 'c:/docs';

find( sub {
    ( my $name = $_ ) =~ s/\.zip$/.doc/i or return;
    my $zip = Archive::Zip->new( $_ );
    $zip->extractMember( ($zip->memberNames)[ 0 ], $name );
    unlink $_ or warn "Cannot delete $_: $!";
    }, $dir );

__END__



John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 18 Aug 2003 11:58:55 +0100
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: how to rename 200 files in many sub-directories?
Message-Id: <p9c1kv087bkoh00rmuo7uv767imh0pp29t@4ax.com>

On Mon, 18 Aug 2003 10:25:57 GMT, "John W. Krahn" <krahnj@acm.org>
wrote:

>Something like this:

John,

many thanks ! works like a dream ... will now try to understand your
code!

Cheers

Geoff

>
>use warnings;
>use strict;
>
>use File::Find;
>use Archive::Zip;
>
>my $dir = 'c:/docs';
>
>find( sub {
>    ( my $name = $_ ) =~ s/\.zip$/.doc/i or return;
>    my $zip = Archive::Zip->new( $_ );
>    $zip->extractMember( ($zip->memberNames)[ 0 ], $name );
>    unlink $_ or warn "Cannot delete $_: $!";
>    }, $dir );
>
>__END__
>
>
>
>John



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

Date: 18 Aug 2003 07:33:38 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Hudson River
Message-Id: <bhpvgi$daj$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Abigail:

> Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on
> MMMDCXXXVIII September MCMXCIII in
> <URL:news:bhot4i$27o$1@nets3.rz.RWTH-Aachen.DE>:
> ,,  
> ,,  The real question remains: Why is your own solution better than CGI?
> ,,  CGI works just as well when used in a very restricting compartement.
> 
> 
> Actually, it has always amazed me why using a dinosaur module like CGI
> is considered "good programming" if all you need is parameter parsing.

Using it doesn't automatically turn you into a good programmer. Right so
far.

> I'm not at all surprised that people use the commonly see 'read_parse'
> subroutine (I wonder why people keep calling that 'handrolled' - it's the
> same code you see over and over again. This is code reuse, although it's
> code that doesn't cover all cases (not that I can recall ever seeing a
> posting here complaining that not all cases are covered)). 

The routine used is indeed commonly seen (with some slight variations).
What strikes me though is the fact that it is always this incomplete
version. I am not sure whether most people who copy and paste this code
are aware of that. 

> 'read_parse' is about 10 lines of code, and not to hard to understand.
> The manual of CGI.pm is 3226 lines. And it's doing all kinds of stuff
> that isn't at all CGI related. I'd expect a new version of CGI.pm that
> sends out mail any day now.

I wont argue about that. I don't like the interface of CGI either. The
module is heavy, bloated and just does too much. Since I hardly do CGI
things I always end up grepping through the perldocs to find a
particular function when I need it.

> I remember the days when you could write the entire CGI specification
> on less than one sheet of A4 paper. CGI is *simple*, but CGI.pm isn't.

Actually, CGI.pm is very simple. To realize that however you need to
have read the whole documentation. The module lacks a function
reference. The documentation is more like a tutorial for me (which
becomes extremely tedious to work with once you've understood how it
works).

> And yes, I've "rolled my own parsing" as well, and it certainly didn't
> cover all cases either. It doesn't always have to.

But you knew in beforehand which cases you needed to cover. I find the
crowd of people arguing against CGI disturbing. With the exception of
you and Gunnar, those are mostly beginners or - and that is worse since
it makes all my alarm bells ring - Godzilla. These discussions follow a
certain scheme: Beginner argues that CGI parsing is simple, regulars
contradict. That goes on for a while till beginner triumphantly shows a
variation of 'read_parse'. When it's pointed out to him that this in
fact is not CGI because, on average, it just covers half of it, he
begins to confine his requirements to POST, '&' as the only separator
and so on. Had he done that before exhibiting the code, it would have
been alright.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: 18 Aug 2003 07:49:15 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Hudson River
Message-Id: <bhq0dr$e47$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Alan J. Flavell:

> On Mon, Aug 17, Tassilo v. Parseval inscribed on the eternal scroll:
> 
>> I wonder though why one would want to allow only one method but not the
>> other one anyway.
> 
> In principle, the key to that is idempotence.  Although there can be
> other practical issues involved.
> 
> If you're implementing a form which performs a non-idempotent action,
> such as casting a vote, ordering a flight ticket, etc. then it would
> be wise to refuse to accept a GET submission.  I think you'll find
> more about it in RFC2616.
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Interesting. It's the first time I hear about idempotence in relation to
HTTP.

>> Especially when considering that CGI.pm has $POST_MAX
>> that can be used to restrict the length of requests.
> 
> With respect, I think you're focussing on a peripheral issue.

Possibly so. I didn't know about the above distinction.

Did I already mention that I seldom program in the CGI (and HTTP)
compartment? ;-)

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Mon, 18 Aug 2003 23:11:19 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: Hudson River
Message-Id: <bhqc62$1tq0i$1@ID-172104.news.uni-berlin.de>


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:bhntk8$1ak8t$1@ID-184292.news.uni-berlin.de...
> Tintin wrote:
> > The main point (and it's been made many, many times) is that
> > posting bad code has consequences later on when Joe newbie does a
> > Google search, finds a piece of code which appears to work for them
> > and they start using it production code.
>
> Is that the main point?

One of the main points at least.

>
> I don't defend the use of "bad" code. But I do reserve me the right to
> use code that does what I need it to do in *my* program, even if it
> wouldn't work in anybody else's programs.

I'm not arguing that you don't have the right to use whatever code you like
in *your* program.  The problem occurs when someone either posts their bad
code as a solution to someones problem/question or like our new troll, they
claim they know it all and post their code as an example of their
"excellence".




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

Date: Mon, 18 Aug 2003 10:42:21 +0100
From: "Bob Welton" <welton_bob@nospam_hotmail.com>
Subject: Re: mod_perl 2 Setup ?
Message-Id: <bhq7ak$1ta$1@news.freedom2surf.net>

Thanks Sam,

I have the following structure:

/mysite.com/cgi-bin/index.pl            + a few other .pl's
/mysite.com/perl/directories/###.pm    + all my .pm's for the application

Currently I have the Directory and Alias pointing to /mysite.com/perl  path
If I point it to the higher directory  /mysite.com   or  to
/mysite.com/cgi-bin  I get a Server Error 500 when trying to browse the web
site.

I have setup the test index.pl, set the chmod permissions and pointed to it
in the Alias and Directory settings of  perl.conf. However when browsing it
I get the Server error ! Error 500 page returned.

Reverting it index.pl to my  site version, however works ok.... but slow

Any other suggestions ?


"sam" <rbaba99@caramail.com> wrote in message
news:bhosud$1fjj$1@news.cybercity.dk...
> > mmm can I clarify: Where should the 'Alias' and '<Directory' point to ?
>
> It shoud point to the location where your scripts are.
> Your index.pl must be in this directory.
> Set the permission of this directory to 0777.
>
> > chmod 0777 /var/www/perl
>
> This is very very insecure and you should not follow this approach on the
> production machine. This is good enough when you just want to try things
out
> and want to have as few obstacles as possible.
>
> Try first with and index.pl that contains this:
>
> #!/usr/bin/perl
> print "Content-type: text/plain\r\n\r\n";
> print "mod_perl rules!\n";
>
>
> >chmod 0755 /var/www/perl/index.pl
>
> and point your browser to : http://your_server/perl/index.pl
>
> Hope this helps.
>
>




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

Date: Mon, 18 Aug 2003 13:54:48 +0200
From: "sam" <rbaba99@caramail.com>
Subject: Re: mod_perl 2 Setup ?
Message-Id: <bhqeko$4od$1@news.cybercity.dk>

I can't see the problem with the infos you give.
I have the same configuration as you: redhat, apache2,...
and all is fine.

Try with adding "Allow from all" to the directory list of directives:
<directory /var/www/perl>
 ....
 ....
 ....
Allow from all
</directory>

Please send your httpd.conf file to help?
Hide all the private infos (IPs and domain names)
from your httpd.conf file before you send it :-)





"Bob Welton" <welton_bob@nospam_hotmail.com> wrote in message
news:bhq7ak$1ta$1@news.freedom2surf.net...
> Thanks Sam,
>
> I have the following structure:
>
> /mysite.com/cgi-bin/index.pl            + a few other .pl's
> /mysite.com/perl/directories/###.pm    + all my .pm's for the application
>
> Currently I have the Directory and Alias pointing to /mysite.com/perl
path
> If I point it to the higher directory  /mysite.com   or  to
> /mysite.com/cgi-bin  I get a Server Error 500 when trying to browse the
web
> site.
>
> I have setup the test index.pl, set the chmod permissions and pointed to
it
> in the Alias and Directory settings of  perl.conf. However when browsing
it
> I get the Server error ! Error 500 page returned.
>
> Reverting it index.pl to my  site version, however works ok.... but slow
>
> Any other suggestions ?
>
>
> "sam" <rbaba99@caramail.com> wrote in message
> news:bhosud$1fjj$1@news.cybercity.dk...
> > > mmm can I clarify: Where should the 'Alias' and '<Directory' point to
?
> >
> > It shoud point to the location where your scripts are.
> > Your index.pl must be in this directory.
> > Set the permission of this directory to 0777.
> >
> > > chmod 0777 /var/www/perl
> >
> > This is very very insecure and you should not follow this approach on
the
> > production machine. This is good enough when you just want to try things
> out
> > and want to have as few obstacles as possible.
> >
> > Try first with and index.pl that contains this:
> >
> > #!/usr/bin/perl
> > print "Content-type: text/plain\r\n\r\n";
> > print "mod_perl rules!\n";
> >
> >
> > >chmod 0755 /var/www/perl/index.pl
> >
> > and point your browser to : http://your_server/perl/index.pl
> >
> > Hope this helps.
> >
> >
>
>




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

Date: 18 Aug 2003 07:39:57 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Order of evaluation of expressions
Message-Id: <slrnbk10md.srs.abigail@alexandra.abigail.nl>

Eric J. Roode (REMOVEsdnCAPS@comcast.net) wrote on MMMDCXXXIX September
MCMXCIII in <URL:news:Xns93DAD6841E7E9sdn.comcast@206.127.4.25>:
~~  -----BEGIN xxx SIGNED MESSAGE-----
~~  Hash: SHA1
~~  
~~  mjd@plover.com (Mark Jason Dominus) wrote in news:bhok6j$70f$1@plover.com:
~~  
~~ > Is this:
~~ > 
~~ >         @s = qw(a b);
~~ >         $z = shift(@s) . shift(@s);
~~ >         print $z;
~~ > 
~~ > guaranteed to print "ab"?
~~ > 
~~  
~~  Yes.  Unlike C, Perl's order-of-evaluation is well-defined.


Where is its order of evaluation documented? Where in the documentation
does it say that:

    @a = (3, 4, 5);
    $z = shift (@a) + shift (@a) * shift (@a);
    print $z;

results in 23 being printed?


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


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

Date: Mon, 18 Aug 2003 13:19:37 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Problem with join and unicode
Message-Id: <Pine.LNX.4.53.0308181138570.11104@lxplus064.cern.ch>

On Sun, Aug 17, derek / nul inscribed on the eternal scroll:

> Alan, thanks for that.
> At least I am not going mad.

Yes, at this stage at least I think I owe you an apology.

I've worked sufficiently with unicode data in Perl 5.8 in unix-ish
situations to feel that I have a confident grasp of the character
handling features; I'm afraid I had taken it for granted that it was
going to work reasonably in Windows too.  But unless someone can show
a vital bit of magic that I'm missing, then at the moment I'm afraid I
can't see it working in quite the way I had intended.

The data characters work just great, but the newlines are shot to
hell, and in fact I found that it's even worse with output than I had
already described for input.  I've ended up with an output file, meant
to be utf16le format, which "od -x"[1] says contains the following
piece of nonsense:

 ... 000d 0a0d 0d00 0d00 000a ...

which is clearly useless.

[1] "od" is a Cygwin command.

I played with the WIDE_SYSTEM_CALLS setting but it doesn't seem to
make any difference.

> I had got to the point where I knew that x0d0a was part of the
> problem, I just didn't know why.

I think at this stage (and unless/until someone produces a working
answer) your previous approach - which I was at first trying to avoid
- is indeed going to offer a more practical way right now: read/write
in binmode(), and do the encode/decode of the data as an explicit
move, separate from newline handling. (But that can all be packaged
together as reading and writing routines, with a clean programming
interface to the rest of the code.)

I'd urge you to start by playing with a cut-down program which does
little more than read the input, print whatever diagnostics you think
fit to the "console" (STDOUT), and print the data to an output file.

When you can accurately reproduce the input file in the output file,
and feel you understand how and why it's working, then it's time
enough to build up to the specific program that you wanted to get.
That's my advice, for what it's worth, anyway (which may not be very
much, after this incident with the newlines...)

all the best


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

Date: Mon, 18 Aug 2003 11:39:49 GMT
From: "alessandro.lagostena" <alessandro.lagostena@tin.it>
Subject: Strange problem with perl-oracle
Message-Id: <9W20b.13097$zN5.386357@news1.tin.it>


Hello Gents

I have strange problem with a perl script that query a Oracle DB


I have installed  Perl 5.005 +CPAN DBI and driver Oracle on 2 Sun  BOX 
with Solaris 2.7 and Oracle *
Thoericaly the box have the same configuration

Solaris 2.7
Perl 5.005 + CPAN (Same kit copied from a third )server
jdk 1.2.2
Same unix env
Same Db Oracle
If i run a simple program (see below)  for access a oracle db on server 
A all work fine BUT on server B i see a stranges message realted the 
java env (see below)


#----------------------------------------------------------------------------------------------
#Source code
#!/usr/local/bin/perl
     use DBI;
     use File::Basename;
     use URI::Escape;

     my $dbh;
#
     $OSNAME=lc($^O);                        # extract O.S name
     if ( $OSNAME eq "mswin32" ) {$DRIVER="ODBC";}         # Use ODBC 
for solve problem with blobs
     else             {$DRIVER="Oracle";}
#
# Connect to database
#
   $istance="GEWTON01";
   $username="wtadmin";
   $password="xxx";
#
   print "DRIVER=$DRIVER ISTANCE=$istance USERNAME=$username 
PASSWORD=$password \n";
#
    my $dbh = DBI->connect( "dbi:$DRIVER:$istance",
                                         $username,
                                         $password,
                         {AutoCommit => 0,
                          RaiseError => 1,
                          PrintError => 0 ,
                          LongReadLen=> 512000 } )
#
    or  die $DBI::errstr;
#
     my $cm     ="SELECT TNAME FROM TAB";
     &debug ( "cm=$cm" );
     my $sth = $dbh->prepare($cm);
     $sth->execute;
#
     while ( $h_ref =$sth->fetchrow_hashref('NAME_uc') )
     {

          %table=%$h_ref;
          print $table{"TNAME"};
     }
#
     $sth->finish;    # Close the query
#
     $dbh->disconnect;
#----------------------------------------------------------------------------------------------
#Result

perl  /tmp/provadb.pl

DRIVER=Oracle ISTANCE=WCCOE3 USERNAME=wtadmin PASSWORD=xxx

You must install a Solaris patch to run this version of the Java runtime.
Please see the README and release notes for more information.
  I think that the errors appears when the program try to connect at the DB

I have compared the 2 box but seams equals , objvius a difference are 
present but i not know where find it

Can someone have some sudgestion about this probelm ?

Thanks for the support

Regards LAGO



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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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


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