[10441] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4034 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 21 13:04:01 1998

Date: Wed, 21 Oct 98 10:01:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 21 Oct 1998     Volume: 8 Number: 4034

Today's topics:
        Perl on NT <mjohnson@getonthe.net>
    Re: Perl on NT <rootbeer@teleport.com>
    Re: Perl Y2K copmliance (Patrick Timmins)
        PerlMagick from tar archive <jdhunter@nitace.bsd.uchicago.edu>
    Re: Problem with perl scripts... <rootbeer@teleport.com>
        Q: Can WinPerl interact with ODBC driver? metcalfjm@my-dejanews.com
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <murrayb@vansel.alcatel.com>
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <eashton@bbnplanet.com>
    Re: Scotch drinkers Unite! [was] Re: Raleigh.pm (Raleig <murrayb@vansel.alcatel.com>
        sorry <avitala@macs.biu.ac.il>
    Re: Testing a date (I R A Aggie)
        Text::Wrap is generating a warning <dnp@ams.org>
    Re: Text::Wrap is generating a warning (David Alan Black)
    Re: What isn't Perl good for? <keithmur@mindspring.com>
    Re: What isn't Perl good for? <eashton@bbnplanet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 20 Oct 1998 21:53:11 -0500
From: "Matt Johnson" <mjohnson@getonthe.net>
Subject: Perl on NT
Message-Id: <70kslq$m1t$1@news.ipa.net>

Does anyone know why my perl scripts are looking for files that are in my
servers root, instead of the directory that my scripts are in.

I am using IIS 3.0.

open ("file", "wo.list");

you can email me at mjohnson@getonthe.net




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

Date: Wed, 21 Oct 1998 16:26:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl on NT
Message-Id: <Pine.GSO.4.02A.9810210923510.5534-100000@user2.teleport.com>

On Tue, 20 Oct 1998, Matt Johnson wrote:

> Does anyone know why my perl scripts are looking for files that are in
> my servers root, instead of the directory that my scripts are in.

They're probably doing what you told them. :-)  But if you're talking
about the "working directory" for CGI programs, you should know that the
specification doesn't say that your program will be started with any
particular working directory. If you wish to specify filenames with
relative paths, use chdir first. Of course, this has nothing to do with
Perl; it applies to any CGI programs.

> open ("file", "wo.list");

I don't think those are the parameters you really want. And even when your
script is "just an example" (and perhaps especially in that case!) you
should _always_ check the return value after opening a file.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 21 Oct 1998 15:27:25 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
To: perlguy@technologist.com
Subject: Re: Perl Y2K copmliance
Message-Id: <70kugr$vv0$1@nnrp1.dejanews.com>

Posted and emailed to perlguy@technologist.com :

In article <362DC644.CCC3ED34@technologist.com>,
  perlguy@technologist.com wrote:

> Patrick Timmins wrote:
> >
> > In article <F14nAF.po@midway.uchicago.edu>,
> >   wdr1@pobox.com (William D. Reardon) wrote:
> >
> > > In article <70hpgu$s83$1@pilot.njin.net>,
> > > David Alan Black <dblack@pilot.njin.net> wrote:
> > [snip]
> > > >I don't see a single reference to Perl in this article.  It's all about
> > > >the BIOS on PCs, and how it interacts with Micros**t.
> > > >
> > > >Please (yawn) check out the usual archives and references for this
> > > >topic as it actually relates to Perl.
> > >
> > >       Well, since it affects Microsoft systems, and Perl runs on
> > > Microsoft systems, in the end, a person's Perl program may not work as
> > > expected in the year 2000.
> ... rest snipped ...
[snip]

I never wrote any of this ... you snipped out what I wrote ...
which was in the same vein as what you wrote ... which I snipped out!

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: Wed, 21 Oct 1998 16:36:29 GMT
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: PerlMagick from tar archive
Message-Id: <1rn26phnxu.fsf@cace.bsd.uchicago.edu>


I have written a script (included below) which works but I have a
question about how to improve it.  The script reads a series of
image files and makes a montage of them using the Image::Magick
module.  The files can either be supplied by a filename glob or reside
in a tar file, in which case you supply "-t tarfile" instead of the
filename glob.

The tarred files are first extracted to disk, read in, and then
removed.  My question is: is there a way to read the image and
manipulate it with PerlMagick without first extracting to disk,
e.g. via "$tar->get_contents($file)".  Image::Magick only supplies the
Read method which takes a filename argument and I'm not aware of a method
to get the image from buffer contents.  I'm new to object oriented
programming and any help on this question or other suggestions will be
appreciated.  

**begin file**
#!/usr/bin/perl -w
#make a montage of all of the image files specified on command line or
#in tar file
#usage:
#	'perl-montage *.jpg'
#	'perl-montage -f outfile.jpg *.jpg'
#	'perl-montage -t tarfile.tar'



use strict 'vars';
use vars qw(@filelist $image $images $montage $opt_t $opt_f $outfile $tar);
use Image::Magick;
use Getopt::Std;
use Archive::Tar;
getopt('t:f:');

$outfile = $opt_f || "montage.jpg";

$images=Image::Magick->new;
if ($opt_t) {
  $tar = Archive::Tar->new();
  $tar->read($opt_t) or die "can't read tar file: $!";
  @filelist = $tar->list_files();
  $tar->extract(@filelist);
}
else {
  @filelist = @ARGV;
}

foreach (@filelist) {
  print "$_\n";
  $image=Image::Magick->new;
  $image->Set(size=>'120x120');
  $image->Read($_);
  push(@$images, $image);
  unlink($_) if $opt_t;
}

print "building montage\n";
$montage = $images->montage(geometry=>'120x120', label=>"%f");
print "done\n";
undef $image;
$montage->Write("$outfile");

**end file**

-- 
John D. Hunter			h:(773) 288-3970
University of Chicago		w:(773) 702-5857


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

Date: Wed, 21 Oct 1998 16:22:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem with perl scripts...
Message-Id: <Pine.GSO.4.02A.9810210922340.5534-100000@user2.teleport.com>

On Wed, 21 Oct 1998 hyytiainen@edu.h4thol.fi wrote:

> Internal Server Error

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 21 Oct 1998 15:46:59 GMT
From: metcalfjm@my-dejanews.com
Subject: Q: Can WinPerl interact with ODBC driver?
Message-Id: <70kvlk$1d5$1@nnrp1.dejanews.com>

Hi,

I have a very odd situation that calls for backdoor methods.
I am trying to communicate with a DEC-Rdb v6.0 relational
database on a VAX system.  The Rdb version does not use
Sql-Net and there are no DBD::* or DBI::* perl modules
to communicate with it.  However, someone has suggested
an alternative:

It has come to my attention that current versions of
Microsoft's ODBC driver(s) for Win95/98/NT can communicate
with a DEC-Rdb v6.0+ database.  Can anyone else confirm
this?  If so, does anyone know if/how I can develop code
in WinPerl to take advantage of this capability?

Thanks in advance for any replies?

Regards,

JM
-----
Jeffrey M. Metcalf
Clinical Systems Analyst
Pfizer, Inc
metcalfjm@my-dejanews.com

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


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

Date: 21 Oct 1998 07:37:20 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <ubtn60yn3.fsf@vansel.alcatel.com>

Steve Howie <showie@uoguelph.ca> writes:

> God this is getting me thirsty. I could do with some Highland Park right 
> now ... yummee :)

Agh, you make me sad!  I just finished a bottle the other night.  Well,
time for another trip down the road.  Thanks a lot pal.  :)

-- 
-o- Brad Murray                  "Most programs aren't released;
-o- Alcatel Canada                they are allowed to escape."
-o- Software Analyst                        Jeff DelPapa


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

Date: Wed, 21 Oct 1998 16:25:03 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362E0856.39AE1F80@bbnplanet.com>

droby@copyright.com wrote:

> Massachusetts.  Guess I could probably join Boston.pm, but I don't get down
> there too often anymore.  Would Boston.pm like a field trip to Cape Ann?

I have a house in Rockport! just across the cut bridge by the pier. I go
up most every weekend. If you ever hang out at The Blackburn on Sunday
evenings I am usually there at the bar with Steve the bartender. C'mon
over and I'll buy you a beer. :)

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: 21 Oct 1998 07:42:24 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Scotch drinkers Unite! [was] Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <uaf2q0yen.fsf@vansel.alcatel.com>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:

> Bowmore! I just bought a bottle last weekend! mmmmmm. Glenfarclas is
> right up there Highland park is good too but I prefer a The Macallan 25
> if I can :). Laphroig takes a special mood. A peaty one.

Just have to put my bids in now---I found Bowmore quite dull, although
there's a cask strength out there that's very tasty.  Recently we in
Canada had the good fortune of receiving the big seven from United
Distilleries, which has renewed my taste for the islands---Talisker and
Lagavulin are both big favourites around our house now.  Highland Park
is our staple.  I have heard people rave about the Macallan 25, but I
was not terribly impressed.  I wasn't put off, either, I just found that
it lacked distinction.

Obligatory Perl (yes, this is a perl newsgroup): I wrote a series of man
pages for single malt scotches a while ago.  In POD format.  I know, it's
pretty thin but it's all I have for you.

-- 
Brad Murray              "The large print giveth 
Software Analyst          and the small print taketh away."
Alcatel Canada            --Tom Waits, Step Right Up


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

Date: Wed, 21 Oct 1998 17:04:27 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: sorry
Message-Id: <70kt9d$dpi$1@cnn.cc.biu.ac.il>

sorry, this should have been the reply to Abdallah Ally:


Abdallah Ally wrote in message <36272BF6.7C47DDCC@ia.pw.edu.pl>...

>What are these foo,qw and how should I use command shift

perhaps it's best to view it this way:
let @list be a list.
the following actions are psbl:

push(@list, $val)                -    insert a value at the end of the list.
$foo = pop(@list)               -    take out a value from the end of the
list
                                                  and assign it to $foo.
unshift(@list, $val)             -    insert a value at the beginning of the
list.
$foo = shift(@list)              -    take out a value from the beginning of
                                                   the list and assign it to
$foo.


Avshalom Avital
Information Retrieval Laboratory
Bar-Ilan University, Israel
avitala@macs.biu.ac.il






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

Date: Wed, 21 Oct 1998 12:19:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Testing a date
Message-Id: <fl_aggie-2110981219070001@aggie.coaps.fsu.edu>

In article <362DD6C6.9AFB9465@whiterabbit.co.uk>, Matt Pryor
<matt@whiterabbit.co.uk> wrote:

+ if (($year/4) == int($year/4)) {        # leapyear?

Fortunately for you, the next century year is 2000, which happens
to be a leap year. But century years need to be divisible by 400.

So...

if (!($year % 400) or (!($year % 4) and ($year % 100))) {

is a more robust solution:

foreach $year (1890..1904) {
 if (!($year % 400) or (!($year % 4) and ($year % 100))) {
     print "$year leap year\n";
 }else{
     print "$year not a leap year\n";
 }
}

Well, in this case...I haven't run it against _all_ cases... :)

James


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

Date: Wed, 21 Oct 1998 11:46:55 -0400
From: Dan Pelton <dnp@ams.org>
Subject: Text::Wrap is generating a warning
Message-Id: <362E01EF.107A2DEB@ams.org>

When ever I try an use the Text::Wrap module I get the following
Warning:
      "Use of uninitialized value at /usr/local/lib/perl5/Text/Wrap.pm 
       line 80."

The module works fine, but I was wondering how to get rid of the warning?  I am
using perl, version 5.003 with EMBED
        built under dec_osf at May  5 1997 08:47:11
        + suidperl security patch.

thanks,
Dan Pelton
dnp@ams.org


This is a sample script which generates the warning.
-------------------------------------------------------------------
#!/usr/local/bin/perl -w
use strict;
my $line;
use Text::Wrap qw(wrap $columns );
$columns = 40;

$line = "this isa testto see how well the perl module "
         . "text:wrap works. "
         . "Can it handle a string that is long. "
         . "This is the second sentenance.\n";
print wrap("", "", $line);

exit;
--------------------------------------------------------------------


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

Date: 21 Oct 1998 12:48:38 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Text::Wrap is generating a warning
Message-Id: <70l396$cmn$1@pilot.njin.net>

Hello -

Dan Pelton <dnp@ams.org> writes:

>When ever I try an use the Text::Wrap module I get the following
>Warning:
>      "Use of uninitialized value at /usr/local/lib/perl5/Text/Wrap.pm 
>       line 80."

>The module works fine, but I was wondering how to get rid of the warning?  I am
>using perl, version 5.003 with EMBED
>        built under dec_osf at May  5 1997 08:47:11
>        + suidperl security patch.


I don't have that version around, so I can't look at the file, but I can
tell you that the warning does not appear in 5.005_02.


David Black
dblack@pilot.njin.net


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

Date: Wed, 21 Oct 1998 11:04:49 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: What isn't Perl good for?
Message-Id: <362E0620.BDDBDA69@mindspring.com>

Larry Rosler wrote:
> 
> [Posted to comp.lang.perl.misc and copy mailed.]
> 
> In article <362D594B.A7680BFA@bbnplanet.com> on Wed, 21 Oct 1998
> 03:58:10 GMT, Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
> says...
> > > How about the flavored coffees?  Hazelnut?  Vanilla Almond?  Perl?
> >
> > Flavoured coffees?!?!? Heathen!
> 
> You are now involved in three (3) threads without a shred of Perl
> content.  Isn't it time to give the rest of us a break?
> 
A coffee break?  Sorry.


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

Date: Wed, 21 Oct 1998 16:47:18 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: What isn't Perl good for?
Message-Id: <362E0D8D.EFA72571@bbnplanet.com>

Scott Wedel wrote:

> Okay, yes I am envious of all the fun I read you all having at your
> meetings.  And unlike Vail, none of our ski lifts were torched so you will
> be able to ski the entire mountain.

I'm thinking about getting a Vermont ski meet going for the Boston.pm.
If you propose one for Steamboat Springs, I'd fly out for that. :) Wimpy
little hills we have out here compared to the Rockies. And I just bought
a new pair of skis as it's predicted were going to have a really great
snow wintah.

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4034
**************************************

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