[15603] in Perl-Users-Digest
Perl-Users Digest, Issue: 3016 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 11 11:05:32 2000
Date: Thu, 11 May 2000 08:05:11 -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: <958057511-v9-i3016@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 11 May 2000 Volume: 9 Number: 3016
Today's topics:
Re: Beginner: 8bit-regexp <rootbeer@redcat.com>
Re: Best Mail module? <rootbeer@redcat.com>
Re: CGI.pm <camerond@mail.uca.edu>
Converting a Perl script into an executable tamiraw@my-deja.com
Re: Digest javascript within perl? <rootbeer@redcat.com>
DIVERTING TO A WEB PAGE <cheaton@clhs.rochdale.sch.uk>
Re: Faster Access Time to Random Element <jeff@vpservices.com>
Getting System call return data <john.komp@uscorp.net>
Re: Getting System call return data <billy@arnis-bsl.com>
Re: Getting the text of a subroutine? <aqumsieh@hyperchip.com>
Re: How to delete one field in each line ? <billy@arnis-bsl.com>
Re: How to delete one field in each line ? (Bart Lateur)
Re: How to inspect "my" variables in perldebug? <rootbeer@redcat.com>
Re: How to make SNMP in parallel? <rootbeer@redcat.com>
Re: HOW: I want to set the time... <lmoran@wtsg.com>
Re: HOW: I want to set the time... <jeff@vpservices.com>
Re: HOW: I want to set the time... (Tim Coleman)
Re: I need help installing Perl <allanon.69@no.spam.bigpond.com>
Need to make UNIX autoresponder acunet3278@my-deja.com
Re: Perl and JavaScript combination please help..... (Will England)
Perl Script aborting on 0x1A jenningsii@my-deja.com
Re: Please check my 'random' code <sariq@texas.net>
Re: POSIX shared memory and Perl <rootbeer@redcat.com>
Re: problem: fork and then connecting to another server <latsharj@my-deja.com>
Re: Seeking a file <sariq@texas.net>
Re: signal trapper <rootbeer@redcat.com>
Re: simple link checker needed <rootbeer@redcat.com>
Re: Still a double insert with DBI <red_orc@my-deja.com>
Re: Still having problems with cgi under IIS <Hamza.Sadiq@bridge.bellsouth.com>
Re: Still having problems with cgi under IIS <Hamza.Sadiq@bridge.bellsouth.com>
Re: Using Modules Breaks "-w"? <rootbeer@redcat.com>
Re: Video comes in bursts jlucande@my-deja.com
Re: Video comes in bursts (Bart Lateur)
Re: Video comes in bursts <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 11 May 2000 06:50:18 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Beginner: 8bit-regexp
Message-Id: <Pine.GSO.4.10.10005110647040.16364-100000@user2.teleport.com>
On Wed, 10 May 2000 ocromm@my-deja.com wrote:
> I'm using regexps to find similar strings in a dictionary (to describe
> it easily), but they're all in German, and perl doesn't like my
> non-7bit-characters in regexps (fine with strings, though).
I don't see why it would. Could you make a small example which should
match but doesn't? Since you'll be using non-ASCII characters, be sure to
specify them in a way which can work on other people's machines. That is,
maybe something like this:
my $string = "\xde\xad\xbe\xef";
if (/\xad/) { ... }
> A quick search shows me that it has to do with uing the locale, but
> how do I do it? Where can I find example code?
For installing a locale? For using a locale? Start with the perllocale
(not perllocal!) manpage.
Is it a case-insensitive pattern where it's a non-ASCII character that's
in the wrong case?
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 07:03:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Best Mail module?
Message-Id: <Pine.GSO.4.10.10005110701410.16364-100000@user2.teleport.com>
On Wed, 10 May 2000, Cynthia Rossbach wrote:
> Im working on a program that will need to send mail as well has read the
> body of mail messages. The server has "mail", "sendmail", "Qmail".
> Solaris 8, Perl 5.6.
>
> I would appreciate any and all suggestions on the best module for my
> needs.
Define "best". What's best for me may not be best for you, and there's no
point in any of us wasting our time until you can say just what you want.
You may need to choose among fastest, most memory efficient, easiest to
program, fewest lines of code, most robust, most portable, easiest to
debug, easiest to maintain, most like your other favorite programming
languages, or perhaps you mean some other criterion. (Of course, one
solution may fall into more than one of these categories.)
Having said that, there are plenty of modules on CPAN for working with
mail. You can even read their docs over the web, to try to see which would
suit your needs.
http://search.cpan.org/
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 09:17:21 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: CGI.pm
Message-Id: <391AC0F1.EFB6D979@mail.uca.edu>
Uri Guttman wrote:
>
> ... for more, read my hash slice tutorial
> at:
>
> http://www.sysarch.com/perl/tutorials/hash_slices.txt
Thanks, uri. Will there be more tutorials, a continuing series, perhaps?
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Thu, 11 May 2000 13:22:18 GMT
From: tamiraw@my-deja.com
Subject: Converting a Perl script into an executable
Message-Id: <8fec5p$tju$1@nnrp1.deja.com>
Hello all:
I am having trouble converting my perl script into an .exe file.
Before I ran perl2exe <myscript.pl>, I placed the appropriate dll files
where my script was located, but for some reason it keeps telling me
that I need to insert the dll's again. My output was as follows....
Perl2Exe V3.05-AP5xx B05 Copyright (c) 1997-1998 Mercury Systems
Pro version
Registered to Joe Scelsa<joseph.scelsa@mail.tju.edu>
Converting 'netswitch.pl' to netswitch.exe
Compiling netswitch.pl
Compiling c:\perl\site\lib\win32\eventlog.pm
Compiling c:\perl\site\lib\auto\win32\eventlog\eventlog.dll
Compiling sender.pm
Compiling c:\perl\site\lib\tk.pm
Compiling c:\perl\site\lib\auto\tk\tk.dll
Compiling c:\perl\site\lib\auto\tk\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\break.al
Compiling c:\perl\site\lib\auto\tk\cancelrepeat.al
Compiling c:\perl\site\lib\auto\tk\clipboard.al
Compiling c:\perl\site\lib\auto\tk\enterfocus.al
Compiling c:\perl\site\lib\auto\tk\error.al
Compiling c:\perl\site\lib\auto\tk\findinc.al
Compiling c:\perl\site\lib\auto\tk\firstmenu.al
Compiling c:\perl\site\lib\auto\tk\focuschildren.al
Compiling c:\perl\site\lib\auto\tk\focusfollowsmouse.al
Compiling c:\perl\site\lib\auto\tk\focusnext.al
Compiling c:\perl\site\lib\auto\tk\focusok.al
Compiling c:\perl\site\lib\auto\tk\focusprev.al
Compiling c:\perl\site\lib\auto\tk\idletasks.al
Compiling c:\perl\site\lib\auto\tk\imagenames.al
Compiling c:\perl\site\lib\auto\tk\imagetypes.al
Compiling c:\perl\site\lib\auto\tk\interps.al
Compiling c:\perl\site\lib\auto\tk\lsearch.al
Compiling c:\perl\site\lib\auto\tk\receive.al
Compiling c:\perl\site\lib\auto\tk\repeatid.al
Compiling c:\perl\site\lib\auto\tk\selection.al
Compiling c:\perl\site\lib\auto\tk\tabfocus.al
Compiling c:\perl\site\lib\auto\tk\traversetomenu.al
Compiling c:\perl\site\lib\auto\tk\updatewidgets.al
Compiling c:\perl\lib\vars.pm
Compiling c:\perl\lib\exporter.pm
Compiling c:\perl\lib\dynaloader.pm
Compiling c:\perl\lib\auto\dynaloader\autosplit.ix
Compiling c:\perl\lib\auto\dynaloader\dl_expandspec.al
Compiling c:\perl\lib\auto\dynaloader\dl_findfile.al
Compiling c:\perl\lib\auto\dynaloader\dl_find_symbol_anywhere.al
Compiling c:\perl\lib\exporter.pm
Compiling c:\perl\lib\filehandle.pm
Compiling c:\perl\lib\socket.pm
Compiling c:\perl\lib\auto\socket\socket.dll
Compiling c:\perl\lib\file\basename.pm
Compiling c:\perl\lib\re.pm
Compiling c:\perl\site\lib\mime\base64.pm
Compiling c:\perl\site\lib\auto\mime\base64\base64.dll
Compiling c:\perl\site\lib\mime\quotedprint.pm
Compiling c:\perl\lib\autoloader.pm
Compiling c:\perl\lib\base.pm
Compiling c:\perl\lib\strict.pm
Compiling c:\perl\lib\symbol.pm
Compiling c:\perl\lib\carp.pm
Compiling c:\perl\site\lib\tk\submethods.pm
Compiling c:\perl\site\lib\tk\widget.pm
Compiling c:\perl\site\lib\auto\tk\widget\askludge.al
Compiling c:\perl\site\lib\auto\tk\widget\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\widget\clipboardkeysyms.al
Compiling c:\perl\site\lib\auto\tk\widget\pathname.al
Compiling c:\perl\site\lib\tk\image.pm
Compiling c:\perl\site\lib\tk\mainwindow.pm
Compiling c:\perl\site\lib\tk\io.pm
Compiling c:\perl\site\lib\auto\tk\io\io.dll
Compiling c:\perl\site\lib\tk\dialog.pm
Compiling c:\perl\site\lib\tk\coloreditor.pm
Compiling c:\perl\site\lib\tk\fbox.pm
Compiling c:\perl\lib\io\file.pm
Compiling c:\perl\lib\fcntl.pm
Compiling c:\perl\lib\auto\fcntl\fcntl.dll
Compiling c:\perl\lib\term\cap.pm
Compiling c:\perl\lib\integer.pm
Compiling c:\perl\lib\fields.pm
Compiling c:\perl\site\lib\tk\after.pm
Compiling c:\perl\site\lib\tk\pretty.pm
Compiling c:\perl\site\lib\tk\adjuster.pm
Compiling c:\perl\lib\tie\scalar.pm
Compiling c:\perl\site\lib\tk\cmdline.pm
Compiling c:\perl\site\lib\auto\tk\cmdline\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\cmdline\loadresources.al
Compiling c:\perl\site\lib\auto\tk\cmdline\setresources.al
Compiling c:\perl\site\lib\tk\toplevel.pm
Compiling c:\perl\site\lib\auto\tk\toplevel\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_bindin.al
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_bindout.al
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_create.al
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_destroy.al
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_in.al
Compiling c:\perl\site\lib\auto\tk\toplevel\fg_out.al
Compiling c:\perl\lib\io\handle.pm
Compiling c:\perl\lib\io.pm
Compiling c:\perl\lib\auto\io\io.dll
Compiling c:\perl\site\lib\tk\frame.pm
Compiling c:\perl\site\lib\auto\tk\frame\addscrollbars.al
Compiling c:\perl\site\lib\auto\tk\frame\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\frame\findmenu.al
Compiling c:\perl\site\lib\auto\tk\frame\freeze_on_map.al
Compiling c:\perl\site\lib\auto\tk\frame\label.al
Compiling c:\perl\site\lib\auto\tk\frame\labelpack.al
Compiling c:\perl\site\lib\auto\tk\frame\labelvariable.al
Compiling c:\perl\site\lib\auto\tk\frame\packscrollbars.al
Compiling c:\perl\site\lib\auto\tk\frame\queuepack.al
Compiling c:\perl\site\lib\auto\tk\frame\sbset.al
Compiling c:\perl\site\lib\auto\tk\frame\scrollbars.al
Compiling c:\perl\lib\subs.pm
Compiling c:\perl\site\lib\tk\iconlist.pm
Compiling c:\perl\lib\cwd.pm
Compiling c:\perl\site\lib\tk\pixmap.pm
Compiling c:\perl\site\lib\auto\tk\pixmap\pixmap.dll
Compiling c:\perl\lib\selectsaver.pm
Compiling c:\perl\lib\io\seekable.pm
Compiling c:\perl\site\lib\tk\menu.pm
Compiling c:\perl\lib\io\pipe.pm
Compiling c:\perl\lib\io\socket.pm
Compiling c:\perl\site\lib\tk\derived.pm
Compiling c:\perl\site\lib\tk\scrollbar.pm
Compiling c:\perl\site\lib\auto\tk\scrollbar\scrollbar.dll
Compiling c:\perl\site\lib\auto\tk\scrollbar\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\scrollbar\buttondown.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\buttonup.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\classinit.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\drag.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\enddrag.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\enter.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\leave.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\motion.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\scrlbypages.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\scrlbyunits.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\scrltopbottom.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\scrltopos.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\select.al
Compiling c:\perl\site\lib\auto\tk\scrollbar\startdrag.al
Compiling c:\perl\site\lib\tk\label.pm
Compiling c:\perl\site\lib\tk\wm.pm
Compiling c:\perl\site\lib\auto\tk\wm\anchoradjust.al
Compiling c:\perl\site\lib\auto\tk\wm\autosplit.ix
Compiling c:\perl\site\lib\auto\tk\wm\fullscreen.al
Compiling c:\perl\site\lib\auto\tk\wm\iconposition.al
Compiling c:\perl\site\lib\auto\tk\wm\popup.al
Compiling c:\perl\site\lib\auto\tk\wm\post.al
Compiling c:\perl\site\lib\tk\menu\item.pm
Compiling c:\perl\lib\config.pm
Compiling c:\perl\site\lib\tk\configure.pm
The following dll's are required to run the exe file:
perlcrt.dll (this can be found in your windows system directory)
I checked the directory for the hidden files and sure enough it was
there. I don't know what the problem is. Can someone enlighten me?
FYI: Perl v5.005_03 and Perl2Exe V3.05-AP5xx B05.
Thanks in advance,
Tamira
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 06:51:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Digest javascript within perl?
Message-Id: <Pine.GSO.4.10.10005110650400.16364-100000@user2.teleport.com>
On Wed, 10 May 2000, David Pautler wrote:
> I want to scrape webpages with Perl, but many pages include
> JavaScript as actions for html forms or for generating
> sections of html that recur over many pages.
>
> Is there a module that runs JS?
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://search.cpan.org/
http://www.cpan.org/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 06:20:00 -0700
From: chris <cheaton@clhs.rochdale.sch.uk>
Subject: DIVERTING TO A WEB PAGE
Message-Id: <02ae6d44.66294d2d@usw-ex0109-069.remarq.com>
I have written a PERL script to copy the contents of a form
to a temporary file and then send it to a pre-defined e-
mail address. This works fine, what I would like to do now
is to direct the user to a defined web-page (URL) after the
mail has been sent. I assume this can be written in PERL
and be placed at the end of my existing code.
I would appreciate any information as this is extremly
URGENT!!!!!
Thanks in advance,
Chris Heaton.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Thu, 11 May 2000 06:35:50 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Faster Access Time to Random Element
Message-Id: <391AB736.920FBE02@vpservices.com>
"Randal L. Schwartz" wrote:
>
> >>>>> "Jeff" == Jeff Zucker <jeff@vpservices.com> writes:
>
> Jeff> I am not by any means knowledgeable about speed issues, but what about
> Jeff> finding the size of the file, choosing a random bit from within the
> Jeff> file, doing a binary read with a seek to that random position then
> Jeff> finding the closest full line to that seek position. No hash, no
> Jeff> counter, nada!
>
> That favors the longer lines.
So find the average line length (which you could presumbably do once
outside the script as soon as you had a big enough sample so you
wouldn't have to do it for each script invocation) and do the seeks with
that in mind?
--
Jeff
------------------------------
Date: Thu, 11 May 2000 08:42:34 -0500
From: "John W. Komp" <john.komp@uscorp.net>
Subject: Getting System call return data
Message-Id: <391AB8CA.32A71EB0@uscorp.net>
Hi,
I've got a list of files which I want to search my local directory tree
for. The list was generated in a Perl script so I'd like to stay in Perl
during the search. I figured I'd use the system call 'find' to do the
searching. My code fragment looks like:
$findargs = ". -name \"*$item*\" -print";
$pid = open(FINDER, "find $findargs |");
while(<FINDER>) {
$dirstr .= $_;
}
$dirstr =~ s/\n//;
close(FINDER);
where $item is the name of the file I'm currently looking for.
This script works fine on my Solaris box using Perl 5.00404. On my
NT box the script attempts to perform the find but appears to get jammed
returning the find results and posts a message 'Invalid access to memory
location.'. The NT box is running 5.005_03, binary build 517 from
ActiveState Tool. I'm running the script in an emacs shell in both
cases. The find on the NT box is from the Cygnus package.
How do I get the find results back on the NT box or is there a better
way to do solve the problem?
Thanks
-John
--
****************************************************
This morning I shot six holes in my freezer
I think I've got cabin fever
Somebody sound the alarm
- J. Buffett
****************************************************
------------------------------
Date: Thu, 11 May 2000 14:46:46 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Getting System call return data
Message-Id: <8feh4g$3ea$1@nnrp1.deja.com>
In article <391AB8CA.32A71EB0@uscorp.net>,
"John W. Komp" <john.komp@uscorp.net> wrote:
>
> Hi,
>
> I've got a list of files which I want to search my local directory tree
> for. The list was generated in a Perl script so I'd like to stay in Perl
> during the search. I figured I'd use the system call 'find' to do the
> searching. My code fragment looks like:
>
> $findargs = ". -name \"*$item*\" -print";
> $pid = open(FINDER, "find $findargs |");
> while(<FINDER>) {
> $dirstr .= $_;
> }
> $dirstr =~ s/\n//;
> close(FINDER);
>
> where $item is the name of the file I'm currently looking for.
>
> This script works fine on my Solaris box using Perl 5.00404. On my
> NT box the script attempts to perform the find but appears to get jammed
> returning the find results and posts a message 'Invalid access to memory
> location.'. The NT box is running 5.005_03, binary build 517 from
> ActiveState Tool. I'm running the script in an emacs shell in both
> cases. The find on the NT box is from the Cygnus package.
>
> How do I get the find results back on the NT box or is there a better
> way to do solve the problem?
>
Use File::Find method (AFAIK part of perl distribution). It will be faster
and (IMHO) more portable than calling en external program (find). Colsult
File::Find pod for details (it contains code examples so I find useless to
post here additional ones).
Good luck.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 14:40:06 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Getting the text of a subroutine?
Message-Id: <7a8zxh881l.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
Sydney Lu <slu_2@altavista.net> writes:
> I'm learning Perl/Tk, and the one thing I can't stand is having all
> these hash-key value pairs stuck in the middle of my program, when as
> far as I'm concerned, things like window positioning and the style of
> buttons should be data.
I don't get your point there. What's wrong with key-value pairs? and
what do you mean by "window positioning and the style of buttons should
be data" ?
> So I wrote a little module that can read a file, and stick value pairs
> like -expand=1 and -anchor=NW into a hash. The filehandle seems to
> like to quote everything, so I had to do unholy evals to get anonymous
> subroutine references into the hash correctly (for -command).
I still don't understand the purpose of your module, but anyway ...
> Now my question is, given a reference to an anonymous subroutine, is
> there ANY way I can get back a string that contains that subroutine?
No. But you said that you read the subroutine from the file, and then
eval() it. So why not keep a copy of the subroutine's body *before*
eval()ing it?
--Ala
------------------------------
Date: Thu, 11 May 2000 13:09:33 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: How to delete one field in each line ?
Message-Id: <8febe2$sdu$1@nnrp1.deja.com>
In article <8fe8fh$8el$5@news2.kornet.net>,
"Joe" <koreags@thrunet.com> wrote:
> It works nothing, Somethings wrong with this ?
> open(FILE, Day.txt") || die "I can't re-open Day.txt$!\n";
> while (<FILE>) {
> s/^.*?\|//;
> print FILE;
> }
> close(FILE) ;
>
First, you missed a double-quote in "Day.txt".
What you are trying to do is described in perlfaq5. Try 'perldoc perlfaq5' on
your local system or http://www.cpan.org/doc/manual/html/pod/perlfaq5.html.
You'll find the following FAQ in am document: "How do I change one line in a
file/delete a line in a file/insert a line in the middle of a file/append to
the beginning of a file?" Read it ASAP, it contains also examples.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 14:10:31 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to delete one field in each line ?
Message-Id: <3923bed6.18200002@news.skynet.be>
Joe wrote:
>Will you please direct me this ?
>
>I want to delete one value in each line.
>
>These lines (split by \|)
>aaa|1111
>eee|2222
>ooo|3333
>
>To (delete first value together with split \|)
>1111
>2222
>3333
Simple solution:
s/^([^\|]*\|//;
run under switches -p and -i.bak (to overwrite the original file).
More generic solution (you may change the column number in $col):
my $col = 0;
($\,$,) = ("\n",'|');
while(<>) {
chomp;
my @data = split /\|/;
splice @data, $col, 1;
print @data;
}
Run normally, optionally with -i.bak.
--
Bart.
------------------------------
Date: Thu, 11 May 2000 07:41:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to inspect "my" variables in perldebug?
Message-Id: <Pine.GSO.4.10.10005110740340.16364-100000@user2.teleport.com>
On Thu, 11 May 2000, Dai Yuwen wrote:
> I can't inspect "my" variables by using X or V command in perldebug
> until I remove "my" in the source. Does that mean "my" variables are
> invisible?
No; it means that X and V are showing you package variables. Try the x
command and see whether it helps - even though it doesn't really work the
same way. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 06:45:15 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to make SNMP in parallel?
Message-Id: <Pine.GSO.4.10.10005110642300.16364-100000@user2.teleport.com>
On 9 May 2000, Hans J Jakobsen wrote:
> Subject: How to make SNMP in parallel?
I'd probably make a module which works analogously to the working of the
LWP Parallel User Agent:
http://search.cpan.org/search?dist=ParallelUserAgent
Hey, I didn't say this was the easiest way to implement! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 09:04:56 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: HOW: I want to set the time...
Message-Id: <mK8aOfHxxnFvec3XEYTtgwASFrRa@4ax.com>
I've read about you in the posts...
You're like the Satanic Moderator in unmoderated NGs...
Which I think is a good thing.
Thank you.
On 10 May 2000 21:15:53 GMT, abigail@foad.org (Abigail) wrote:
>On Wed, 10 May 2000 16:58:30 -0400, Lou Moran <lmoran@wtsg.com> wrote:
>++ ---I would like to set the time on my system to a timeserver like the
>++ one in boulder colorado...
>++
>++ ---I have a win9x app that does this called atomtime, but I'd like to
>++ write my own in Perl for my Linux machines...
>++
>++ ---I need to know two things (stares at feet, shoves hands in pockets)
>++ what is the URL of a timeserver?
>++
>++ ---to set time in linux do I need to give the script root access?
>++ that would be bad right?
>
>
>And your Perl question is... ?
>
>
>
>Abigail
...that's like asking how to grow flowers from a painting because it's red outside...
lmoran@wtsg.com
------------------------------
Date: Thu, 11 May 2000 06:55:54 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: HOW: I want to set the time...
Message-Id: <391ABBEA.28C79811@vpservices.com>
Larry Rosler wrote:
>
> In article <3919D434.D9D4E6F@vpservices.com> on Wed, 10 May 2000
> 14:27:16 -0700, Jeff Zucker <jeff@vpservices.com> says...
>
> ...
>
> > I just know you want a Perl answer to those questions, so:
> >
> > use LWP::Simple;
> > print get( "http://www.google.com/search?q=time server" );
>
> The Perl syntax is OK, but the query string isn't OK.
>
> print get( "http://www.google.com/search?q=time+server" );
>
> or
>
> print get( "http://www.google.com/search?q=time%20server" );
>
> :-)
All true (and something I even thought of myself before posting) if one
were talking about a query string in a URL rather than a parameter to a
method. From the LWP docs:
The B<url> is a string denoting the protocol, server and
the name of the "document" we want to access. The B<url> might
also encode various other parameters. ^^^^^
And from the docs for URI which LWP calls via HTTP::Request:
Characters outside this set are automatically escaped by the URI
constructor.
So, yes I should have escaped it myself for pedagological purposes, but
I can be legitimately lazy when I acutally use the module.
:-)
--
Jeff
------------------------------
Date: Thu, 11 May 2000 13:58:05 GMT
From: tim@beastor.mine.nu (Tim Coleman)
Subject: Re: HOW: I want to set the time...
Message-Id: <slrn8hlf37.8d2.tim@beastor.mine.nu>
Hash: SHA1
In article <mK8aOfHxxnFvec3XEYTtgwASFrRa@4ax.com>, Lou Moran wrote:
>I've read about you in the posts...
>
>You're like the Satanic Moderator in unmoderated NGs...
>
>Which I think is a good thing.
>
>Thank you.
If you really would like to set your system clock from a timeserver,
look into the Network Time Protocol. Here's some starting points:
<URL:http://www.eecis.udel.edu/~ntp/>
<URL:news:comp.protocols.time.ntp>
- --
Tim Coleman <tim@beastor.mine.nu>
Software Developer/Systems Administrator/RDBMS Specialist/Linux Advocate
University of Waterloo Honours Co-op Combinatorics & Optimization
"Go to Heaven for the climate, Hell for the company." -- Mark Twain
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE5GrxraP2t/Mt8eXQRAnJPAJ9QVjGLQ/ZW9J48WQAmfwyyM7Qr+wCdFPpx
80TpLEdsdPBGs//M1GENVJ4=
=1uhU
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 11 May 2000 23:10:18 +1000
From: "Allanon69" <allanon.69@no.spam.bigpond.com>
Subject: Re: I need help installing Perl
Message-Id: <i7yS4.9141$X4.18298@newsfeeds.bigpond.com>
1. Most likely a corrupt download. This message seems to happen quite a bit
on corrupt files.
2. You've got the wrong version for win98???? I'm using activeperl from
activestate.com on NT and it installs and works fine.
"bjanko" <waldo700NOwaSPAM@aol.com.invalid> wrote in message
news:2b744cbe.4ae0daa4@usw-ex0105-037.remarq.com...
> I'm just learning Perl. I downloaded it from ftp.funet.fi. I'm
> on Windows 98. When I tried to run configure.com, I got this
> error message:
>
> "This program requires more conventional memory. Unload drivers
> of memory-resident programs that use conventional memory, or
> increase the value for Minimum Conventional Memory in the
> program's Memory properties sheet."
>
> I have 128MB RAM and this was after a fresh reboot. I don't
> know much about hardware so I don't know how to "increase the
> value for Minimum Conventional Memory in the program's Memory
> properties sheet."
>
> Please tell me how I can install Perl on my system.
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!
>
------------------------------
Date: Thu, 11 May 2000 14:44:49 GMT
From: acunet3278@my-deja.com
Subject: Need to make UNIX autoresponder
Message-Id: <8feh0s$3bi$1@nnrp1.deja.com>
I would like to make an autoresponder in Perl on a UNIX server. Any
ideas tips about doing that? I look forward to hearing from you. Thank
you.
--
Auction Booth:
http://page.auctions.yahoo.com/booth/acunet3278
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 14:48:15 GMT
From: will@mylanders.com (Will England)
Subject: Re: Perl and JavaScript combination please help.....
Message-Id: <slrn8hli30.2o2.will@mylanders.com>
On Mon, 8 May 2000 12:02:13 +0100, Mark <KnightSky1@yahoo.com> wrote:
>I'm trying to get some perl to work on a Javascript If
>statement, i need to get one of the JavaScript variables into
>the perl code..any ideas??
Yup - ask about Javascript in a javascript group.
<snip javascript code>
>If you dont know, SaveTLE is being used in Intershop3 the
>JavaScript variable i'm trying to call is 'bob' or +bob+ in the Perl code.
OK. I'll assume that the SaveTLE thing is a function to send a response
back to the server. Javascript is (mostly) client side, while perl
is server side code. You want your Javascript bit to return some
value to the server for later use.
The simplest way is going to be with the CGI module. Do a quick search
for Lincoln Stein and CGI.pm That'll allow you to easily accept a POST'd
or GET'd value from a web page.
Once you have a more specific perl question, stop back by!
Will
--
"If Al Gore invented the Internet, then I invented spellcheck!"
Dan Quayle, quoted at the National Press Club, 8/3/1999
pgpkey at http://will.mylanders.com/pub_pgp.asc
Recovery page: http://will.mylanders.com/ will@mylanders.com
------------------------------
Date: Thu, 11 May 2000 14:39:32 GMT
From: jenningsii@my-deja.com
Subject: Perl Script aborting on 0x1A
Message-Id: <8fegn1$2o7$1@nnrp1.deja.com>
I am using a PERL Script to read a binary file and do some byte
manipulation. When the Hex value of 1A is read, the script is
interpreting this as the EOF() and stopping the script. Attached is a
piece of the code.
open (STDIN, $ARGV[0]) || die "Can't open $ARGV[0]:$!\n";
# Report failure if file can not be opened.
while ((read(STDIN,$data2,1) == 1)){ #suck in word 1
read(STDIN,$data1,1); #suck in word 2
I have tracked the problem to the read statement. Upon reading the
0x1A, the script aborts. All other hex values are passed properly.
I have also tried getc and sysread(with modifications) and still see the
same result.
Any suggestions?
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 08:58:42 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Please check my 'random' code
Message-Id: <391ABC92.3285C4AC@texas.net>
ra jones wrote:
>
> can't say I understand the 'qw' bit
perldoc perlop
- Tom
------------------------------
Date: Thu, 11 May 2000 06:57:55 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: POSIX shared memory and Perl
Message-Id: <Pine.GSO.4.10.10005110652560.16364-100000@user2.teleport.com>
On Wed, 10 May 2000, Erik Reckase wrote:
> I'm working on a project which uses POSIX shared memory in C, and I'd
> like to access that shared memory with a Perl program. Is this
> possible? Is anyone aware of a module that would help me out? (I know
> of the System V commands, but no POSIX implementation.)
Sounds like a job for a module. If there's not already a module
offering this, perhaps you should cook up one that does. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 13:07:55 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: problem: fork and then connecting to another server
Message-Id: <8febb0$sd8$1@nnrp1.deja.com>
In article <3919A956.38E9E4D3@t-online.de>,
Werner Sager <Werner.Sager@t-online.de> wrote:
> 1. A client C1 connects to a server S1 ( socket ) ,
> 2. the server S1 creates a child CH1 ( fork ) ,
> 3. the child CH1 connects to another server S2 ( socket )
>
> Communication between CH1 and S2 doesn't work:
> I am using "ActiveState perl 5.6 on win32" )
See Id 306 at bugs.activestate.com. There appears to be a problem with
fork() and sockets.
--
Regards,
Dick
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 09:43:17 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Seeking a file
Message-Id: <391AC705.CE93120@texas.net>
Igor Campos Leal wrote:
>
> Hello everybody.
> I need to know how the function seek works. Its syntax is:
> seek FILEHANDLE, offset, origin.
> But I'm not shure how I'll do that.
> I wanna read a line of the file and, if a condition, seek the file
> for one line up.
Sure, you could roll your own, but how about just reading the file
backwards?
Get File::ReadBackwards from CPAN.
- Tom
------------------------------
Date: Thu, 11 May 2000 06:42:08 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: signal trapper
Message-Id: <Pine.GSO.4.10.10005110640120.16364-100000@user2.teleport.com>
On Tue, 9 May 2000, Andy Chantrill wrote:
> ^ Only problem with that is that because the user is sitting at a
> standard input prompt, they have to hit [enter] (or an invalid
> selection followed by [enter]) in order to re-initialise the "status"
> sub-routine, and display the error. I'd prefer the error to be
> displayed straight away, as soon as the signal is trapped.
That sounds as if you want the signal to terminate waiting for input.
Maybe you should be using a different way to wait for input. For example,
Term::ReadLine may be able to do what you want. (I don't know for sure,
and I don't have time to research your problem at the moment, but this may
put you on the right track.)
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 06:59:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: simple link checker needed
Message-Id: <Pine.GSO.4.10.10005110658220.16364-100000@user2.teleport.com>
On Wed, 10 May 2000 broni99@my-deja.com wrote:
> Now I want to execute simple ksh or perl code to verify links on the
> page submitted to publishing script and display wornings if dead links
> are found. I need to check only one page.
>
> Can someone point to such program (preferable, freeware or shareware)?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service.
Still, this question comes up in this newsgroup every week or so. If you
search Deja, do you find what you want?
http://www.deja.com/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 13:51:36 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Still a double insert with DBI
Message-Id: <8fedt0$v8g$1@nnrp1.deja.com>
In article <391aaea3$0$4761@reader5>,
"Eric van Huijgevoort" <huijgbv@casema.net> wrote:
> Earlier today a had a question about a double insert. After some
changes the
> the problem is still actual. Sometimes the insert goes for a few
inserts
> well and than for 30 inserts double. It seems that the instruction
runs
> twice because an higher ordernumber is inserted for the second time.
Is
> there maybe an instruction preventing running undermentioned code for
the
> second time or do you have an explanation for this problem? Every
suggestion
> is welcome.
I'm guessing this means that more than one record inserted has the same
ordernumber . . .
>
> <eval>
> use DBI;
> my $dbh=
>
DBI->connect("DBI:mysql:database:localhost","username","password",{'RaiseErr
> or' => 1});
>
> $sth = $dbh->prepare("SELECT max(list_id), max(ordernumber) FROM
> orderlist");
> $sth->execute();
> @dataarr = $sth->fetchrow_array;
> $max_list_id=$dataarr[0];
> $max_ordernumber=$dataarr[1];
> $max_list_id++;
> $max_ordernumber++;
>
> foreach $product (sort keys %howmanyproducts) {
> $dbh->do("INSERT INTO orderlist VALUES ($max_list_id,
$max_ordernumber,
> $howmanyproducts{$product}, '$product',
> systemideachproduct{$product}, '$statuseachproduct{$product}')");
> $max_list_id++;}
>
If the foreach executes more than once (if there is more than one item
in %howmanyproduct), you will insert more than one record into the
table. Since $max_ordernumber is not incremented in the loop, its value
will be the same for every insertion.
> $dbh->disconect;
> </eval>
>
> Thanks in advance, you can also mail me.
>
> Erik van Huijgevoort
> Holland
> huijgbv@casema.net
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 10:38:37 -0400
From: Hamza Sadiq <Hamza.Sadiq@bridge.bellsouth.com>
To: Ted Marz <tfm@sei.cmu.edu>, "Paul J. Bosselaers" <paulboss@erols.com>
Subject: Re: Still having problems with cgi under IIS
Message-Id: <391AC5ED.C18D7B61@bridge.bellsouth.com>
In article <3919E9BE.BBB1574E@bridge.bellsouth.com>, Hamza Sadiq
<Hamza.Sadiq@bridge.bellsouth.com> wrote:
>Hi everyone,
>
>I am still having problems running perl/cgi scripts through my browser.
>It works find from the command prompt but shows up as text in my
>browser. I've tried following the previous info giving in this
>newsgroup but to no avail. my code is as follows:
>
>#!C:\Perl\bin\perl
>
>
>use lib ("C:/perl/lib/");
>
>print "Content-type: text/html\n\n";
>
>print "Hello";
>
Make sure the file extension of your perl cgi scripts is .pl, not .cgi.
Ted Marz wrote:
> Just for grins, try naming the file as
> <whatever>.plx rather than <whatever>.pl
>
> The shebang (#!) under windows doesn't matter (except for portability),
> as windows uses a file type association, rather than parsing the file.
>
> Ted
Thanks for your response guys. I tried changing my cgi script to the pl
extension. When I ran the script I got the the msgbox asking if I wanted
to open the file in perl. After selecting yes I saw a dos window open and
close very quickly but nothing happened to my browser page. It shows the
open page prior to running the perl script. Where do I go from here?
------------------------------
Date: Thu, 11 May 2000 10:45:16 -0400
From: Hamza Sadiq <Hamza.Sadiq@bridge.bellsouth.com>
Subject: Re: Still having problems with cgi under IIS
Message-Id: <391AC77C.3419CF31@bridge.bellsouth.com>
Ted Marz wrote:
> Just for grins, try naming the file as
> <whatever>.plx rather than <whatever>.pl
>
> The shebang (#!) under windows doesn't matter (except for portability),
> as windows uses a file type association, rather than parsing the file.
>
> Ted
Ted,
I tried the .plx extension and my code appeared in the browser as a text
file.
Cedron
------------------------------
Date: Thu, 11 May 2000 07:47:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Using Modules Breaks "-w"?
Message-Id: <Pine.GSO.4.10.10005110747240.16364-100000@user2.teleport.com>
On Thu, 11 May 2000, Peter Hill wrote:
> #! /bin/perl - w
Do you mean to have that space before the w?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 11 May 2000 12:58:24 GMT
From: jlucande@my-deja.com
Subject: Re: Video comes in bursts
Message-Id: <8feap8$rp5$1@nnrp1.deja.com>
Hi Tom!
>> The problem is that the video comes in bursts of few kilobytes each.
>
> Sounds like buffering. (The fact that the data is video doesn't
> matter; it's all just bits to perl!)
>
> > $q = new CGI;
>
> > $|=1; # Forces the buffer to be flushed.
> > LOOP: while (read SOCK, $data, 8) {
> > $q->print($data) or last LOOP;
> > }
>
> I must be missing something. Are you using a print method of the CGI
> module? Maybe you meant to simply print() here. In fact, if this
> works at all, it's probably because of a bug in the CGI module.
>
> Also, although that loop label doesn't hurt anything, it's not needed.
> Labels are quite rare in Perl programs.
Those were good points you underlined. I made the corrections.
Now the while loop looks like this:
$|=1; # Forces the buffer to be flushed.
while (read SOCK, $data, 8) {
print($data);
}
But the data still comes in bursts. Maybe the reason is
badly configured Apache 1.3.12 win32-version.
That leaves the question, why the data flows normally
through the original port number 8641.
Thanks for your advice it helped me to understand Perl
syntax better.
t: Jussi
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 11 May 2000 13:16:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Video comes in bursts
Message-Id: <3921b1b4.14837988@news.skynet.be>
jlucande@my-deja.com wrote:
>$|=1; # Forces the buffer to be flushed.
>while (read SOCK, $data, 8) {
> print($data);
>}
You're reading and writing 8 bytes at a time? Isn't that just a bit
extreme? I think that using chunks of, for example, 128 or 256 bytes,
shoukld work just as well. There ain't too much video image in 8 bytes.
>But the data still comes in bursts. Maybe the reason is
>badly configured Apache 1.3.12 win32-version.
>That leaves the question, why the data flows normally
>through the original port number 8641.
It must be the server buffering. You probably need some more, or better
configured, headers.
Have you tried NPH (no parse headers)?
--
Bart.
------------------------------
Date: Thu, 11 May 2000 06:39:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Video comes in bursts
Message-Id: <Pine.GSO.4.10.10005110625190.16364-100000@user2.teleport.com>
On Thu, 11 May 2000 jlucande@my-deja.com wrote:
> Now the while loop looks like this:
> $|=1; # Forces the buffer to be flushed.
> while (read SOCK, $data, 8) {
> print($data);
> }
> But the data still comes in bursts.
Well, maybe you can make them _larger_ bursts. Do you have a reason to
need the number 8 in the code above? Changing it to be 8192 (say) may work
better. (It's not as if you're going to have only a small amount of data,
when you're dealing with video!)
You should perhaps also use lower-level calls to do this. Both the read
and the print may block, which could be a problem. For example, if the
print has to block for a moment, the input buffer (from which you're
reading) may fill up, causing the other process to block. Now a moment
later, you read the entire input buffer, but the other process hasn't
gotten a chance to replenish the buffer.
I'd probably redo that loop to use sysread and syswrite, along with the
four-arg form of select. Of course, that means that you'll have to
implement a buffer within your process; you should probably code in an
upper limit of (say) 64K for that buffer's size.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3016
**************************************