[12564] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6164 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 12:07:17 1999

Date: Tue, 29 Jun 99 09:00:24 -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           Tue, 29 Jun 1999     Volume: 8 Number: 6164

Today's topics:
    Re: alphabetical sorting <amwalker@gate.net>
    Re: Comparing two associative arrays (Bart Lateur)
        Does (rand * 6) DWIM? <keithmur@mindspring.com>
        fastest DBI module? <khowe@performance-net.com>
    Re: guru needed: system call troubles <lwp@mail.msen.com>
        Help with rename function (Lance Dial)
    Re: Help with rename function <gellyfish@gellyfish.com>
    Re: help (Abigail)
    Re: help (Abigail)
    Re: help <dgrisinger@exactis.com>
    Re: HELP: recv() failed in Solaris 2.6 <lwp@mail.msen.com>
        How to convert a text file to 0-byte lenght? (Squigy)
    Re: How to put small icons at the start menu bar (Abigail)
    Re: How to send attachments with email <gellyfish@gellyfish.com>
    Re: How to start a thread in Perl <osman@focomedia.de>
    Re: MIME TYPE (Abigail)
        Need help building a list of files <leejk@cat.com>
    Re: NET::FTP ->get(filename) #Check for Timeout <aperrin@mcmahon.qal.berkeley.edu>
    Re: Object persistence -- how to? (Cameron Laird)
    Re: Object persistence -- how to? <jll@skynet.be>
    Re: parsing for loop <pribis@together.net>
    Re: parsing for loop <pribis@together.net>
    Re: parsing for loop <tchrist@mox.perl.com>
    Re: PCI66 / UDMA66 / Ultra66 / Linux? (Anno Siegel)
    Re: PCI66 / UDMA66 / Ultra66 / Linux? (Marcel Grunauer)
        perl version 5.003 source <dnp@ams.org>
    Re: perl version 5.003 source <gellyfish@gellyfish.com>
    Re: Problem Installing Tk 8.000.14 - make => line too l (Anno Siegel)
    Re: SELECT(rbits,wbits,ebits,timeout) adds blank line t <lwp@mail.msen.com>
    Re: shortest self printing perl program (Bart Lateur)
        upload script <jw77@lucent.com>
    Re: Verifying an existing file with a PERL web script <trent@binarypro.com>
    Re: Week Number without Date Module? <garethr@cre.canon.co.uk>
    Re: Week Number without Date Module? <tchrist@mox.perl.com>
    Re: XML::Parser Objects Style problem <matt.sergeant@ericsson.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 29 Jun 1999 10:55:59 -0400
From: Aaron Walker <amwalker@gate.net>
Subject: Re: alphabetical sorting
Message-Id: <3778DE7F.3170D0F2@gate.net>

none of this actually tells me how to take the data from the data file and
print it out alphabetically, or how to sort the data file itself
alphabetically.  Any other ideas?

Thanks again,
Aaron

"Pletschette Andri" wrote:

> Hi, you should probably take a look at this script which sorts an HTML Page
> with <img..>tags.
>
> ______________________
> Pletschette Andri
> http://www.grosbous.lu
>
> Aaron Walker wrote in message <3773C9E7.82D04F7@gate.net>...
> >hello,
> >
> >I have two perl CGI scripts and one data file (add.pl, members.pl, and
> >members.dat).  I have a html form that calls add.pl, which writes the
> >form data to members.dat.  members.pl then retrieves the data from
> >members.dat and prints it out in a table.  I would like to sort the
> >names of the members alphabetically by their first name.
> >
> >For example:
> >
> >in the html, I want to have anchors for each letter of the alphabet.
> >How would I go about sorting the data file and then putting each member
> >name under the appropriate anchor?
> >
> >thanks in advance for your help,
> >Aaron Walker
> >
>
>                  Name: Imgsort.pl
>    Imgsort.pl    Type: Perl Program (application/x-perl)
>              Encoding: x-uuencode



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

Date: Tue, 29 Jun 1999 13:53:06 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Comparing two associative arrays
Message-Id: <37787ab9.452417@news.skynet.be>

Uri Guttman wrote:

>  >> keys %hash1==keys %hash2 && "@{[values %hash1]}" eq "@{[@hash2{keys %hash1}]}"

>it looks like it should work fine except for the problems of $" but that
>should not be a problem with many typical sets of keys.

It doesn't differentiate between the null string and undef. It will
generate a lot of warnings for keys in %hash1 where the item doesn't
exist in %hash2.

	Bart.


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

Date: Tue, 29 Jun 1999 09:06:53 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Does (rand * 6) DWIM?
Message-Id: <3778D2FD.76B90844@mindspring.com>

How many are surprised by the result of this:

#!/usr/bin/perl
for ($i=0;$i<10;$i++) { print ((rand * 6) . "\n") }

Of course, running w/ '-w' provides the answer, as usual.  It just kind
of surprised me; I wondered how many others...
-----------------
Out, damned spot!
Out, spot, out!
      -- Shakespeare for First Grade


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

Date: Tue, 29 Jun 1999 11:16:50 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: fastest DBI module?
Message-Id: <Fu4e3.42318$%65.105617@tor-nn1.netcom.ca>

Which of the DBI:: Modules are the fastest?

Thanks
Kevin




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

Date: 29 Jun 1999 15:13:19 GMT
From: Lou Poppler <lwp@mail.msen.com>
Subject: Re: guru needed: system call troubles
Message-Id: <7lanqf$l3d$1@server1.powernet.net>

On Mon, 28 Jun 1999 14:36:55 GMT, Norman Crooks <argyrodes@sympatico.ca> wrote:

: Additionally,  this works fine from the command line:

: $ perl -e 'system("/heckler/www/stricker/.pgpdir/pgp -eatw
: /heckler/www/stricker
: /cgi-bin/filename.txt Sue")';

: and returns this:

: Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
: (c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
: International version - not for use in the USA. Does not use RSAREF.
: Current time: 1999/06/27 22:52 GMT
: Recipients' public key(s) will be used to encrypt.
: Key for user ID: Sue Stricker <stricker@strickerbooks.com>
: 1024-bit key, key ID CD393A49, created 1999/06/23
: .
: Transport armor file: /heckler/www/stricker/cgi-bin/filename.txt.asc
: File /heckler/www/stricker/cgi-bin/filename.txt wiped and deleted.


: In the script however, neither of these statements work:

: system("/heckler/www/stricker/.pgpdir/pgp -eatw
: /heckler/www/stricker/cgi-bin/filename.txt Sue");

: returns

: Recipients' public key(s) will be used to encrypt. Preparing random
: session key...

: but doesn't actually do any encryption.   My script also 'stalls' at
: this point.

I would guess that PGP is failing here because it is not running in
the same environment under the web server as it runs when you invoke
it from the command line.  You may need to set some environment
variables in your script, so PGP can find its keyfiles, etc ?

Also, you might want to investigate the perl variables $| and $/

-- 
  Lou Poppler  <lwp@mail.msen.com>  |    All power corrupts,
    http://www.msen.com/~lwp/       |     but we need the electricity.


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

Date: Tue, 29 Jun 1999 15:19:25 GMT
From: lcdialx@earthlink.net (Lance Dial)
Subject: Help with rename function
Message-Id: <3778e1d4.3797264@news.earthlink.net>

Hello,

I seem to be having some trouble with the perl rename function. It
returns the error:

"Invalid cross-device link"

Of course my question is: what does this mean, and how do I fix it?

Here is my code:

#!/usr/bin/perl -w
rename ("/perl/temp.tmp", "/home/httpd/uscadata/opleeze.tmp") ||
					die "$!";

The file permissions for the files and directories are as follows:

/perl	777
/home/httpd/uscadata 	777

/perl/temp.tmp	664
/home/httpd/uscadata/opleeze.tmp  -Well, does not exist....<grr>

Thanks in advance!!!



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

Date: 29 Jun 1999 16:39:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with rename function
Message-Id: <3778e8b0@newsread3.dircon.co.uk>

Lance Dial <lcdialx@earthlink.net> wrote:
> Hello,
> 
> I seem to be having some trouble with the perl rename function. It
> returns the error:
> 
> "Invalid cross-device link"
> 
> Of course my question is: what does this mean, and how do I fix it?
> 

It means that you cant cant rename a file across devices on your system.

To achive what you are trying to do you will need to copy the file
(possibly using File::Copy) and then unlink() the original file.


/J\
-- 
"I don't have access to the intelligence" - Michael Howard


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

Date: 29 Jun 1999 09:23:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: help
Message-Id: <slrn7nhlmd.1bn.abigail@alexandra.delanet.com>

Peter Hodder (peterh@stealth.com.au) wrote on MMCXXVIII September
MCMXCIII in <URL:news:3779710a.3671936@news.griffith.stealth.com.au>:
^^ can someone tell me how to put a background image in a perl script.


Write your script on a mirror.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 29 Jun 1999 09:24:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: help
Message-Id: <slrn7nhlo7.1bn.abigail@alexandra.delanet.com>

Faisal Nasim (swiftkid@bigfoot.com) wrote on MMCXXVIII September MCMXCIII
in <URL:news:7lav1p$4328@news.cyber.net.pk>:
() You don't put a background image in a perl script, but in a html page
() through a perl script.
() 
() print '<body background=/images/blah.jpg>';


That's very very very very very evil. 


[Followups set]


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 29 Jun 1999 09:08:58 -0600
From: Daniel Grisinger <dgrisinger@exactis.com>
Subject: Re: help
Message-Id: <m3emivrqlx.fsf@dhcp70.corp.merc.com>

peterh@stealth.com.au (Peter Hodder) writes:

> can someone tell me how to put a background image in a perl script.

    my $pid = fork;
    die "no fork: $!" unless defined $pid;
    if ($pid == 0) {
        sleep 86400;  # here's a background image :-)
        exit;
    }
    continue_doing_stuff();

I dunno, it seems kind of useless to me.

dgris
-- 
Daniel Grisinger                  dgrisinger@exactis.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 29 Jun 1999 14:53:40 GMT
From: Lou Poppler <lwp@mail.msen.com>
Subject: Re: HELP: recv() failed in Solaris 2.6
Message-Id: <7lamlk$kpa$1@server1.powernet.net>

On Mon, 28 Jun 1999 08:22:23 GMT, kclau@my-deja.com wrote:

:   I try to write a Perl CGI program to use Socket, I tested it in Linux
: and it worked just fine. But after moving to my webhosting site, running
: Solaris 2.6 in Sun UltraSPARC II, it always failed at following line:

:   $nRecv = read(SOCK, $ResponseMessage, $MSG_SIZE) or die "recv: $!";

:   And the problem is, I don't know why? Because the error message always
: content nothing! Totally blank message.

   $nRecv = read()  
is a replacement statement, and its value is the value returned by the
read(), which is the number of bytes read.  This is not the same as
some function that returns TRUE for success, FALSE for error.

You are preceding this read() with some kind of select(), right ?

-- 
  Lou Poppler  <lwp@mail.msen.com>    http://www.msen.com/~lwp/
It is necessary for the welfare of society that genius should be privileged
to utter sedition, to blaspheme, to outrage good taste, to corrupt the
youthful mind, and generally to scandalize one's uncles.  -- G. B. Shaw


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

Date: 29 Jun 1999 10:13:04 -0500
From: Squigy@last.com (Squigy)
Subject: How to convert a text file to 0-byte lenght?
Message-Id: <3778e01e.7435922@news2.newscene.com>

Hi,

	Starting to learn Perl. I downloaded this cgi script that
appends data to a text file. My idea is to download the file and then
reset the file to 0 byte lenght. I want to do this via a web page with
two buttons: download and reset. The download part is easy. The reset
file should be easy too, but this newbie doesn4t know how.

Any help will be appreciated. 
Thanks for your time.
Bye, 
S.


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

Date: 29 Jun 1999 09:25:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to put small icons at the start menu bar
Message-Id: <slrn7nhlq8.1bn.abigail@alexandra.delanet.com>

smnayeem@my-deja.com (smnayeem@my-deja.com) wrote on MMCXXVIII September
MCMXCIII in <URL:news:7l9iah$5o3$1@nnrp1.deja.com>:
^^ Does anyone know how I can install a small icon on the start menu like
^^ those of say ICQ, Antivirus programs, Pager etc? So that when someone
^^ clicks a window pops up, if they highlight something else happens etc.
^^ In fact is there any way to do windows programming using perl? or is it
^^ that using Microsoft tools is the only solution?
^^ Please let me know and thanks in advance.


use Tk;



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 29 Jun 1999 15:47:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to send attachments with email
Message-Id: <3778dc9d@newsread3.dircon.co.uk>

Thomas Dunbar <tdunbar@vt.edu> wrote:
> How can i include attachments in email messages
> generated via either piping directly to sendmail or
> via Mail::Mailer or something similar
> 

MIME::Lite

/J\
-- 
"Babylon 5 has some impressive special effects and enough dodgy hairdos
to make the current Conservative front bench look trendy" - Radio Times


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

Date: Tue, 29 Jun 1999 18:02:18 +0200
From: "osman durrani" <osman@focomedia.de>
Subject: Re: How to start a thread in Perl
Message-Id: <3778eb06.0@news.arcor-ip.de>

Hi David,
Thanx for the kind information

Regards osman

David Cassell schrieb in Nachricht <3777A6A2.6156180D@mail.cor.epa.gov>...
>osman durrani wrote:
>>
>> Hi people,
>>  could anyone tell me how to do start a function in a thread in perl ?.I
>> have perl on NT and cant do a fork.
>
>Depending on what you want, you could try Win32::Process::Create,
>which comes with ActiveState Perl.  If that doesn't meet your needs
>and you can't wait a few months for ActiveState to patch fork() into
>their Perl, you can:
>[A] go with cygwin32 and install your own Perl;
>[B] go with linux    and install your own Perl;
>[C] become close friends with Bill Gates and get him to direct
>his minions to fix this for you personally.
>
>Answer [C] would have additional benefits, if you can swing it.  :-)
>
>David
>--
>David Cassell, OAO                     cassell@mail.cor.epa.gov
>Senior computing specialist
>mathematical statistician




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

Date: 29 Jun 1999 09:29:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: MIME TYPE
Message-Id: <slrn7nhm1r.1bn.abigail@alexandra.delanet.com>

Faisal Nasim (swiftkid@bigfoot.com) wrote on MMCXXVIII September MCMXCIII
in <URL:news:7lbcnq$57d1@news.cyber.net.pk>:
,, 
,, print "Content-type: text/html\n\n<pre>";
,, 
,, After that, everthing is printed in plain text !


Not necessarely. After that follows a document that isn't HTML, so you've
no idea what a browser will do. It might fly away.

[Followups set]



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 29 Jun 1999 10:31:53 -0400
From: "Keith Lee" <leejk@cat.com>
Subject: Need help building a list of files
Message-Id: <7lalcf$lku$1@ns1.cat.com>

Hello,
    I have a situation where I need to read a directory listing of files,
copy the contents of individual files in this directory based on which
filenames the user inputs from a command line, and create a newfile
containing the contents of all the files copied that the user specified. I
have wrote a little something, but when run it goes off into la la land. Can
any of you Perl gurus take a look at it, and make some suggestions?

@input = <STDIN>;
# open the text files directory and get a listing of the files there
opendir (TXTDIR, "$txt_dir") or die "can't open text files directory: $!";
@txtfiles = readdir(TXTDIR);
closedir (TXTDIR);

 FILE: foreach $file (@txtfiles) {
        if (grep {$file eq $input[@input]} @txtfiles) {
        open(NEWFILE, ">>newfile") or die "cannot create newfile: $!";
        open(FILE, "<$file") or die "file is not accessible: $!";
     while (<FILE>) {
   print NEWFILE $_;
     }
          next FILE;
          }
       }
       close (NEWFILE);
       close (FILE);


Thanks,
Keith




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

Date: Tue, 29 Jun 1999 08:35:24 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: schlagel@my-deja.com
Subject: Re: NET::FTP ->get(filename) #Check for Timeout
Message-Id: <3778E7BC.7E61F59@mcmahon.qal.berkeley.edu>

[posted & sent via e-mail]

Check the value of $ftp->get like this:

$ftp->get($filename1) or die "Sorry, no dice getting $filename1.\n";

obviously there are more interesting and useful things to do than just die,
but you get the idea.

ap


schlagel@my-deja.com wrote:

> If there is a timeout during a GET, is
> there a way to capture the problem restart the download etc..?

--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting -
aperrin@mcmahon.qal.berkeley.edu
        http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: 29 Jun 1999 09:34:12 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Object persistence -- how to?
Message-Id: <7lalh4$8qk$1@Starbase.NeoSoft.COM>

In article <stevel-2906990022000001@192.168.100.2>,
Steve Leibel <stevel@coastside.net> wrote:
>What is the best way to store an arbitrary object on disc?  Is there a
>persistence library of some sort?  
>
>In other words if I define a class and then create an instance of that
>class, can I store the instance on disc for later retrieval?
			.
			.
			.
Mr. Leroy has already replied entirely accurately by af-
firming first that "it depends", and then supplying useful
concrete approaches that are apt in at least some of the
cases.

The question interests me.  I've argued before <URL:http://
www.sunworld.com/swol-02-1999/swol-02-regex.html#2> that
persistence is scripting's most predictable stumbling block
in an organizational sense.  That we have so many answers
to this problem means, in a typically dual conclusion, that
none are entirely satisfying.  Along with the particular
choices Mr. Leroy listed, I'd recommend you consider the
Berkeley DB <URL:http://www.sleepycat.com/> and MetaKit <URL:
http://www.sunworld.com/swol-05-1999/swol-05-regex.html#2>.
The former has a good Perl binding (but wait; does it handle
Perl objects correctly?  I'm not now sure), and I believe the
latter might soon release one also.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com      +1 281 996 8546 FAX


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

Date: Tue, 29 Jun 1999 18:04:13 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Object persistence -- how to?
Message-Id: <VA.000002aa.19c1b577@godot>

> The question interests me.

Have you examined my Tangram module? It's been released to the public 
only recently. You may find it useful in the future. It's been used to 
build parts of the software for the Belgian Appeal Court, a project 
featuring 400+ business classes.

Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy



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

Date: Tue, 29 Jun 1999 14:14:12 +0000
From: Brian Pribis <pribis@together.net>
Subject: Re: parsing for loop
Message-Id: <3778D4B3.B6548119@together.net>

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

oooohhhh...look mommy....maaaaagic!  :)  Thanks...that looks like it will do
the trick.
while(1){
print"Thank you!";
}

Faisal Nasim wrote:

> > bc).   What I want to be able to do is allow the user to put a 'for' loop
> in
> > the text file and then have the program parse the file including the for
> > loop.  I just have no clue how to do it.  I tried using a regexp to find
> the
> > for loop and then split at the " ; "  but it didn't seem to work very
> well.
>
> perldoc -f eval
>
> --
> Faisal Nasim (the Whiz Kid)
> Web: http://wss.hypermart.net/
> AOL: Whiz Swift  ICQ: 4265451
> FAX: (815) 846-2877

--
The Trainer's Directory: Quality Resources for Organizational Training and
Development.  www.trainersdirect.com sales@trainersdirect.com
webmaster@trainersdirect.com



--------------F5D9CF31ACB2E53B77FDD211
Content-Type: text/x-vcard; charset=us-ascii;
 name="pribis.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Pribis
Content-Disposition: attachment;
 filename="pribis.vcf"

begin:vcard 
n:Pribis;Brian
tel;fax:(518)293-6649 (Call first please)
tel;work:(518)293-6649
x-mozilla-html:TRUE
url:http://www.trainersdirect.com
org:The Trainer's Directory
version:2.1
email;internet:pribis@trainersdirect.com
title:Co-owner
adr;quoted-printable:;;The Trainer's Directory=0D=0A405 #37 Rd.=0D=0A;Saranac;NY;12981;USA
note;quoted-printable:Your resource for organizational =0D=0Atraining and consulting needs.=0D=0Atrainersdirect@trainersdirect.com
x-mozilla-cpt:;0
fn:Brian Pribis
end:vcard

--------------F5D9CF31ACB2E53B77FDD211--



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

Date: Tue, 29 Jun 1999 14:17:09 +0000
From: Brian Pribis <pribis@together.net>
Subject: Re: parsing for loop
Message-Id: <3778D565.A4C03A8@together.net>

This is a multi-part message in MIME format.
--------------242F389D897AB7742A7B0D6D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Me eyes! me bloody eyes!  Wow, that is a lot of code...Some one else gave me a
shorter solution (yep, I am the typical lazy programmer.....guess that is why I
find perl so attractive:), but if that doesn't work I will give this a shot.
Thanks for the direction.

Damian Conway wrote:

> "D4r3p3" <D4r3p3@hotmail.com> writes:
>
> >Hello:
> >I wrote a program that is sort of like bc but written in perl. As one
> >of it's features it can process a plain text file and evaluate
> >equations. The equations are put in the file one line at a time with
> >any variables assigned and then the program does the rest (like I
> >said, it is a lot like bc). What I want to be able to do is allow the
> >user to put a 'for' loop in the text file and then have the program
> >parse the file including the for loop. I just have no clue how to do
> >it. I tried using a regexp to find the for loop and then split at the
> >" ; " but it didn't seem to work very well. Does any one have any
> >ideas how to do this? I sure could use the help.
>
> Sounds like you're at the point where a parser generator like
> Parse::RecDescent, Parse::Yapp, or perl-byacc might help. Here's a
> start in Parse::RecDescent. (Hmmmm, on reflection I don't know if
> that's any easier! :-)
>
> -----------cut-----------cut-----------cut-----------cut-----------cut----------
>
>         use Parse::RecDescent;
>
>         sub evalop
>         {
>                 my (@list) = @{[@{$_[0]}]};
>                 my $val = shift(@list)->();
>                 while (@list)
>                 {
>                         my ($op, $arg2) = splice @list, 0, 2;
>                         $op->($val,$arg2->());
>                 }
>                 return $val;
>         }
>
>         my $parse = Parse::RecDescent->new(<<'EndGrammar');
>
>                 main: expr /\s*\Z/ { $item[1]->() }
>                     | <error>
>
>                 expr: /for(each)?/ lvar range expr
>                                 { my ($vname,$expr) = @item[2,4];
>                                   my ($from, $to) = @{$item[3]};
>                                   sub { my $val;
>                                         no strict "refs";
>                                         for $$vname ($from->()..$to->())
>                                                 { $val = $expr->() }
>                                         return $val;
>                                       }
>                                 }
>                     | lvar '=' addition
>                                 { my ($vname, $expr) = @item[1,3];
>                                   sub { no strict 'refs'; $$vname = $expr->() }
>                                 }
>                     | addition
>
>                 addition: <leftop:multiplication add_op multiplication>
>                                 { my $add = $item[1]; sub { ::evalop $add } }
>
>                 add_op: '+'     { sub { $_[0] += $_[1] } }
>                       | '-'     { sub { $_[0] -= $_[1] } }
>
>                 multiplication: <leftop:factor mult_op factor>
>                                 { my $mult = $item[1]; sub { ::evalop $mult } }
>
>                 mult_op: '*'    { sub { $_[0] *= $_[1] } }
>                        | '/'    { sub { $_[0] /= $_[1] } }
>
>                 factor: number
>                       | rvar
>                       | '(' expr ')' { $item[2] }
>
>                 range: "(" expr ".." expr ")"
>                                 { [ @item[2,4] ] }
>
>                 number: /[-+]?\d+(\.\d+)?/
>                                 { sub { $item[1] } }
>
>                 lvar:   /\$([a-z]\w*)/
>                                 { $1 }
>
>                 rvar:   lvar
>                                 { sub { no strict 'refs'; ${$item[1]} } }
>
>         EndGrammar
>
>         while (<DATA>) {
>           print $parse->main($_), "\n";
>         }
>
>         __DATA__
>         $x = 2
>         $y = 3
>         +1-1+1-1+1-1+1-1+1
>         7*7-6*8
>         121/(121/11)/121*11
>         1/(10-1/(1/(10-1)))
>         $x * $y
>         foreach $i (1..$y) $x = $x * 2 + $i
>         $x
>
> -----------cut-----------cut-----------cut-----------cut-----------cut----------
>
> Damian

--
The Trainer's Directory: Quality Resources for Organizational Training and
Development.  www.trainersdirect.com sales@trainersdirect.com
webmaster@trainersdirect.com



--------------242F389D897AB7742A7B0D6D
Content-Type: text/x-vcard; charset=us-ascii;
 name="pribis.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Pribis
Content-Disposition: attachment;
 filename="pribis.vcf"

begin:vcard 
n:Pribis;Brian
tel;fax:(518)293-6649 (Call first please)
tel;work:(518)293-6649
x-mozilla-html:TRUE
url:http://www.trainersdirect.com
org:The Trainer's Directory
version:2.1
email;internet:pribis@trainersdirect.com
title:Co-owner
adr;quoted-printable:;;The Trainer's Directory=0D=0A405 #37 Rd.=0D=0A;Saranac;NY;12981;USA
note;quoted-printable:Your resource for organizational =0D=0Atraining and consulting needs.=0D=0Atrainersdirect@trainersdirect.com
x-mozilla-cpt:;0
fn:Brian Pribis
end:vcard

--------------242F389D897AB7742A7B0D6D--



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

Date: 29 Jun 1999 08:34:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: parsing for loop
Message-Id: <3778d97d@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Brian Pribis <pribis@together.net> writes:
:This is a multi-part message in MIME format.
:--------------242F389D897AB7742A7B0D6D

Please don't do that.  Usenet is a plain ASCII text medium.

:Me eyes! me bloody eyes!  Wow, that is a lot of code

And you had to bloody well quote all *ONE HUNDRED FOURTEEN* lines of
it, now didn't you?  Hello?  Is there anybody home, or are you using a
fricking web browser on Usenet?  Bad!

:--------------242F389D897AB7742A7B0D6D
:Content-Type: text/x-vcard; charset=us-ascii;
: name="pribis.vcf"
:Content-Transfer-Encoding: 7bit

[The remainder of your *TWENTY-EIGHT-LINE* mime-strosity excuse
for a signature deleted.]

Please don't do this anymore.

--tom
-- 
"Only wimps use tape backup: _real_ men just upload their important stuff on
ftp, and let the rest of the world mirror it."
                --Linus Torvalds on linux-kernel


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

Date: 29 Jun 1999 14:40:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: PCI66 / UDMA66 / Ultra66 / Linux?
Message-Id: <7laltj$4d2$1@lublin.zrz.tu-berlin.de>

Jonathan Stowe  <gellyfish@gellyfish.com> wrote in comp.lang.perl.misc:

>-- 
>"I sign my paintings Vincent because people can't pronounce Van Gough"
>- Vincent Van Gough

"I sign my orders Viscount because people can't pronounce Gough"
-Viscount Gough, English field marshal

Anno


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

Date: Tue, 29 Jun 1999 14:57:46 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: PCI66 / UDMA66 / Ultra66 / Linux?
Message-Id: <377aded3.13935878@enews.newsguy.com>

On 29 Jun 1999 09:59:56 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>Vincent Van Gough

tr/u//;

Marcel



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

Date: Tue, 29 Jun 1999 15:37:41 GMT
From: Dan Pelton <dnp@ams.org>
Subject: perl version 5.003 source
Message-Id: <7lap83$j3k$1@nnrp1.deja.com>

Does anyone know where I can find the source code for perl version
5.003 (perl5 5.0 patchlevel 3 subversion 0)?

thanks,
Dan Pelton
dnp@ams.org


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 29 Jun 1999 16:57:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl version 5.003 source
Message-Id: <3778ed02@newsread3.dircon.co.uk>

Dan Pelton <dnp@ams.org> wrote:
> Does anyone know where I can find the source code for perl version
> 5.003 (perl5 5.0 patchlevel 3 subversion 0)?

You can get virtually any version you want at :

<http://www.leo.org/pub/comp/programming/languages/script/perl/oasis/src/index.html>

but for the life of me I cant think *why* you might want it ...

/J\
-- 
"Killing myself is the last thing I'd ever do" - Homer Simpson


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

Date: 29 Jun 1999 15:10:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Problem Installing Tk 8.000.14 - make => line too long
Message-Id: <7lankm$4g9$1@lublin.zrz.tu-berlin.de>

Simon Griffiths  <s.griffiths@virgin.net> wrote in comp.lang.perl.misc:
>Hi to all you kind people out there !
>
>I have perl 5.005_03 happily running loadsa modules on Sequent Dynix/ptx
>4.4.2 - including DBD-Oracle, DBI and PerlTk 4. 
>
>However, I'm trying to upgrade to Perl/Tk 8.000.14 and getting problems.
>"perl Makefile.PL" seems to run OK, but "make" always fails with a make
>error :
>        make : line too long after substituting variables
>
>Even a make -n fails with the same error, so its difficult even working
>out where its failing, but it looks as if its in the "cd pTk ; make "
>bit.
>
>I also get the same problem on 8.000.013.
>
>If anyone could help I'd be most grateful !

Well, you might try to break up lines into continuation lines.  Run
something like 

$line =~ s/(.{70,} )/$1\\\n\t/;

over the makefile, that is, insert a backslash, a newline and a tab
after a blank beyond column 70.  (*Not* tested.)  Apply repeatedly,
if necessary.

Of course, this may as well make a mess out of your makefile. I'm
not sure that a line can be broken after *every* blank so a more
sophisticated substitution may be necessary.

Anno


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

Date: 29 Jun 1999 14:05:54 GMT
From: Lou Poppler <lwp@mail.msen.com>
Subject: Re: SELECT(rbits,wbits,ebits,timeout) adds blank line to file
Message-Id: <7lajs2$jns$1@server1.powernet.net>

On Sat, 26 Jun 1999 01:22:31 GMT, pgodkin@my-deja.com wrote:

: X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I)
 
: I am using the command:
:   SELECT(undef, undef, undef, 60)
: to implement a 60 second sleep within my perl
: script. This command is causing an extra blank
: line to appear in my STDOUT file which I do not
: want. Any suggestions on how to avoid the
: extra blank line problem?
: 
: I have found that the SLEEP 60 command causes a
: Core dump so I am using the SELECT command as a
: work-around.

What version of perl are you using ?
What version/re-vision/service-pack of NT are you using ?
This problem may be caused by NT's buggy implementation of select().

-- 
  Lou Poppler <lwp@mail.msen.com>  |   Would you try to solve your Y2K
   http://www.msen.com/~lwp/       |   problems by giving more money to
                                       a company whose main product is
                                       named Xxxxxxx95 and Xxxxxxx98 ?


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

Date: Tue, 29 Jun 1999 14:10:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: shortest self printing perl program
Message-Id: <3778d0ed.4589972@news.skynet.be>

John Porter wrote:

>   seek DATA,0,0;print<DATA>;
>   __DATA__

> Isn't this a FAQ by now?

print `cat $0`

PoB's can change this to

print `type $0`

This may work too:

system 'cat',$0

	Bart.


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

Date: Tue, 29 Jun 1999 11:53:46 -0400
From: Joe Warakomski <jw77@lucent.com>
Subject: upload script
Message-Id: <3778EC0A.AA93181A@lucent.com>

Hello,

I am currently using this script
(http://www.terminalp.com/scripts/file_upload.shtml) for uploading via
the web.  The script runs great, although I added another field for a
description of the file.  When script runs and displays the output it
does not display the description, although all other field names are
displayed.  I doubled checked all variable names between the HTML and
CGI and everything matches.  If anyone could help, it would be
appreciated.

Joe


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

Date: Tue, 29 Jun 1999 13:53:47 GMT
From: J. Trent Adams <trent@binarypro.com>
Subject: Re: Verifying an existing file with a PERL web script
Message-Id: <7laj55$gd0$1@nnrp1.deja.com>

In article <3777A8DF.DB32EF6@mail.cor.epa.gov>,
  David Cassell <cassell@mail.cor.epa.gov> wrote:

<snip>
> Okay, the real problem here is not Perl-related.  It is your
> web server.  You're using a relative apth to your file.  But
> IIS (and plenty of other web servers) change the environment
> of the CGI process.  It runs your script as a different user
> [probably user nobody] from a different directory.  So you'll
> have to:
> [1] specify the 'absolute' path instead; and
> [2] make sure that the permissions on your files are suitable
> for whatever you want to do next.
<snip>

Thanks, I ran into this problem as well.  The next question I have for
you is, do you know how to find the path in which the script "thinks"
the file lives?  Is there a "print path" command that would work?

Thanks again,
Trent



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 29 Jun 1999 13:55:47 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: Week Number without Date Module?
Message-Id: <si4sjrxg9o.fsf@cre.canon.co.uk>

Dave Cross <dave@dave.org.uk> wrote:
> Of course, it all depends on what your definition of a week number is,

Use the standard!  (That is, ISO 8601 "Data elements and interchange
formats - Information exchange - Representation of dates and times"
http://www.iso.ch/markete/8601.pdf)

    3.17 week, calendar: A seven day period [...] starting on a Monday
    and identified by its ordinal number within the year; the first
    calendar week of the year is the one that includes the first
    Thursday of that year.  In the Gregorian calendar, this is
    equivalent to the week which includes 4 January.

-- 
Gareth Rees


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

Date: 29 Jun 1999 08:17:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Week Number without Date Module?
Message-Id: <3778d57a@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Gareth Rees <garethr@cre.canon.co.uk> writes:
:Use the standard!  (That is, ISO 8601 "Data elements and interchange
:formats - Information exchange - Representation of dates and times"
:http://www.iso.ch/markete/8601.pdf)

That's nice.  I'm sure the ISO folks have other standards as well, like
meters and grams.  But as always, existing practice has a strong voice.
Have you ever looked at American business calendars?  Many of these
have historically deemed the first week containing the first workday
(meaning Monday) as the first work week.

--tom
-- 
if (*name == '+' && len > 1 && name[len-1] != '|') {  /* scary */
    --Larry Wall, from doio.c in the v5.0 perl distribution 


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

Date: Tue, 29 Jun 1999 11:32:09 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: XML::Parser Objects Style problem
Message-Id: <3778A0A9.4DB06163@ericsson.com>

Ken Malone wrote:
> 
> my $str = "<address><street>Elm</street></address>";
> my $po = new XML::Parser(Style =>'Objects',Pkg =>'myObj');
> my $obj = $po->parse($str);
> print keys %$obj,"\n";
> print $obj->[0],"\n";
> 
> the printed values are "Kids" and "myObj::address=HASH(0xc7a14)" respectively.
> Everything else I try to print returns errors.  I've read the docs and still
> can't figure out how to access the hashed XML elements.  Please help.

You're just confused about Perl objects and references (which would
probably make it a bad idea to use the Objects style - any particular
reason you want to do this?). Read perlref and perlobj first.

When you've done that you'll realise that what you get is an instance of
a myObj::address object at the root of the tree, with a property Kids
which is an anon array containing an instance of a myObj::street object.
That object will have a property Kids which is an anon array containing
an instance of a myObj::Characters object.

If that all sounds too confusing, you probably don't want to be using
the Objects method, either that or use Data::Dumper to dump the
resulting structure.

The Objects style is a nice experiment, but of very little real world
use.

Matt.




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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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