[19614] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1809 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 25 00:05:37 2001

Date: Mon, 24 Sep 2001 21:05:10 -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: <1001390709-v10-i1809@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 24 Sep 2001     Volume: 10 Number: 1809

Today's topics:
    Re: a bit of help please. (Chris Fedde)
    Re: Creating a file <tony_curtis32@yahoo.com>
    Re: Creating a file <tintin@snowy.calculus>
        Creating modules <ds@ss.com>
    Re: Creating modules <rob_13@excite.com>
    Re: Creating modules <comdog@panix.com>
        emailing contents of text file (jcole)
        Environnement problem under Linux <yalaoui@lexbase.fr>
    Re: Environnement problem under Linux (Chas Friedman)
    Re: eval-statement fools garbage-collection ? <pilsl_@goldfisch.at>
    Re: Hash containing Array's question.. <comdog@panix.com>
    Re: Help: mail script (WIN) <bill02115@hotmail.com>
    Re: How to htmlize an email, for eg lynx? (Chris Fedde)
    Re: How to send a cookie from perl to perl? <mbudash@sonic.net>
    Re: How to send a cookie from perl to perl? (Chris Fedde)
    Re: installing modules in WinNT <eli@there-is-no-more-qzto.com>
    Re: installing modules in WinNT (Jules Alberts)
    Re: K shell to perl translator ? (Chris Fedde)
        module for generating Excel spreadsheet? <bing-du@tamu.edu>
    Re: module for generating Excel spreadsheet? <mbudash@sonic.net>
    Re: module for generating Excel spreadsheet? (Damian James)
    Re: OPEN file inside a compress gz (Martien Verbruggen)
    Re: Peek and Poke on Perl? <ravn@thunderbear.dyndns.dk>
    Re: Perl or not? <ravn@thunderbear.dyndns.dk>
    Re: Perl or not? <mikesl@wrq.com>
    Re: Perl or not? <mikesl@wrq.com>
    Re: Perl or not? <ravn@thunderbear.dyndns.dk>
    Re: Perl or not? <dan@tuatha.sidhe.org>
    Re: Perl script for monitoring a web page? (Chris Fedde)
    Re: removing a remainder from a number <comdog@panix.com>
    Re: threads (Martien Verbruggen)
    Re: Unusual error message... <xiu24@dial.pipex.com>
    Re: What good is the hyphen for named parameters? <lusol@Pandora.CC.Lehigh.EDU>
    Re: Windows2000: CPAN.pm woes <randy@theory.uwinnipeg.ca>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 25 Sep 2001 04:04:06 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: a bit of help please.
Message-Id: <WmTr7.654$Owe.318484480@news.frii.net>

In article <9onlp7$e7bis$1@fu-berlin.de>, Tina Mueller  <news@tinita.de> wrote:
>
>NEWS <na> wrote:
>> errr TOFU ????????????????/
>
>sorry, this is german and means Text Oben, Fullquote unten =
>Text at the top, fullquote at the bottom.
>i'm so used to this i forgot that english people
>wouldn't understand...
>

That's good!  I've got to remember that one.  We sometimes call it
jeopardy style.  Which is derived from a long running game show in
the US by that name.  It features an "answer before question"
format.

soy free tofu anyone?
-- 
    This space intentionally left blank


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

Date: Mon, 24 Sep 2001 17:17:00 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Creating a file
Message-Id: <8766a8jktf.fsf@limey.hpcc.uh.edu>

>> On Mon, 24 Sep 2001 13:49:23 -0500 (CDT),
>> dennis100@webtv.net (BUCK NAKED1) said:

> I don't recommend using >> when opening a file. It
> always clobbers files when I use it, and often creates
> garbage files.

Got any evidence for this assertion?

Sounds like FUD to me.

-- 
Yes way!  Mmmmkay?


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

Date: Tue, 25 Sep 2001 08:36:10 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: Creating a file
Message-Id: <wAOr7.2$I53.125051@news.interact.net.au>


"BUCK NAKED1" <dennis100@webtv.net> wrote in message
news:16676-3BAF8033-54@storefull-248.iap.bryant.webtv.net...
> I don't recommend using >> when opening a file. It always clobbers files
> when I use it, and often creates garbage files.

Then I'd suggest you have either broken code, OS or Perl.




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

Date: Tue, 25 Sep 2001 01:56:56 GMT
From: GunneR <ds@ss.com>
Subject: Creating modules
Message-Id: <spc2rtcsn5t2tqfcref6cn7f58k54jm8s9@4ax.com>

Im having trouble creating a simple module (just to get started). I've
had a bit of trouble finding good documentation on creating modules.
Anyone know any informative sites? I've found McDougalls documentation
but im looking for some further reading.

Thanks!


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

Date: Tue, 25 Sep 2001 02:31:51 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: Creating modules
Message-Id: <Xns9126E52261C6Erock13com@64.8.1.227>

GunneR <news:spc2rtcsn5t2tqfcref6cn7f58k54jm8s9@4ax.com>:

> Im having trouble creating a simple module (just to get
> started). I've had a bit of trouble finding good documentation
> on creating modules. Anyone know any informative sites?

You have read perlmod? Programming Perl has some stuff on modules 
as well. I haven't actually written any modules but would think 
perlmod should cover the basics.

-- 
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: Mon, 24 Sep 2001 21:37:38 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Creating modules
Message-Id: <comdog-9EBBF5.21373824092001@news.panix.com>

In article <spc2rtcsn5t2tqfcref6cn7f58k54jm8s9@4ax.com>, GunneR 
<ds@ss.com> wrote:

> Im having trouble creating a simple module (just to get started).

did you start with h2xs?

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: Tue, 25 Sep 2001 03:44:26 GMT
From: quikscor@ix.netcom.com (jcole)
Subject: emailing contents of text file
Message-Id: <3baffd06.60522038@nntp.ix.netcom.com>

while(<EMAILADDRESSFILE>)
{
   open MAIL, "|mail " . $_;
   print MAIL $heading . $quote; 
   close MAIL;
}

I want  $heading . $quote;  to be changed to the contents of a text
file.  In other words, I want to have a text file sitting in the
directory this script is in, and have that text file contain the body 
 of my mass email, so I would be able to write something like

while(<EMAILADDRESSFILE>)
{
   open MAIL, "|mail " . $_;
   print MAIL [a filename]; 
   close MAIL;
}

Help! I need a solution quick. 


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

Date: Tue, 25 Sep 2001 04:28:46 +0200
From: "Younes ALAOUI" <yalaoui@lexbase.fr>
Subject: Environnement problem under Linux
Message-Id: <9ooq5n$q2a$1@wanadoo.fr>

    Hi,

I use perl on Linux RH.
The problem is that i have 4 (four) perl executables. And i don't know
which on is used .

Here is the ouput of  "ls -l /usr/lib/perl5" :

drwxr-xr-x  29 root     root         4096 Sep 25 03:30 5.00503/
drwxr-xr-x  31 root     root         4096 Sep 13 12:19 5.6.0/
drwxr-xr-x   3 root     root         4096 Oct  9  2000 man/
drwxr-xr-x   5 root     root         4096 May  8  2000 site_perl/

I know that i have perl5.6.1 under "/usr/local/lib/perl5". I am confused of
too many .... executables.

I want to user Amavis, when it's launched it try to locate modules under
those directories :

/usr/lib/perl5/5.6.0/i386-linux
/usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl/5.005
/usr/lib/perl5/site_perl

The question is : How can i can specifie that i would like it to use modules
located undet '/usr/local/lib/perl5/'

Thanks in advance.

Y.A.




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

Date: Tue, 25 Sep 2001 03:02:01 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: Environnement problem under Linux
Message-Id: <3baff165.47700676@news.itouch.net>

On Tue, 25 Sep 2001 04:28:46 +0200, "Younes ALAOUI"
<yalaoui@lexbase.fr> wrote:

>    Hi,
>
>I use perl on Linux RH.
>The problem is that i have 4 (four) perl executables. And i don't know
>which on is used .
>
>Here is the ouput of  "ls -l /usr/lib/perl5" :
>
>drwxr-xr-x  29 root     root         4096 Sep 25 03:30 5.00503/
>drwxr-xr-x  31 root     root         4096 Sep 13 12:19 5.6.0/
>drwxr-xr-x   3 root     root         4096 Oct  9  2000 man/
>drwxr-xr-x   5 root     root         4096 May  8  2000 site_perl/
>
>I know that i have perl5.6.1 under "/usr/local/lib/perl5". I am confused of
>too many .... executables.
>
Try the command "which perl". That should indicate which one "perl"
refers to. Probably the most recent executable is under the 5.6.0
directory listed above. You could also do "ls -l /usr/bin/perl" to see
what that is linked to.
>I want to user Amavis, when it's launched it try to locate modules under
>those directories :
>
>/usr/lib/perl5/5.6.0/i386-linux
>/usr/lib/perl5/5.6.0
>/usr/lib/perl5/site_perl/5.6.0/i386-linux
>/usr/lib/perl5/site_perl/5.6.0
>/usr/lib/perl5/site_perl/5.005
>/usr/lib/perl5/site_perl
>
>The question is : How can i can specifie that i would like it to use modules
>located undet '/usr/local/lib/perl5/'
>
You can put the line: use lib '/usr/local/lib/perl5'; at the beginning
of your perl script.  
(One remark: it may be that /usr/local/lib/perl5
is linked to one of the directories you listed above. You could try
ls -l /usr/local/lib  to see if the perl5 directory is linked to one
of the above.)
>Thanks in advance.
>
>Y.A.
>
>
             chas



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

Date: Tue, 25 Sep 2001 00:08:51 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: eval-statement fools garbage-collection ?
Message-Id: <3bafaef5@e-post.inode.at>

nobull@mail.com wrote:


> 
> I've looked on perlbug and I can't find this bug so, Peter, since you
> discovered the bug you get the honour of submitting it.
>

I just upgraded to 5.6.1 and the problem vanished here. So I'm not sure if 
the bug isnt partially fixed already. On the other side, you were able to 
reproduce it on your 5.6.1 win32-environment.


my perl now:
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.3-20mdk, archname=i586-linux
    uname='linux lupo.local 2.4.3-20mdk #1 sun apr 15 23:03:10 cest 2001 
i586 unknown '
    config_args='-ds -e'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef


peter

-- 
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: Mon, 24 Sep 2001 17:46:35 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Hash containing Array's question..
Message-Id: <comdog-5804D5.17463524092001@news.panix.com>

In article <23b7814d.0109241211.85fbc5e@posting.google.com>, 
Joseph_Henstay@yahoo.com (JHenstay) wrote:

> $ArrayLen = @($HashTest{$HashKey});

make those braces to dereference the anonymous array:

    $ArrayLen = @{ $HashTest{$HashKey} };

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: 24 Sep 2001 23:12:19 -0400
From: bill <bill02115@hotmail.com>
Subject: Re: Help: mail script (WIN)
Message-Id: <9oosmj$ah1$1@panix3.panix.com>

In <9olr6j$j34$1@charity.cs.utexas.edu> logan@cs.utexas.edu (Logan Shaw) writes:

>A fairly obvious way is to connect to some SMTP server somewhere
>and spit the mail message at it.  You can do this with Net::SMTP.

The mail must come from the "usual" SMTP server (i.e. the one used by
the usual mail program when mail is sent from the machine in
question).  The problem is, I can't figure out what this server's
name/domain is.  Is there a program that will reveal that information?

thanks,

bill


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

Date: Tue, 25 Sep 2001 03:14:28 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: How to htmlize an email, for eg lynx?
Message-Id: <oESr7.649$Owe.318486016@news.frii.net>

In article <9omera$5tj$1@news.panix.com>,
David Combs <dkcombs@panix.com> wrote:
>
>QUESTION: wrong group, maybe, but most people
>who have responded to this post seem to be
>pretty knowledgeable at mutt esoterics.
>

The set of requirements seemed intriguing enough to take a look at
mutt.  It appears that the www.mutt.org web site is alive and
kicking with lots of great info about using and customizing it.
I'm not really in a position to tell you what you need to do to
achieve your goals (I'm an MH user) but it appears that the information
is in the mutt docs to get most of what you want with a few minor config
changes.

Good Luck

BTW if you like lynx you might just take a quick look at w3m.
 .gl
-- 
    This space intentionally left blank


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

Date: Mon, 24 Sep 2001 23:57:14 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: How to send a cookie from perl to perl?
Message-Id: <mbudash-520468.16571424092001@news.sonic.net>

In article <3BAF6453.8647CE12@execonn.com>, Marshall Dudley 
<mdudley@execonn.com> wrote:

> How do you send a cookie from one perl script to another.
> 
> http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2109.html indicates that
> you put the following syntax in the header:
> 
> Cookie: $Version="1"; name="value";
> 
> But that does not seem to work at all.  I am unable to use normal
> cookies because cookies cannot be passed between domains. So in a blind
> GET request I need to pass the ID cookie so the 3rd party affiliate
> program will know the affiliate ID.
> 
> This is the code I am using. If anyone knows how to do it, I would
> appreciate a response.  Thanks,
> 
> [snip]
 
make your life easier and check into the LWP (libwww-perl) module-set:

http://www.perl.com/CPAN-local/modules/by-module/LWP/
 
hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Tue, 25 Sep 2001 03:37:12 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: How to send a cookie from perl to perl?
Message-Id: <IZSr7.651$Owe.263541760@news.frii.net>

In article <3BAF6453.8647CE12@execonn.com>, Marshall Dudley
<mdudley@execonn.com> wrote:
>How do you send a cookie from one perl script to another.
>
>http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2109.html indicates that
>you put the following syntax in the header:
>
>Cookie: $Version="1"; name="value";
>
>But that does not seem to work at all.  I am unable to use normal
>cookies because cookies cannot be passed between domains. So in a blind
>GET request I need to pass the ID cookie so the 3rd party affiliate
>program will know the affiliate ID.
>

I'd recommend abandoning the flat coding style and make use of the LWP
module available on CPAN. This is a tried and true way to bypass the
complexities of the HTTP protocol and get down to doing the task at hand.

Among other things the lwpcook manual page includes the following:

    COOKIES
       Some sites like to play games with cookies.  By default
       LWP ignores cookies provided by the servers it visits.
       LWP will collect cookies and respond to cookie requests if
       you set up a cookie jar.

         use LWP::UserAgent;
         use HTTP::Cookies;

         $ua = LWP::UserAgent->new;
         $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt",
                                            autosave => 1));

         # and then send requests just as you used to do
         $res = $ua->request(HTTP::Request->new(GET => "http://www.yahoo.no"));
         print $res->status_line, "\n";

       As you visit sites that send you cookies to keep, then the
       file lwpcookies.txt" will grow.
-- 
    This space intentionally left blank


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

Date: 24 Sep 2001 23:11:08 GMT
From: Eli the Bearded <eli@there-is-no-more-qzto.com>
Subject: Re: installing modules in WinNT
Message-Id: <eli$0109241909@qz.little-neck.ny.us>

In comp.lang.perl.misc, Steve K <skradel@mindspring.common.sense> wrote:
> "Eli the Bearded" wrote in message news:eli$0109211222@qz.little-neck.ny.us
> > Modules install nicely, double clicking perl scripts works, but I can't
> > right click and 'Open With...' perl scripts. Anything simple to fix
> > that?
> Pick "Open With... -> Choose Program" after the right click, and specify the
> perl interpreter.  Windows will/should/might remember that decision and,
> thereafter, offer it on the "Open With" menu.

I meant that there is no 'Open With' in the right click menu so that
I could override opening with perl for those times I want to edit the
script.

> > vastly prefers not using Windows
> An easy argument to make, for them who like perl...

But harder when writing software for other people to use.

Elijah
------
needs to stop assuming editing the script is a good way to change defaults


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

Date: 24 Sep 2001 07:45:05 GMT
From: root@localhost.localdomain (Jules Alberts)
Subject: Re: installing modules in WinNT
Message-Id: <3baee481$0$1714@heracles>

On 21 Sep 2001 16:23:51 GMT, Eli the Bearded
<eli@there-is-no-more-qzto.com> wrote:
>In comp.lang.perl.misc, asif  <whatever@nevermind.invalid> wrote:
>> Eli the Bearded wrote:
>> > I got a recent ActiveState perl. I tried to install it on a WinNT
>...
>> > But ppm does not work. I need to install one non-standard module
>> > for an app to work: Time::HiRes.
>> Unless there's a specific reason for not using it, download the MSI
>> version.
>
>Okay, Did that, it seems to work. I avoided it at first since I had
>no idea what "MSI" meant.
>
>> I had similar problems with an NT install. Deleting everything,
>> going to MS' site and getting the MSI application, downloading the
>> MSI version of ASPerl and installing using the MSI installer solved
>> 99.9% of my problems.
>
>Modules install nicely, double clicking perl scripts works, but I
>can't right click and 'Open With...' perl scripts. Anything simple to
>fix that?

i use Vim for just about everything on NT, so i always have this
registry key set:

  REGEDIT4

  [HKEY_CLASSES_ROOT\*\shell\Vim it\command]
  @="vim_binary_directory\\gvim.exe \"%1\""

this allows me to Vim everything, whether is associated or not.

-- 
Jules Alberts
joolsa atmark maildot com (humans know what to do)


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

Date: Tue, 25 Sep 2001 03:29:46 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: K shell to perl translator ?
Message-Id: <KSSr7.650$Owe.283379712@news.frii.net>

In article <dVqvOwkhbWLh8YBDo0qV5bOcVc+X@4ax.com>,
Neil  <neil@thump.org> wrote:
>I can't find any mention of this anywhere but just incase the gurus know, has
>anyone written a khell to perl translator ? 
>
>Neil
>

There are three shell tool converters for perl a2p translates awk into perl,
s2p translates sed to perl and find2perl translates a find command line
into a perl script.  But to my knowledge there is no general tool for
converting a shell scripting language into an equivalent perl program.

The perl FAQ contains the following advice:

       How can I convert my shell script to perl?

       Learn Perl and rewrite it.  Seriously, there's no simple
       converter.  Things that are awkward to do in the shell are
       easy to do in Perl, and this very awkwardness is what
       would make a shell->perl converter nigh-on impossible to
       write.  By rewriting it, you'll think about what you're
       really trying to do, and hopefully will escape the shell's
       pipeline datastream paradigm, which while convenient for
       some matters, causes many inefficiencies.

Good Luck
-- 
    This space intentionally left blank


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

Date: Mon, 24 Sep 2001 17:46:06 -0500
From: Bing Du <bing-du@tamu.edu>
Subject: module for generating Excel spreadsheet?
Message-Id: <3BAFB7AE.4615A71A@tamu.edu>

Hi,

I was told there is a Perl module which can generate file in Microsoft
Excel spreadsheet format.   Can anybody give me some clue about the name
of this module, so I can move ahead looking at it further?

Thanks,

Bing




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

Date: Mon, 24 Sep 2001 23:38:25 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: module for generating Excel spreadsheet?
Message-Id: <mbudash-065C5D.16382524092001@news.sonic.net>

In article <3BAFB7AE.4615A71A@tamu.edu>, Bing Du <bing-du@tamu.edu> 
wrote:

> Hi,
> 
> I was told there is a Perl module which can generate file in Microsoft
> Excel spreadsheet format.   Can anybody give me some clue about the name
> of this module, so I can move ahead looking at it further?
> 
> Thanks,
> 
> Bing
> 
> 

Spreadsheet::WriteExcel is one option...
 
hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: 24 Sep 2001 23:54:48 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: module for generating Excel spreadsheet?
Message-Id: <slrn9qvhpm.6hn.damian@puma.qimr.edu.au>

On Mon, 24 Sep 2001 17:46:06 -0500, Bing Du said:
>...
>I was told there is a Perl module which can generate file in Microsoft
>Excel spreadsheet format.   Can anybody give me some clue about the name
>of this module, so I can move ahead looking at it further?

The place you look for Perl modules is CPAN - www.cpan.org (but try to
find a mirror near you under 'CPAN sites map'). On the CPAN main page,
there is a heading 'Searching', and under this are several links to sites
that allow you to search for modules. If you tell a search engine to
look for 'Excel', you should get a list of modules relating to Excel.

If you have the CPAN module configured, doing `perl -MCPAN -e shell`,
then asking it 'm /Excel/' will also generate such a list (if you
don't have it configured, then running it with the above incantation
for the first time will walk you through configuring it).

If you are using ActiveState perl, you might want to investigate using
the ppm utility to search for modules. I don't use this, so I can't
advise - I suggest ActiveState's website or the included documentation.

HTH,

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker,### http://home.pacific.net.au/~djames.hub


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

Date: Tue, 25 Sep 2001 00:53:40 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: OPEN file inside a compress gz
Message-Id: <slrn9qvlck.eug.mgjv@verbruggen.comdyn.com.au>

On 24 Sep 2001 11:59:25 -0700,
	EP <pomar@us.ibm.com> wrote:
> Is it possible to read a file for open in Perl that is part of a zip
> (gz) file? For example. I have a file.gz. I compressed a bunch of
> files into it. Like gzip -c file1 file2 > file.gz.

gzip is meant to act on single files, not on groups. You can use zip
or tar to group files. The CPAN provides some modules to do this
without the help of external programs:

Archive::Tar
Archive::Zip (requires Compress::Zlib)
Archive::Any

http://www.cpan.org/

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | In the fight between you and the
Commercial Dynamics Pty. Ltd.   | world, back the world - Franz Kafka
NSW, Australia                  | 


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

Date: 25 Sep 2001 07:52:40 +0200
From: Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk>
Subject: Re: Peek and Poke on Perl?
Message-Id: <m2r8svkeaf.fsf@thunderbear.dyndns.dk>

Gary <gamtci1@mpinet.net> writes:

> My question is for OSs other than DOS. Is there a Perl module that 
> anyone knows about which provides absolute address reads and writes 
> which would function in a protected environment?

I have not seen any of the kind.

For most protected environments, the usual approach is to write a
small device driver for the kernel, and then use that in userspace.

Are you certain that your device is unsupported by Linux?

-- 
  Thorbjoern Ravn Andersen          "...plus...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: 25 Sep 2001 07:53:35 +0200
From: Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk>
Subject: Re: Perl or not?
Message-Id: <m2n13jke8w.fsf@thunderbear.dyndns.dk>

Tom <tom@zerofiveone.nosp@m.com> writes:

> Perl is good, I love it, but it lacks the speed of compiled programs.
> Anyone got a good alternative?

Fortran is as fast as it gets.

-- 
  Thorbjoern Ravn Andersen          "...plus...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: Tue, 25 Sep 2001 00:09:43 GMT
From: Michael Slass <mikesl@wrq.com>
Subject: Re: Perl or not?
Message-Id: <m31ykw2ks8.fsf@thneed.na.wrq.com>

Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk> writes:

>Fortran is as fast as it gets.
>
>-- 
>  Thorbjoern Ravn Andersen          "...plus...Tubular Bells!"
>  http://bigfoot.com/~thunderbear

I'd bet that nicely-optomized C programs could give Fortran programs a
run for their money.

-Mike




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

Date: Tue, 25 Sep 2001 00:10:25 GMT
From: Michael Slass <mikesl@wrq.com>
Subject: Re: Perl or not?
Message-Id: <m3wv2o166m.fsf@thneed.na.wrq.com>

Michael Slass <mikesl@wrq.com> writes:

>Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk> writes:
>
>>Fortran is as fast as it gets.
>>
>>-- 
>>  Thorbjoern Ravn Andersen          "...plus...Tubular Bells!"
>>  http://bigfoot.com/~thunderbear
>
>I'd bet that nicely-optomized C programs could give Fortran programs a
>run for their money.
>
>-Mike

Optimized. :)


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

Date: 25 Sep 2001 08:11:17 +0200
From: Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk>
Subject: Re: Perl or not?
Message-Id: <m2ite7kdfe.fsf@thunderbear.dyndns.dk>

Michael Slass <mikesl@wrq.com> writes:


> I'd bet that nicely-optomized C programs could give Fortran programs a
> run for their money.

For some reason computer scientists who have a lot of number crunching
to do, choose to do so in Fortran.  I do not know why, but I think
they know what they are doing.

Perhaps it is less difficult to parallize on multi-CPU machines?

But that is irrelevant to us here.  We sacrifice speed and efficiency
for comfortable and unreadable programs.

-- 
  Thorbjoern Ravn Andersen          "...plus...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: Tue, 25 Sep 2001 01:42:30 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl or not?
Message-Id: <aiRr7.30934$NT3.4281393@news1.rdc1.ct.home.com>

Michael Slass <mikesl@wrq.com> wrote:
> Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk> writes:

>>Fortran is as fast as it gets.

> I'd bet that nicely-optomized C programs could give Fortran programs a
> run for their money.

You'd bet that, but you'd be wrong. :)

Fortran, generally lacking in pointers, has far less uncertainty about it,
which makes it much, *much* easier to optimize. If you write to its
problem domain, nothing'll touch Fortran for speed.

					Dan


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

Date: Tue, 25 Sep 2001 03:49:02 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Perl script for monitoring a web page?
Message-Id: <O8Tr7.652$Owe.326894080@news.frii.net>

In article <pqguqt86t9d8ciiofqd9ggq08sssko84q5@4ax.com>,
Bart Lateur  <bart.lateur@skynet.be> wrote:
>Clinton A. Pierce wrote:
>
>>On Mon, 24 Sep 2001 15:29:36 +0200, Andrey Shipsha
>><andrey@flyg.kth.se> wrote:
>
>>>I have no experience with Perl. However, I really want to have a script
>>>which will monitor a web page for me and, once the contents of the web
>>>page changed, send me a mail.
>
>The first thing I'd check out is the modification date, from the HTTP
>headers.
>

The following prints modification date of the page in epoch seconds.

    perl -MLWP::Simple -le '@s = head("http://www.cpan.org")and print $s[2]'

Maybe a version of this could be useful to the OP?

Good Luck
-- 
    This space intentionally left blank


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

Date: Mon, 24 Sep 2001 17:38:53 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: removing a remainder from a number
Message-Id: <comdog-D1D6CD.17385324092001@news.panix.com>

In article <8fd7acb0.0109241151.7f4d1d1b@posting.google.com>, 
dime0000@yahoo.com (Larry S) wrote:

> i dont know why i cant figure this out
> 
> all i want to do is:
> 
> $sum = $number1 / $number2;

shouldn't that be $quotient :)

> get rid of remainder in $sum.

if you want the remainder, you can use the modulus
operator:

    $remainder = $number1 % $number2;

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: Tue, 25 Sep 2001 00:34:44 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: threads
Message-Id: <slrn9qvk94.eug.mgjv@verbruggen.comdyn.com.au>

On Mon, 24 Sep 2001 22:18:27 +0200,
	Buchleitner Martin <mb@buntstift.at> wrote:
> On Mon, 24 Sep 2001 23:51:58 +1000
> mgjv@tradingpost.com.au (Martien Verbruggen) wrote:
> 
> Thanks for this Informations.
> This software i want to develop should be like an IRC-Client.
> The Differenze is, that the Server is using HTTP-Output and 
> can also be recieved with a Browser.

If it is more like an IRC client, then maybe you should have a look at
select() in the perlfunc documentation, or probably better, the
IO::Select module that comes with Perl.

Alternatively, you could have a look at an Event-style of programming.
Have a look at the Event modules (available from CPAN), or maybe you
can look through the archives on this group for posts by Uri Guttman
for more guidance on this.

> I did not want to use Perl and Threads because i read that
> it is still under develop.

I think it is probably a wise move, especially if you don't know much
about thread programming already.

> I have to read perlipc and also something about fork.

If you post a bit more about how exactly this client is supposed to
work, and what is going in and out, maybe we can guide you a bit more
towards the solution that is most likely to work well...

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


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

Date: Mon, 24 Sep 2001 23:18:39 +0100
From: Jonathan McKeown <xiu24@dial.pipex.com>
Subject: Re: Unusual error message...
Message-Id: <3BAFB13F.5C4431B@dial.pipex.com>

Benjamin Goldberg wrote:
> 
> Ilmari Karonen wrote:
> [snip]
> > The "EXPR for LIST;" syntax was introduced in perl 5.005.  It
> > is exactly equivalent to "for (LIST) {EXPR}",
> 
> Not *exactly* equivilant... it doesn't introduce a new scope.
> 

Really? I'm sure I've been bitten under Perl 5.6.1 by exactly this: I
don't remember the exact code (it's at work - I'm sure I could dig it
out
if anyone were interested) but ISTR I was using foreach to alias a 
reference to part of a complex data structure - along the lines of 

my $thing = $_ =~ /something/ ? $_ : "Stuff$_" for
$ridiculously_long_expr;

I was surprised to find $thing undefined until I rewrote as

my $thing;
$thing = $_ =~ # and so on as above.........

and I assumed that the for.. modifier had caused the my.. declaration to
be
scoped to that single line. I'll try it again tomorrow in case I'm
misremembering.

Jonathan


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

Date: 24 Sep 2001 23:56:14 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: What good is the hyphen for named parameters?
Message-Id: <9ooh6u$es8@fidoii.CC.Lehigh.EDU>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Stephen O. Lidie wrote:

>>-option also turns on Perl's auto-quoting
>>mechanism, which reduces the use of quotes.

> It does not. I think I've quite demonstrated that already. If there are
> any counter examples, I'd like to see them.

Calm. Yes, it's the => that enables auto-quotes. Sorry about that.

my $therm = $mw->Thermometer(
    -label  => 'Reactants Temp',
    -tscale => 'Celsius',
)->pack;

And yes, it does make the option distinct from its value.

Steve
--
@_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'.
'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$
z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'.
'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;


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

Date: Mon, 24 Sep 2001 20:38:50 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Windows2000: CPAN.pm woes
Message-Id: <9oonq5$cbd$1@canopus.cc.umanitoba.ca>

"Alicia" <alicia090677@hotmail.com> wrote in
   message news:9oo2c0$qkr$1@panix3.panix.com...

> I just downloaded ActiveState's ActivePerl, and tried to use CPAN.pm
> in interactive mode.  When I requested
>
>   cpan> install MIME::Lite
>
> (eventually) I got
>
>   Running make test
>   'test' is not recognized as an internal or external command,
>   operable program or batch file.
>      test -- NOT OK
>   Running make install
>     make test had returned bad status, won't install without force
>
> There's no make on this machine, nor a whole bunch of other standard
> Unix programs that CPAN.pm seems to need (gzip, etc.).  I suppose I
> could try to install cygwin, or the like, etc., to create an adequate
> Unix facsimile in this Windows machine, but first I would like to make
> sure there's no other way to get CPAN.pm to work on a Windows
> installation.  Is that so?  If not, how must I configure CPAN.pm to
> run under windows?

Many modules for ActivePerl are available through the included PPM
utility - a listing is at http://www.activestate.com/ppmpackages/.
However, if one you want isn't there, you'll need nmake to use
CPAN.pm; this is available from
   ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
Win32 ports of Unix tools are available from
     http://www.cygnus.com/misc/gnu-win32/
    http://www.itribe.net/virtunix
Also, Win32 tar and gzip programs are available at
    ftp://gatekeeper.dec.com/pub/GNU/
in the appropriate directories. Once you install these
in your PATH, reconfigure CPAN.pm and it will pick them
up and use them.

best regards,
randy kobes





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

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


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