[10426] in Perl-Users-Digest
Perl-Users Digest, Issue: 4019 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 20 13:03:13 1998
Date: Tue, 20 Oct 98 10:00:30 -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, 20 Oct 1998 Volume: 8 Number: 4019
Today's topics:
Re: All perl works with CGI????? (Jason)
Backgrounding long processes? <dvongrad@freerealtime.com>
Re: Backgrounding long processes? <dvongrad@freerealtime.com>
Re: Can someone help me with the following for a friend droby@copyright.com
Re: cgi-lib.pl vs CGI.pm? <keithmur@mindspring.com>
Re: count files.... <jdporter@min.net>
Re: EDI and perl <claytonn@psi.com>
End of File..... <dward@pla.net.au>
Re: End of File..... (Nathan V. Patwardhan)
Re: Filehandle(?) for read and write (Tad McClellan)
Re: Filehandle(?) for read and write (Greg Bacon)
Re: grrrrr, why not while(<blah>) <eashton@bbnplanet.com>
Re: help shorten one-liner <john_scrimsher@ex.cv.hp.com>
Re: help shorten one-liner (Sean McAfee)
Re: Help: Looking for AI modules <jdporter@min.net>
Re: how do you search subdirectories for a file? <jdporter@min.net>
Re: how to process fixes length record files (Daniel Beckham)
Re: Installing modules on Win'95 [The end] olrcc@scisun.sci.ccny.cuny.edu
Re: Installing modules on Win'95 (Randy Kobes)
Re: Installing modules on Win'95 (Randy Kobes)
Re: Installing modules on Win'95 (Nathan V. Patwardhan)
Re: Konvert function unpack in C++ - Code (Greg Bacon)
Re: New Module: File::Finder -- OO version of File::Fin <merlyn@stonehenge.com>
Re: New Module: File::Finder -- OO version of File::Fin <jdf@pobox.com>
Re: non blocking <stdin> (Tad McClellan)
Re: non blocking <stdin> (Greg Bacon)
Re: non blocking <stdin> <aqumsieh@matrox.com>
Northern Colorado Perl Mongers Meeting <gnat@frii.com>
Re: Perl "Packager" ?? (Statically-linked include file <mkruse@rens.com>
Re: Perl & window.open <johnc@interactive.ibm.com>
Re: PERL and a DATABASE.. (Daniel Beckham)
Re: Perl and resizing JPEGs <jdubois@keane.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Oct 1998 16:24:30 GMT
From: robobob@blech.mindwell.com (Jason)
Subject: Re: All perl works with CGI?????
Message-Id: <slrn72pe9u.lta.robobob@blech.mindwell.com>
On Wed, 21 Oct 1998 00:28:53 +1000, Steve Adams wrote:
>Hi all,
>
>open(FOO,">$filename") || die("Abandon Ship! \n $!");
>print FOO "$FORM\{'fwdaddress'}";
>close(FOO);
>system("ftp -nv ftp.ozemail.com.au <$FORM\{'ozuserid'}.ftp");
>system("rm $FORM\{'ozuserid'}.ftp");
>system("rm $FORM\{'ozuserid'}.forward");
>print "\nMail Forwarding Complete!\n";
>
>Any help that would lead to a solution that works would be GREATLY
>appreciated. Thanks in advance for any help offered.
>
It doesnt work because you went overboard with the backslashes, everywhere
that you have $FORM\{'ozuserid'} should be $FORM{'ozuserid'}, I dont know why
you have backslashes here, but you dont need them.
--
Jason Kohles -- Internet Consultant
http://www.mindwell.com/~jason/ jason@mindwell.com
ZenCrafters: Total Enlightenment in about an hour
------------------------------
Date: Tue, 20 Oct 1998 09:14:03 -0600
From: "David C. Vongrad" <dvongrad@freerealtime.com>
Subject: Backgrounding long processes?
Message-Id: <362CA8BB.A298172C@freerealtime.com>
I'd like to background a long process and still have my script run,
something like:
print "Script started.\n";
`grep -c mystring my-big-file.txt &`; # background this
print "Script ended.\n";
The print statements should execute one right after the other and the
grep finishes whenever. However, I don't get the second print until grep
is done. It's important that I be able to background the grep (or
whatever command), but I'm not sure how to do this.
How would I go about implementing something like this on a Unix machine?
TIA,
Dave
------------------------------
Date: Tue, 20 Oct 1998 10:30:46 -0600
From: "David C. Vongrad" <dvongrad@freerealtime.com>
To: Faisal Nasim <swiftkid@bigfoot.com>
Subject: Re: Backgrounding long processes?
Message-Id: <362CBAB6.A1D1589B@freerealtime.com>
This doesn't work, as exec terminates the Perl script and executes another
program in place of it. I should mention that the child process will most
likely outlive the parent, so this may make a difference. I've also tried
"fork", but no luck.
Faisal Nasim wrote:
> I am on Win98, not sure about Unix and Linux but i think it should be same!
>
> exec() runs the command and continues the application.
> system() runs the command and wait for it to finish.
>
> I guess that answers your question.
>
> so, instead of `` use exec()
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Whiz Kid - swiftkid@bigfoot.com
> http://wss.hypermart.net/
>
> David C. Vongrad wrote in message <362CA8BB.A298172C@freerealtime.com>...
> >I'd like to background a long process and still have my script run,
> >something like:
> >
> >print "Script started.\n";
> >`grep -c mystring my-big-file.txt &`; # background this
> >print "Script ended.\n";
> >
> >The print statements should execute one right after the other and the
> >grep finishes whenever. However, I don't get the second print until grep
> >is done. It's important that I be able to background the grep (or
> >whatever command), but I'm not sure how to do this.
> >
> >How would I go about implementing something like this on a Unix machine?
> >
> >TIA,
> >
> >Dave
> >
--
David C. Vongrad
FreeRealTime.com Inc.
#1, 217 - 10th Avenue SW
Calgary, Alberta
CANADA T2R 0A4
Phone: (403) 215 - 0106
Fax: (403) 215 - 0101
------------------------------
Date: Tue, 20 Oct 1998 15:43:48 GMT
From: droby@copyright.com
Subject: Re: Can someone help me with the following for a friend I know?
Message-Id: <70ib3k$np0$1@nnrp1.dejanews.com>
In article <1dh665v.pd353prfr6qN@bay1-269.quincy.ziplink.net>,
rjk@coos.dartmouth.edu (Ronald J Kimball) wrote:
> <richardhutnik@hotmail.com> wrote:
>
> > I had a friend send me the following request via email, for a PERL class
they
> > are taking. I was wondering if you could help me out here. Thanks.
>
> There's only one thing worse than coming to clpm to beg for help with
> your Perl homework.
>
> And that is coming to clpm to beg for help with someone else's Perl
> homework.
>
That can be easily topped. There must have been someone here on clpm sometime
begging for help with his Javascript homework!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 11:55:34 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: cgi-lib.pl vs CGI.pm?
Message-Id: <362CC086.206E4F7B@mindspring.com>
Is it not true that there is a CGI.pm replacement specifically for
mod_perl with Apache? And no cgi-lib.pl replacement? Or do I just not
know about it? If the above is true, that would be a really good reason
for some folks to use CGI.pm...
Marc Bissonnette wrote:
>
> Hey folks,
>
> I've been seeing an overwhelming amount of referance to CGI.pm in CLPM lately,
> and have been wondering if there would be a major shift in value added in me
> switching to it (aside from the obvious benefit of understanding more of the
> articles in CLPM :).
>
> Currently, I've been using cgi-lib.pl by Steven E. Brenner, which handles a lot
> of the mundane tasks of CGI quite nicely. Are there any overwhelming reasons to
> switch to CGI.pm? I went as far as to print out the docs on CGI.pm (or the
> source, I can't remember which), but for whatever reason put it on the back
> burner and kept on trundling along with cgi-lib.pl.
>
> Comments appreciated!
>
> --
> Marc Bissonnette
> InternAlysis
> Corporate Internet Research and Results!
> http://www.internalysis.com
------------------------------
Date: Tue, 20 Oct 1998 12:32:40 -0400
From: John Porter <jdporter@min.net>
Subject: Re: count files....
Message-Id: <362CBB28.E961D608@min.net>
Daniel Grisinger wrote:
>
> It is interesting to know that using `=>' in place of `,' can cause
> problems, though. Something else to avoid, I guess.
Exactly why I *never* use it except when I'm certain I want the
left side to be a string.
splice( @a => 4, 9 => @b )
is just plain absurd. So is
push @a => @b;
and
print $a => $b => "\n";
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 10:51:47 -0400
From: "niki clayton" <claytonn@psi.com>
Subject: Re: EDI and perl
Message-Id: <70i82i$gor$1@usenet1.interramp.com>
Don't know of any sites that talk about this, but I have written a perl
program to interface with EDI in an electronic store environment. Basically,
all it was, was a script that took order file information and reformatted it
all into EDI format.
Philip Mak wrote in message <36298C68.1513A69D@netvigator.com>...
>Anybody know of a good resource on the web that talks about
>implementation of EDI and perl? Specifically, I'm looking for info on
>how dynamic updating of code with perl is the next step in building EDI
>applications.
>
>Thanks,
>Phil.
>
------------------------------
Date: Tue, 20 Oct 1998 23:14:03 +1000
From: Darren Ward <dward@pla.net.au>
Subject: End of File.....
Message-Id: <362C8C9B.38A02364@pla.net.au>
What methods do people use for end of file detection on ascii flat file?
The way I tried seems to miss occasionally for a weird reason and I'd
like a better answer.
TIA
Darren
(Please reply via email)
------------------------------
Date: Tue, 20 Oct 1998 15:20:34 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: End of File.....
Message-Id: <6T1X1.48$3i7.6260@news.shore.net>
Darren Ward (dward@pla.net.au) wrote:
: What methods do people use for end of file detection on ascii flat file?
You might try eof() which is documented in perlfunc.
: The way I tried seems to miss occasionally for a weird reason and I'd
: like a better answer.
Which way did you try and how did it fail? :-)
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: Tue, 20 Oct 1998 07:35:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Filehandle(?) for read and write
Message-Id: <v20i07.ar6.ln@flash.net>
Michael Reutter (mw@workmail.com) wrote:
: is there a way (and i'm optimistic there is one in perl) to write
^^^^^^^^^^^^^^^^^^^^^^^
So you most surely looked one tiny little bit before posting. Right?
: something to a pipe and get the result?
I guess you missed it when you checked to see if your Question
has been Asked Frequently before:
Perl FAQ, part 8:
"How can I open a pipe both to and from a command?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 20 Oct 1998 16:16:04 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Filehandle(?) for read and write
Message-Id: <70id05$non$1@info.uah.edu>
In article <362C4370.B00133DC@workmail.com>,
Michael Reutter <mw@workmail.com> writes:
: is there a way (and i'm optimistic there is one in perl) to write
: something to a pipe and get the result?
This is a FAQ. Please consult Section 8 of the fine Perl FAQ.
Greg
--
In my opinion MS is a lot better at making money than it is at making good
operating systems.
-- Linus Torvalds
------------------------------
Date: Tue, 20 Oct 1998 16:28:38 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: grrrrr, why not while(<blah>)
Message-Id: <362CB7AF.97BDCFD2@bbnplanet.com>
Jim Brewer wrote:
> Please stop. You'll give *grumpy* a bad name. What, you want the
> world, as well as the people in it to be happy? What, are we supposed
> to be smiling as well? Next you'll be insisting on a daily dose of
> laughter. Stop. Now. Unspeakable evil!
Heh. /me passes the meds and mikey mouse ears around the group. I am
HappyFunBall afterall. An oxymoron by any other name. Now, go get your
gun and shoot everyone in your office. See, that's much better isn't it?
;)
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: Tue, 20 Oct 1998 08:55:42 -0700
From: "John P. Scrimsher" <john_scrimsher@ex.cv.hp.com>
Subject: Re: help shorten one-liner
Message-Id: <70ibq0$qqk@hpcvsnz.cv.hp.com>
#!/usr/local/bin/perl
$filename = shift(@ARGV);
open (FILE, "<$filename")
while(<FILE>)
{
$_ =~ s/\s//g;
$a += if(!(/\#/) && $_)
}
print "Lines in $filename: $a\n"
This should do everything that you are asking... It takes a filename as a
command line arg, opens the file and checks each line. First it converts
all spaces to nothing, creating one long string of characters or a nothing
string. If the line is blank after this or has a # anywhere in it, it is not
counted.
John Scrimsher
john_scrimsher@hp.com
jkane@my-dejanews.com wrote in message <70i2pp$g3r$1@nnrp1.dejanews.com>...
>I am new to perl, and am trying to learn it. As a learning tool I am
counting
>things in a perl script.
>
>I am trying to count the number of lines that have code and comments in
them.
>While NOT counting the lines that are ONLY comments, blank, or have a # as
>part of the text in the code. (I am helping myself by putting spaces after
>all #'s that are comments.) i.e.
>
> # Number of args left, plus the current one, give the remainder divided by
2.
> # If there are not an even number of arguments, it MUST be wrong.
>
> if (($#ARGV+1)%2) {
>
>Those four lines should NOT match at all!
>
>-Jeff Kane
>jeffkane@northwesternmutual.com
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 20 Oct 1998 16:37:48 GMT
From: mcafee@pacman.rs.itd.umich.edu (Sean McAfee)
Subject: Re: help shorten one-liner
Message-Id: <w%2X1.2757$fS.8438087@news.itd.umich.edu>
In article <70i2pp$g3r$1@nnrp1.dejanews.com>, <jkane@my-dejanews.com> wrote:
[snip, wants to do something in shortest number of lines]
># The minus one is because the pattern matches itself in the script.
># I am keeping a copy of this line in it as an example for future referance.
> a=`perl -ne 'print if /(;|{|}).*# .*/' perl_script | wc -l`;expr $a - 1
> perl -ne 'if(/(;|{|}).*# .*/){$a++;print $a-1,"\n";}' perl_script |tail -1
> perl -e 'while(<>){if(/(;|{|}).*# .*/){$a++;}}print $a-1,"\n";' perl_script
>Anybody have a better way of doing this?? The shortest one has to use 'wc -l'
>and `expr`. I want to make this ONLY perl.
perl -lne '$a++ if /(;|{|}).*# .*/; END { print $a-1 }' perl_script
>FYI: The pattern is looking for a semicolon, right curly brace, or left curly
>brace followed by anything, a #, a space, and finally anything more. I figure
>that there will never be comments in the middle of a line that does not have
>one of these chars delimiting the end of it. Am I wrong?
Not if you only parse your own code and adhere to your own guidelines, but
in general, yes. Example:
${#} = "not a comment (admittedly doesn't match your pattern precisely)";
if # comment 1
( # comment 2
m# not a comment; #
) # comment 3
{ s#not a#comment;#;
print q#Still not a comment;#
}
In general, you'd need some kind of lexical analyzer, and Perl source is
notoriously difficult to parse.
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Tue, 20 Oct 1998 12:39:12 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Help: Looking for AI modules
Message-Id: <362CBCB0.AE6066C0@min.net>
John Scrimsher wrote:
>
> Does anyone know of any AI (Artificial Intelligence) modules that
> may be available that I could set up rules to base responses on?
Have you looked at CPAN?
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 12:01:12 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how do you search subdirectories for a file?
Message-Id: <362CB3C8.D94A2D2E@min.net>
Rob Bridal wrote:
>
> Make your own recursive thing.
A VERY bad idea.
Although not as bad as posting in HTML.
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 11:43:05 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: how to process fixes length record files
Message-Id: <MPG.10967998e27c4bb798968f@news.supernews.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
What's wrong with the read function? It reads the exact length you need
from the file. Actually, using read would depend on how the records are
setup. If they are records made of fixed length fields that are
seperated by a newline, then you don't need read. You could just read
each record in one at a time using the <> operator and then use the
substr function to pull out each field.
If you can provide more information, such as exactly how your data is
laid out, I think you might get a better answer.
Regards,
Daniel Beckham
In article <01bdfc12$4b056ea0$4737000a@tl000143>,
tim.schelfhout@telenet.be says...
> Hi there,
>
> I've been trying to process files with a fixed length records content
> (fields of 25 bytes).
> Is there perhaps a function I don't know about that would take care of this
> ? Some of the fields are not filled in so I can't do it wit split !!
>
> I've done it with <read TEST,$veld,25> but I think it's rather stupid.
> there must be a more intelligent way to go about it.
>
> Thanks beforehand
>
> See ya
>
>
>
------------------------------
Date: Tue, 20 Oct 1998 15:24:08 GMT
From: olrcc@scisun.sci.ccny.cuny.edu
Subject: Re: Installing modules on Win'95 [The end]
Message-Id: <70i9uo$mnj$1@nnrp1.dejanews.com>
In article <362BDB8E.DA448746@spider.herston.uq.edu.au>,
Jaime Metcher <metcher@spider.herston.uq.edu.au> wrote:
> I seem to recall that one of the perl README's states that the perl
> makefiles will work with dmake or nmake, but not with GNU (i.e. cygwin)
> make. I also seem to recall that your average makefile is going to bomb
> under Win95 anyway, because of problems (i.e. things missing) with the
> command shell.
>
Yes, you are absolutely right - I was using "wrong" make. With nmake
installed, everything works fine now.
I thank everybody who sent me their suggestions.
Cheers,
Oleg
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 20 Oct 1998 14:46:46 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Installing modules on Win'95
Message-Id: <slrn72p931.qv6.randy@theory.uwinnipeg.ca>
On Mon, 19 Oct 1998 18:53:10 GMT,
olrcc@scisun.sci.ccny.cuny.edu <olrcc@scisun.sci.ccny.cuny.edu> wrote:
>Hi everybody,
>
>I'm having a problem with installing Perl Modules on Windows 95.
>I've got ActiveState Perl 5.005002 built and Cygwin port of make
>(latest release).
>
>Doing the standard routine
>
>1. perl Makefile.PL <-- fine
>2. make <-- produces an error
> Makefile:644: *** missing separator
[snip]
Hi,
I believe that ActiveState defaults to nmake (Microsoft's make);
look in your perl's C:\Perl\5.00502\lib\MSWin32-x86-object\Config.pm
for the make=... line. You would have to change this to whatever
make you have - eg, nmake, or dmake as used in GSAR's port. I'm not sure
how successful the cygwin make would be - if it doesn't work, try
nmake or dmake (available at http://www-personal.umich.edu/~gsar/).
Microsoft provides nmake at
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake.exe
This self-extracting archive contains nmake.exe, nmake.err, and
nmake.txt - put the .exe and .err files in a directory in your path.
When installing modules, make sure to use the make as
specified in Config.pm: eg, for nmake,
perl Makefile.PL
nmake
nmake test
nmake install
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: 20 Oct 1998 15:02:46 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Installing modules on Win'95
Message-Id: <slrn72pa11.qv6.randy@theory.uwinnipeg.ca>
On Tue, 20 Oct 1998 10:38:38 +1000,
Jaime Metcher <metcher@spider.herston.uq.edu.au> wrote:
>I seem to recall that one of the perl README's states that the perl
>makefiles will work with dmake or nmake, but not with GNU (i.e. cygwin)
>make. I also seem to recall that your average makefile is going to bomb
>under Win95 anyway, because of problems (i.e. things missing) with the
>command shell.
[ snip ]
Hi,
That's not necessarily true that makefiles bomb under Win95;
although the READMEs certainly state that NT is preferred, people
install modules under Win95/98 quite successfully, even ones that
need a C compiler. Even so, and also for other reasons, one might
want to look at the 4DOS utilities at
http://www.jpsoft.com/
I find it worthwhile just for the tab filename completion alone ...
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Tue, 20 Oct 1998 15:17:34 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Installing modules on Win'95
Message-Id: <iQ1X1.47$3i7.6260@news.shore.net>
olrcc@scisun.sci.ccny.cuny.edu wrote:
: I'm having a problem with installing Perl Modules on Windows 95.
: I've got ActiveState Perl 5.005002 built and Cygwin port of make
: (latest release).
If you're not bound to MSVC++ (for XS and such), I'd suggest using
'dmake'. In fact, I'm pretty sure that this is documented in
README.win32 which is bundled with the Perl source distribution. You
can pick up a copy of 'dmake' from http://www.umich.edu/~gsar/ .
Then it will be a matter of:
perl Makefile.PL
dmake
dmake test
dmake install
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: 20 Oct 1998 16:26:04 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Konvert function unpack in C++ - Code
Message-Id: <70idis$non$3@info.uah.edu>
In article <70hop8$cp7$1@bsdti6.sdm.de>,
lorenz@sdm.de (Harald Lorenz) writes:
: I have to convert a perl-script to C++ - Code.
I'm sorry to hear that. :-(
: Can anybody tell my how to translate the function
: unpack ?
Grab the perl source from the CPAN and have a look yourself. :-)
: My special Part of the perl-code:
:
: unpack ( "%32C*", $str )
:
: where $str is a <normal string>.
>From perldoc -f unpack:
In addition, you may prefix a field with a %<number> to indicate
that you want a <number>-bit checksum of the items instead of the
items themselves. Default is a 16-bit checksum. For example, the
following computes the same number as the System V sum program:
while (<>) {
$checksum += unpack("%16C*", $_);
}
$checksum %= 65536;
So you could either borrow the checksum code from the perl source or
write your own.
Greg
--
Ironic, isn't it, Smithers? This anonymous clan of slackjawed troglodytes just
cost me the election, but if I were to have them killed, I would be the one to
go to jail. That's democracy for you.
-- Mr. Burns
------------------------------
Date: Tue, 20 Oct 1998 16:03:27 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <8ck91vw792.fsf@gadget.cscaper.com>
>>>>> "John" == John Porter <jdporter@min.net> writes:
>> File::Find is perfectly simple. Why obfuscate it?
John> Global variables in the interface? Ugh.
File::Find uses chdir, as does your File::Finder. Therefore, you
cannot have two instances of a "File::Finder" object alive without
completely rehacking the code to remove chdir(), and therefore making
it significantly slower since you must continually use full paths in
stat calls.
So, if you can have only a sole instance, global variables make sense.
The right design for the right job. I agree with tchrist and
others... in response to your first posting, I almost had to look at
the calendar to make sure it wasn't April 1st.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 20 Oct 1998 18:14:32 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <m3ogr7xlav.fsf@joshua.panix.com>
Randal Schwartz <merlyn@stonehenge.com> writes:
> So, if you can have only a sole instance, global variables make sense.
Whereas I've been idly wondering whether it might be nice to see
sub wanted {
my ($fullname, $dir, $shortname) = @_;
# etc.
}
find( \&wanted, '/foo' );
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 20 Oct 1998 07:37:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: non blocking <stdin>
Message-Id: <660i07.ar6.ln@flash.net>
Matalon, Cyril (cyrilm@nortel.ca) wrote:
: Does anyone how to perform a no blocking read of stdin ?
: I would like to test if a key was pressed in a while (1) loop.
Perl FAQ, part 5:
"How can I tell if there's a character waiting on a filehandle?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 20 Oct 1998 16:19:15 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: non blocking <stdin>
Message-Id: <70id63$non$2@info.uah.edu>
In article <362C4D42.D2CD8887@nortel.ca>,
"Matalon, Cyril" <cyrilm@nortel.ca> writes:
: Does anyone how to perform a no blocking read of stdin ?
: I would like to test if a key was pressed in a while (1) loop.
You might find the Term::ReadKey module (available on the CPAN) to be
of use.
Greg
--
Bluto: My advice to you is to start drinking heavily.
Otter: Better listen to him, Flounder. He's pre-med.
------------------------------
Date: Tue, 20 Oct 1998 12:11:35 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: non blocking <stdin>
Message-Id: <Pine.SUN.3.96.981020120930.13266A-100000@tigre.matrox.com>
On Tue, 20 Oct 1998, Matalon, Cyril wrote:
> Does anyone how to perform a no blocking read of stdin ?
> I would like to test if a key was pressed in a while (1) loop.
I believe you need to use the select() function. Read some documentation
of it.
Hope this helps,
--
Ala Qumsieh email: aqumsieh@matrox.com
ASIC Design Engineer phone: (514) 822-6000 x7581
Matrox Graphics Inc. (old) webpage :
Montreal, Quebec http://www.cim.mcgill.ca/~qumsieh
------------------------------
Date: 20 Oct 1998 09:52:03 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Northern Colorado Perl Mongers Meeting
Message-Id: <5qiuhfcjto.fsf@prometheus.frii.com>
The next Northern Colorado Perl Mongers meeting will be at 6:00pm Wed
28 Oct, at the Sportscaster Bar and Grill, 165 E Boardwalk, Fort
Collins. Be there or be a tcl programmer. If you have any questions,
please let me know.
Nat
------------------------------
Date: Tue, 20 Oct 1998 11:03:44 -0700
From: "Matt Kruse" <mkruse@rens.com>
Subject: Re: Perl "Packager" ?? (Statically-linked include files)
Message-Id: <70ic9s$ih3$1@news1-alterdial.uu.net>
I looked, but I don't think this does what I'm asking for. I only want
included files and modules in-lined into one perl script, so I don't
have any "require" or "use" statements in my perl script.
Martien Verbruggen wrote in message ...
>In article <70gos6$e5h$1@news1-alterdial.uu.net>,
> "Matt Kruse" <mkruse@rens.com> writes:
>> Is there such a thing as a "Perl Packager"??
>
># perldoc CPAN
>look for Bundles
>
>Martien
>--
>Martien Verbruggen |
>Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
>Commercial Dynamics Pty. Ltd. | make a better idiot.
>NSW, Australia |
------------------------------
Date: Tue, 20 Oct 1998 11:31:36 -0400
From: John Call <johnc@interactive.ibm.com>
Subject: Re: Perl & window.open
Message-Id: <362CACD8.FA148264@interactive.ibm.com>
> >That sounds as if you want to ask a browser to do something. The docs,
> > >FAQs, and newsgroups about browsers should be of help to you. Good luck!
> >
> > You are beginning to sound like a broken record.......
> >
>
> Because he repeatedly gives the same nice polite answer to the constantly
> repeating class of stupidly directed questions?
>
> Tom is trying to persuade people to put their questions in the right place.
> If he wants to use a cut & paste operation to avoid extra typing, that's
> fine.
I couldn't agree more. Some of the biggest 'arguements' on this list is about
courtesy vs. directing people to the FAQs in an obvious way. Tom has found a
way to do both, redirecting to the FAQs in a courteous manner. Give him a pat
on the back, not a knife in it!
John Call
------------------------------
Date: Tue, 20 Oct 1998 11:36:54 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: PERL and a DATABASE..
Message-Id: <MPG.1096782514eeab8598968e@news.supernews.com>
You should definatly take a look at MySQL and mSQL. Both are very nice
and easy to use databases and there is a module on CPAN that allows you
to manipulate the databases to your hearts desire. I've used it quite a
bit and it's very usable and quick too...
http://www.mysql.org/ should get you started.
Regards,
Daniel Beckham
In article <70hjhl$1dg$1@flex.london.pipex.net>,
webmaster_NO*SPUDS*@dportal.co.uk says...
> I would like to query a database using PERL (and something like SQL), but I
> can only seem to be able to do this on NT, does anyone know of any
> UNIX/LINUIX database's that I can query using PERL. (If there FREE then even
> better ;-) ).
>
> Webmaster DPortal
> http://www.dportal.co.uk/
> to email from _NOSPUDS* from the address.
>
>
>
------------------------------
Date: Tue, 20 Oct 1998 11:01:59 -0400
From: Joseph DuBois <jdubois@keane.com>
To: michael@mks-tech.com
Subject: Re: Perl and resizing JPEGs
Message-Id: <362CA5E7.8B187308@keane.com>
"Michael K. Steeves" wrote:
> This doesn't have to be be a perl issue but...
>
> I need either some perl code or a standalone application that will let me
> resize jpegs (create thumbnails) without haveing to do each one manually. I
> don't see anything in the tk modules which will allow resizing. I want to be
> able to call it from a perl script.
>
> Any help is much appreciated!
>
> Michael
>
> michael@mks-tech.com
> http://mks-tech.com/mks
If you take a look at the following link (good place for articles), you will
find a column about such an exact thing along with the source code.
http://www.stonehenge.com/merlyn/WebTechniques/col29.html (Article)
http://www.stonehenge.com/merlyn/WebTechniques/ (Listing of Articles)
http://www.stonehenge.com/merlyn/WebTechniques/col29.listing.txt (Source code
for Article)
Hope this helps
-------------------------------------------------------
Joseph DuBois (Internet/Intranet Specialist)
mailto:jdubois@keane.com (Work) http://www.keane.com/
------------------------------
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 4019
**************************************