[19353] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1548 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 17 06:05:30 2001

Date: Fri, 17 Aug 2001 03: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)
Message-Id: <998042707-v10-i1548@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 17 Aug 2001     Volume: 10 Number: 1548

Today's topics:
    Re: "shifting" values of the @_ array?? (Yves Orton)
    Re: &my_sub($arg) or die "$!"; nobull@mail.com
        capitalisation/DBD/mysql <paul@net366.com>
    Re: Comma's at end of list can break program?? <david.bouman@nl.xo.com>
        cookie question <dvdw@plan.be>
    Re: cookie question nobull@mail.com
    Re: delete duplicate records <Graham.T.Wood@oracle.com>
    Re: Importing subroutines into the CORE::GLOBAL package nobull@mail.com
        Is MD5 in standard installation <john@availcheck.com>
    Re: OT: Why is there so much white space in perl docume (Yves Orton)
    Re: perldoc is like Greek to a beginner?? (Yves Orton)
    Re: Problem with two versions of Perl installed <coupdeforce@hotmail.com>
        Processing a scalar in the same way of a filehandle (Miguel Manso)
    Re: Self-Searchable Perl documention - Extremely Useful (John Holdsworth)
    Re: SQL (MySQL) Windows <paul@net366.com>
    Re: Statement modifiers?? nobull@mail.com
        system() function, win32, and stdin (?) (Lee Feigenbaum)
    Re: Text::Wrap/ANSI proplem (Anno Siegel)
    Re: Using manpages?? <miscellaneousemail@yahoo.com>
    Re: what does this message mean? <l_pantin@hotmail.com>
    Re: what does this message mean? <maxim68@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 17 Aug 2001 02:52:45 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: "shifting" values of the @_ array??
Message-Id: <74f348f7.0108170152.7d42e73c@posting.google.com>

Ren Maddox <ren@tivoli.com> wrote in message news:<m38zgk3w02.fsf@dhcp9-161.support.tivoli.com>...
> On 16 Aug 2001, demerphq@hotmail.com wrote:
> 
> > sub bar {
> >   $_="Hello!";
> 
> Should be:
> 
>     $_[0] = "Hello!";
> 
> > }
> > 
> > my $s="Dude!";
> > bar($s);
> > print $s; #prints Hello!

Yes.  I wrote it in google, copied it and tested (fixed) it in my dev
enviornment and then.... forgot to past it back.

My apologies.

I really have to remember to do stuff in the opposite order....

Yves


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

Date: 17 Aug 2001 08:50:26 +0100
From: nobull@mail.com
Subject: Re: &my_sub($arg) or die "$!";
Message-Id: <u9bslfw1t7.fsf@wcl-l.bham.ac.uk>

Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> writes:

> 		$! = 1; # = "permission denied"

Unless optomising for speed / size over readability / mantainability /
portability I think error constants are better written like:

  require Errno;
  $! = Errno::EPERM();
 
-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 17 Aug 2001 10:15:55 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: capitalisation/DBD/mysql
Message-Id: <998039680.28140.0.nnrp-10.9e98cea3@news.demon.co.uk>

Old thread was getting confusing ...

On Windows 2000, ActivePerl, IIS
I have installed, using PPM

    DBD
    DBI::mysql

which appear to have worked.

I write in .pl

    use CGI;

now either

    DBI->install_driver('mysql'); OR
    DBI->connect(DBI:mysql:database=d;hostname=localhost);

produce

    'Perhaps the capitalisation of DBD 'mysql' isn't right. at sql.pl line
18'

There's a zillion of these on Google, none with an answer, except it sounds
like the installation of DBD::mysql is not correct. Is there any way I can
trash it and start again, and if so, can I tell PPM where to get the right
one? I hear of tar and gz but these sound UNIX-like which I do not speak!

PS ->available_drivers produces
    ADO
    ExampleP
    Multiplex
    Mysql
    Proxy
    mysql
    1
which looks like a clue.

Hopefully .... Paul




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

Date: Fri, 17 Aug 2001 10:55:09 +0200
From: David Bouman <david.bouman@nl.xo.com>
Subject: Re: Comma's at end of list can break program??
Message-Id: <3B7CDBED.A74E6361@nl.xo.com>

Ren Maddox wrote:

> Not that I recommend it, but sticking a "()" on the first line solves
> the problem:
>
> ..snipped..

Indeed, better not do that. 

> It seems kind of silly that Perl complains about a leading comma in
> this situation since multiple embedded commas works fine.

Hmm, didn't think of that, but now that you mention it, perhaps this can be
"fixed"?

--
David


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

Date: Fri, 17 Aug 2001 08:17:14 +0200
From: Dominique van der Wal <dvdw@plan.be>
Subject: cookie question
Message-Id: <3B7CB6EA.C60BC0FD@plan.be>

Hi from Belgium,

just a question about damned cookies....


I've a perl cgi which send cookies to the user. The cgi perform a
sendcookie (with the print header(-cookie=$mycookie) ) and after I make
a read of the cookie (with a %thenewcookie =  cookie('cookiename') )

The problem is that the read doesn't reflect the new cookie but the
cookie before the sending of the new values.

The code
---------

$the_cookie = cookie(-name=>'testingcookies',
                                  -value=>\%mybasket,
                                  -path=>'/cgi-bin/',
                                  -expires=>'+1h');
print header(-cookie=>$the_cookie);


%newbasket = cookie('testingcookies');

The content of %newbasket is not the same than the content of %mybasket.
Can I perform a read of the cookie just after the write ? Is there a
cache problem ?

Any idea ?
Dominique van der Wal



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

Date: 17 Aug 2001 08:52:26 +0100
From: nobull@mail.com
Subject: Re: cookie question
Message-Id: <u98zgjw0vf.fsf@wcl-l.bham.ac.uk>

Dominique van der Wal <dvdw@plan.be> writes:

> Subject: Re: cookie question

Lazy subject line. Please try harder. How about:

Subject: Reading cookie within same CGI in which it is set

> I've a perl cgi which send cookies to the user. The cgi perform a
> sendcookie (with the print header(-cookie=$mycookie) ) and after I make
> a read of the cookie (with a %thenewcookie =  cookie('cookiename') )

You do not have the correct mental model of HTTP.

The HTTP client sends a request to the HTTP server.  It includes in
that request copies of any cookies from its jar that pertain the to
requested URL.  The server sends an HTTP response that may contain
updates the state of the client's cookie jar.
 
Nothing in the HTTP response can travel back in time and change the
HTTP request.

> The problem is that the read doesn't reflect the new cookie but the
> cookie before the sending of the new values.

That is correct.

> Can I perform a read of the cookie just after the write ?

No.

> Is there a cache problem ?

Yes, the problem is that you believe that there is a server side
cookie cache and that somehow sending output to the CGI script's
STDOUT would update this.

Please see thread earlier this week dicussing the pros and cons of
adding such caching and a more transparent cookie mecahism to CGI.pm.

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


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

Date: Fri, 17 Aug 2001 09:55:11 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: delete duplicate records
Message-Id: <3B7CDBEE.DBCD3F80@oracle.com>

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

Charles Cowdrick wrote:

> I'm trying to delete duplicate records in a flatfile.
> I searched Google under "delete duplicate records" and the Camel book,
> to no avail.
> Here's my code. I know that line 4 is weird, but I don't know how else
> to compare the current record with the next record.
> #!perl
>
> RECORD: while (<DATA>) {
>     next RECORD if $_ eq $_[$_++];
>  print "$_\n";
> }
>
> print "Duplicates removed.\n";
>
> __DATA__
> NewUser ADAL6322 123456322
> NewUser ADAM2437 123452437
> NewUser ADAM5045 123455045
> NewUser ADAM8340 123458340
> NewUser ADAM8340 123458340
> NewUser ADCO6906 123456906
> NewUser ADCO6906 123456906
> NewUser ADCO9430 123459430

This is a good candidate for using a hash.  You can't have duplicate keys
in a hash so putting your records into one will automatically remove the
duplicates.

open(DATA,"yourfile") || die "Can't open yourfile $!\n";
@data=<DATA>;
close DATA;

@temphash{@data}=1; # the 1 is unimportant, just the setting of a value
for the key is.

@unique_values=(sort keys(%tmphash));

You then have unique values in @unique_values.

Graham Wood

--------------F54A0101742549E081916581
Content-Type: text/x-vcard; charset=UTF-8;
 name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
 filename="Graham.T.Wood.vcf"

begin:vcard 
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard

--------------F54A0101742549E081916581--



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

Date: 17 Aug 2001 08:54:43 +0100
From: nobull@mail.com
Subject: Re: Importing subroutines into the CORE::GLOBAL package does not work (perlbug)
Message-Id: <u9elqbw27w.fsf@wcl-l.bham.ac.uk>

"Murat Uenalan" <murat.uenalan@gmx.de> writes:

> After getting ill not getting it work for me, if found this posting:
> 
>     [ID 20001220.004] CORE::GLOBAL support broken in 5.6.0
> 
> with the above heading at a perl5-porters bug reports.
> 
> Is this true for all perl 5.6+ ? And how to circumvent this ?

The CORE::GLOBAL mechanism in 5.6.0 looks OK to me.

I'd guess this is simply a bogus bug report.  I'm further guessing
that nobody has closed it because in the absence of a recipie to
reproduce the OP's problem it is impossible to proove that the report
is bogus.

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


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

Date: Fri, 17 Aug 2001 09:23:46 GMT
From: "John P" <john@availcheck.com>
Subject: Is MD5 in standard installation
Message-Id: <Co5f7.201$EV3.39707@news1.cableinet.net>

Hi there All (I posted this yesterday but I couldn't see my postings or any
replies due to a fault so sorry if you've seen or replied to this already)

I am distributing scripts which have the line.
use Digest::MD5 qw (md5_base64);

Most of the time the scripts are fine but on some systems the users are
getting the error message

Can't locate Digest/MD5.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.6.0/i686-linux /usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux
/usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .)

I thought that this was a standard module. found in a standard location.
Does anyone have any ideas please. I have asked them to check their Shebang
lines are correct but they still get the error. I have some rather irrate
customers!

Thanks in advance
John P









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

Date: 17 Aug 2001 00:58:03 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <74f348f7.0108162358.3b3f855b@posting.google.com>

Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote in message news:<MPG.15e5eca4b5e6069a98976a@news.edmonton.telusplanet.net>...
> In article <slrn9no5uf.5sq.tadmc@tadmc26.august.net>, Tad McClellan at 
> tadmc@augustmail.com says...
> 
> > Unix was designed for programmers.
> > 
> > Windows was designed for consumers.

Sorry?  Windows was designed?  I thought it congealed out of the
remains of a crashed C/PM box and slowly mutated into a money maker
for gate$...

:-)

> 
> Good points Tad.  I agree.  
> 
> > Not at all surprising that it easier to program on Unix,
> > it was designed to be easy to program. (because it was
> > programmers doing the designing, and they were designing
> > "for themselves")

Well....  I suppose the Telephone companies that funded the
development of C and Unix and etc didnt care what the programmers
made?

:-)

> 
> Windows sucks as far as a good programming platform.  I have to reboot my 
> computer (was Windows 95, now Windows 98) a minimum of 3 or 4 times a day 

<SNIP standard complaints about using W9sux as dev platform>

> everything is saved, etc. in case Windows crashes again.  Knowing that 
> Windows WILL crash again is always in the back of my mind.   

Two points.  
First, I know enough Linux people who suffer similer problems when
using the various desktops.  I got one desktop (very pretty, very
fragile) to completely crash by repeatadly resizing a window for about
two minutes (I was studing the screen geometry logic)
Second. Switch to NT, or more realistically switch to 2000 (NT5).  I
went from as you say about 3 BSOD's a day on W98 to 1 BSOD a quater on
NT4SP6 to 1 BSOD all this year (because of a bad driver I installed)
on 2000.

Also the kind of control that you expect on a *nix box is _almost_
available on 2000.  Dont bother developing on what is essentially a
Video Game/Home Office OS.  Its like trying to write a webserver on a
nintendo.  (Ok well Im exagerating...)

> I tried Linux once and after installing it about 30 times and then trying 
> to work in it I realized that my productivity would crawl to an almost 
> full stop for a while I learned how to use it. Something I couldn't 
> afford at the time. 

I believe things have moved on a bit. (Or so my colleagues tell me.)

<SNIP>

> No I certainly would not use the poor tool that Windows is as an excuse 
> for not trying to look things up myself but I'll tell you what.  It's 
> frustrating sometimes to work on Windows.  I mean just today I was trying 
> to install the DBD::CSV module.  It took me about an hour to an hour and 
> a half just to figure out where to get it, how to use the ActiveState PPM 
> installation utility, 

Carlos, I am a lttle concerned to hear that it took you that long to
use ppm.  Its a pretty simple tool compared to CPAN (which still
drives me crazy sometimes! :-)

>                       to look up the DBD docs, to search for some example 
> uses, and so forth.  My productivity as usual came to an absolute crawl 
> trying to find this or that.  It's really frustrating sometimes because I 
> will be hot on the trail of some neat Perl code and swish I end up 
> falling into the quicksand of trying to find some little, itty, bitty, 
> piece of information that takes me an hour or more to find.  

On the other hand you are getting hundreds or thousands of hours of
development work for free.  An hour or so to learn to use it is hardly
unfair.

> My biggest need as a beginning Perl programmer is to establish some kind 
> of system for finding the info that I need when I need it.  I spend 
> probably twice if not three times as much time trying to find things and 
> to answer my own questions than I do writing Perl code.  It's ridiculous 
> but I got to do it. Though I am aiming to do it better without taking so 
> much time at it. 

Its called experience. :-)

As a tip carlos I strongly suggest that if you plan to use a MS based
OS that you do the following.

1. Switch to one of the NT based OS's.  W2000 is probably the stablest
and easiest to use.
2. Find and download the full set of Cygwin utilities.  These include
virtually all of the standard unix tools, but for an MS os.  This
includes a replacement shell called Bash.
3. Go to www.sysinternals.com and download any and all tools that they
offer for free for your OS (whichever it is that you decide)  Some of
these tools are great.

Cheers,
Yves
Just Another Perl Lover


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

Date: 17 Aug 2001 02:41:25 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: perldoc is like Greek to a beginner??
Message-Id: <74f348f7.0108170141.37eaee6b@posting.google.com>

abigail@foad.org (Abigail) wrote in message news:<slrn9noguo.ksf.abigail@alexandra.xs4all.nl>...
> Yves Orton (demerphq@hotmail.com) wrote on MMCMVII September MCMXCIII in
> <URL:news:74f348f7.0108160121.47f74c15@posting.google.com>:
> __ abigail@foad.org (Abigail) wrote in message news:<slrn9nlrlb.9sn.abigail@alexandra.xs4all.nl>...

> __ > Also, Aho, Hopcroft and Ullman claim that almost every computer language
> __ > is context free, so it would be interesting to see you prove them wrong.
> __ 
> __ Id be interested to see the cite on this one.  It contradicts my
> __ recollection of the red dragon.
> 
> You are probably right. I must misremember. However, from
> the Cindarella book (ch 10, pp 233):
>    It turns out that the syntax of many programming languages can be
>    described by means of DCFL's [deterministic context-free languages //A]
>    Moreover, modern compiler writing systems usually require that the 
>    syntax of the language for whuch they are to produce a compiler be
>    described by a context-free grammar of restricted form. These restricted
>    forms almost invariably generate only DCFL's.

Thanks Abigail.  I'd like to have a look at this Cindarella book. 
Little problem, whats the full title? :-)

Appreciate your getting those cites.  I forgot to check last night.

Yves
Ps (Write a book on your Japh's!  Some of us dont live in NA anymore.
:-) Or for that matter never did....)


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

Date: Fri, 17 Aug 2001 09:16:34 GMT
From: "Coupdeforce" <coupdeforce@hotmail.com>
Subject: Re: Problem with two versions of Perl installed
Message-Id: <Sh5f7.192$7d.58750@newshog.newsread.com>

That's why people don't like the RPM system (and RedHate).  It's always
better to install stuff oneself to avoid these situations.

I would say to make a symbolic link, or copy over the binary (since it's not
going to be used anymore), but I don't understand the RPM system (and why
people use it).




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

Date: Fri, 17 Aug 2001 09:41:36 GMT
From: mmanso@baco.prodigio.pt (Miguel Manso)
Subject: Processing a scalar in the same way of a filehandle
Message-Id: <slrn9nppo3.70r.mmanso@baco.prodigio.pt>

Hi there.

I've a scalar with a bunch of text. I'd like to process it on the
"paragraph" way. It I has a filehandle, I would do this:

$/ = "";
while(<FH>) {
  my $p = $_;
}

perl is wonderful :)

Now, I've $cnt and I'd like to be able to do the same thing. Is it possible?
I've tried some things but none worked :(

Thanks in advance...


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

Date: 17 Aug 2001 02:13:14 -0700
From: coldwave@bigfoot.com (John Holdsworth)
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <2a46b11e.0108170113.4b644705@posting.google.com>

demerphq@hotmail.com (Yves Orton) wrote in message news:<74f348f7.0108120702.662a6771@posting.google.com>...
[edited...]
> > Self searching documents:
> > http://www.openpsp.org/source/util/search.html.gz
> > 
> > Searchable perl docs:
> > http://www.openpsp.org/source/util/perltoc.pl
> > 
> > Disk usage (HTML application):
> > http://www.openpsp.org/source/util/du.hta.gz
>
> These are damn interesting ideas.  I have soooo many uses for this
> stuff its amazing.
> 
> Are you going to post your stuff to CPAN?

Thanks!

I'd like to but how does one go about doing this??
I emailed modules@perl.org in July but have been
answered by what can only be described as a long 
"pause".

john


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

Date: Fri, 17 Aug 2001 09:21:37 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: SQL (MySQL) Windows
Message-Id: <998036421.26803.0.nnrp-10.9e98cea3@news.demon.co.uk>

> It looks like a faulty installation of SQL::Statement.
>
> There is a SQL::Statement on
>
<http://www.activestate.com/PPMpackages/5.6plus/MSWin32-x86-multi-thread/SQL
-Statement.tar.gz>.
> The PPD is one directory up.
>
> Any reason why you don't want to use PPM? If it's a lack of internet
> connection, that can be fixed. Download the PPD file and the .tar.gz
> file, put them next to each other, and edit the PPD file so that the
> HREF attribute for the CODEBASE tag, for the  architecture
> "MSWin32-x86-multi-thread", uses a relative path instead of an absoilute
> URL. Then you can do a local install.
>
> If you insist on manual installation, note that the DLL files should
> come under the directory "auto". Thus:
> "site/lib/auto/SQL/Statement.dll".
>
> --
> Bart.
Right as always, Bart, thanks!
Reason I wasn't using PPM is I didn't understand what it was! I HAVE got a
connection, I am past that error and I think I will be OK now! One day I
will find out how to install things properly.




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

Date: 17 Aug 2001 08:54:06 +0100
From: nobull@mail.com
Subject: Re: Statement modifiers??
Message-Id: <u9itfnw28x.fsf@wcl-l.bham.ac.uk>

yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) writes:

> ctcgag@hotmail.com wrote:
> : Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
> : > Hi everyone,
> : >
> : > Uri stated in another thread...
> : >
> : > "learn to use perl's statement modifiers as it will clean up your
> : > code. one big win for them is reducing the unneeded braces and indents
> : > of simple conditionals..."
> : >
> : > I have looking all over the place for info on statement
> : > modifiers (searching www.perl.com and Google) and have come up with very
> : > scant stuff.
> 
> : When you wish to use a foreach, if, while, unless, etc with only one
> : statement, you can put the statement first, then the modifier, without
> : using braces.
> 
> : die "AAAggg, you idiot, you can't do that" unless $x>0 ;
> 
> : I tend to use them less often than I could get away with due to
> : Murphy's law.  If I use one, it will usually turn out later that
> : I need to add another statement to the construct, and have to rewrite it.
> 
> 
> I have read in the past that a statement modifier was more efficient than
> a block because perl does not run the code that sets up the block scope.

This was true in all except the case of for (aka foreach).  
 
> I do not know if this is still (or was ever?) true.  

AFAIK it's still true.

> Want to access the command line of your CGI account?  Need to debug your
> installed CGI scripts?  Transfer and edit files right from your browser? 
> 
> What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi

Or indeed exec.cgi - which is free and contains one of the few
legitimate uses of an inlined CGI implementation.

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


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

Date: 17 Aug 2001 01:29:18 -0700
From: lee-usenet@thefigtrees.net (Lee Feigenbaum)
Subject: system() function, win32, and stdin (?)
Message-Id: <cd30c788.0108170029.6d51903b@posting.google.com>

Hi everyone,

The problem, in short:

I'm trying to do the following, using perl 5.6.0 on win98 (not
activestate perl):

system("some program", "an arg", "or two");
print "Prompt: ";
my $choice = <STDIN>;
 ...

When I run the code, "some program" executes correctly (i.e., I can
verify that it's side effects are accomplished), the prompt is
displayed, but I cannot eneter any input. That is, whatever I type is
ignored until I hit CTRL+Z (and even then I can't enter any input, the
program just moves on). Additionally, the title bar of the MS-DOS
Prompt window reads "some program" as if the program has not exited.

When I run the program using the same arguments from a standard
prompt, it runs and exits normally.

Any suggestions? I tried invoking the program both with the system()
function as well as with Win32::Process::Create, and both exhibited
the same behavior.

Thanks,
Lee
A CC of any replies to lee-usenet@thefigtrees.net is very much
appreciated.


PS - Some more details, which I suppose may be relevant. The program
in question is convert.exe as part of the ImageMagick suite.
ImageMagick is installed on top of a piecemeal Cygwin installation -
ImageMagick runs fine however from a normal DOS prompt (i.e., I don't
need a bash shell or the like to run it, and it exits normally) I know
that convert.exe is executing correctly because I get my new resized
image. I don't know why convert.exe seems not to be exiting.)

PPS - I know, this is a brutal hack and I should really figure out how
to get PerlMagick compiled, but with my piecemeal cygwin installation
that's a project for another day, and I very much feel like my current
solution is very close to working.


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

Date: 17 Aug 2001 08:51:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Text::Wrap/ANSI proplem
Message-Id: <9lilut$lgn$1@mamenchi.zrz.TU-Berlin.DE>

According to Michael Carman  <mjcarman@home.com>:
> Philip Taylor wrote:
> > 
> >   I've got some text which needs to be wrapped at 50 columns, and
> > Text::Wrap does this fine.
> > 
> > However, there is a problem when the text contains ANSI codes
> >
> > When displayed, the ANSI codes don't take up any space [...]
> > but Text::Wrap doesn't know this and counts the ANSI codes
> > as displayed characters
> >
> > Is there an easy way to make Text::Wrap ignore the codes when
> > calculating the wrapping, but still include them in the printed
> > output?
> 
> Give this a try. (Tested with your example, but may have undiscovered
> bugs.)
> 
> #!/usr/bin/perl -w
> use strict;
> use Text::Wrap;
> 
> $Text::Wrap::columns = 50;
> 
> my $text = "\e[31mThis line of text should appear in the colour
> red\e[0m.\n";
> 
> print my_wrap($text);
> 
> sub my_wrap {
>     my $msg = shift;
> 
>     my @escape = ($msg =~ /(\e\[\d+m)/g);
>     my @location;
> 
>     foreach (@escape) {
>         my $idx = index($msg, $_, 0);   # find
>         push(@location, $idx);          # remember
>         substr($msg, $idx, length, ''); # remove
>     }
>     
>     # wrap without escapes
>     my $line = wrap('', '', $msg);
> 
>     # replace -- must do this in reverse order!!!
>     foreach my $n (reverse 0 .. $#escape) {
>         substr($line, $location[$n], 0, $escape[$n]);
>     }
>     return $line;
> }

In the final (replace-) loop you assume that wrap hasn't changed the
length of the (cleaned-up) $msg.  This isn't true when there is a
word that doesn't fit on one line.  Wrap will then insert a new "\n"
instead of replacing a blank that was already present.  I tried to
cover this case in similar code, but lost patience.

Anno




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

Date: Fri, 17 Aug 2001 07:31:58 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Using manpages??
Message-Id: <MPG.15e67662156ae12a989775@news.edmonton.telusplanet.net>

In article <9liba3$2tu$2@nets3.rz.RWTH-Aachen.DE>, Tassilo v. Parseval at 
Tassilo.Parseval@post.rwth-aachen.de says...

> 
Go to http://www.cygwin.com and download the Cygwin environment. 
>

I have been looking at that Tassilo.  It looks like a winner and I think 
I will install it.  The only problem for me is one of getting up to 
speed.  I mean there is so much to learn that I am experiencing 
information overload.  For every step I go forward I feel like I have to 
backtrack two to have my knowledge catch up with my practice.  If you 
know what I mean.  I can honestly see why so many programmers that start 
on Windows seem to stay in Windows.  

> 
In addition to that: You could use the CPAN as it was meant to use. No 
longer any fiddling with PPM but instead directly using the powerful and 
convenient CPAN-shell for installing and browsing the modules.
> 

That would be nice.  

> 
You'd quickly realize that a _real_ text-mode is much more powerful than 
any click-and-point interface.
> 

That remains to be seen but that's what I have heard. 

I will work on installing cgywin and learning to use it in the next few 
days as you suggested.  Along with getting up to speed in using SQL 
statements (with DBD::CSV), create modules of reusable code, work on my 
website, look into Digest::MD5, Acme::Bleach, and a couple of others, 
read more documentation, etc.. =:).  

Thanks.

---
Carlos 
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so although you are 
welcomed to visit and take a look, trying to subscribe will only be a 
frustration for you as your data will not be saved at this time.


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

Date: Fri, 17 Aug 2001 07:24:52 GMT
From: "Kevin Bartz" <l_pantin@hotmail.com>
Subject: Re: what does this message mean?
Message-Id: <8F3f7.12809$Ki1.1035768@bgtnsc06-news.ops.worldnet.att.net>

It means that it can't find a loadable object that was packaged with the
module. Did you run the makefile on this or just unzip and stick it in
Perl's search path? For practical purposes, the makefile's a necessity in this
case.

Kevin

In article <9lieqa$7r9@news.or.intel.com>, "meow" <maxim68@hotmail.com>
wrote:

> what does the below means?
> thanks.
> 
> 
> Can't locate loadable object for module IO::Tty in @INC (@INC contains:
> /$path1 /$path2 $path3
>   .) at  /$path1/Tty.pm line 26
> 
> 
> 
>


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

Date: Fri, 17 Aug 2001 15:59:56 +0800
From: "meow" <maxim68@hotmail.com>
Subject: Re: what does this message mean?
Message-Id: <9liitu$agu@news.or.intel.com>

yeah, i did run the makefile and install the module at my own_dir...
in my script i did specified a perl seach path:

use lib "/path/to/my/install/module/directory/own_dir";

what's wrong in this?



"Kevin Bartz" <l_pantin@hotmail.com> wrote in message
news:8F3f7.12809$Ki1.1035768@bgtnsc06-news.ops.worldnet.att.net...
> It means that it can't find a loadable object that was packaged with the
> module. Did you run the makefile on this or just unzip and stick it in
> Perl's search path? For practical purposes, the makefile's a necessity in
this
> case.
>
> Kevin
>
> In article <9lieqa$7r9@news.or.intel.com>, "meow" <maxim68@hotmail.com>
> wrote:
>
> > what does the below means?
> > thanks.
> >
> >
> > Can't locate loadable object for module IO::Tty in @INC (@INC contains:
> > /$path1 /$path2 $path3
> >   .) at  /$path1/Tty.pm line 26
> >
> >
> >
> >




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

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


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