[11928] in Perl-Users-Digest
Perl-Users Digest, Issue: 5528 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 30 13:07:24 1999
Date: Fri, 30 Apr 99 10: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 Fri, 30 Apr 1999 Volume: 8 Number: 5528
Today's topics:
Re: "learning perl" does not seem to be written well <emschwar@rmi.net>
Re: Advance Data Structure <tchrist@mox.perl.com>
Challenging problem <matte_8000@my-dejanews.com>
Re: Checkbox is not working. <aqumsieh@matrox.com>
Re: Example Server Code <dgris@moiraine.dimensional.com>
Re: Global Filehandle ? <tchrist@mox.perl.com>
Re: Global Filehandle ? <Wm.Blasius@ks.sel.alcatel.de>
Re: Global Filehandle ? <tchrist@mox.perl.com>
Re: How to flush CGI output? (Juho Cederstrom)
Re: importing a namespace from an arbitrary file <aqumsieh@matrox.com>
Re: Instance Data / Instance Variables (Tad McClellan)
Re: Is this the best way to get a substring? <jeromeo@atrieva.com>
Re: Is this the best way to get a substring? (Randal L. Schwartz)
Re: Is this the best way to get a substring? <jeromeo@atrieva.com>
Re: Is this the best way to get a substring? <jeromeo@atrieva.com>
Re: Is this the best way to get a substring? <uri@sysarch.com>
JavaScript/PERL for dynamic form generation <dmarshall@cwe2.com>
Re: matching a quoted string <aqumsieh@matrox.com>
Re: Newsfeed and Local Weather <rkoehler@osmre.gov>
Re: Passing Params <aqumsieh@matrox.com>
Re: Perl on a 386 with 2 MB RAM??? <166959rl@student.eur.nl>
Re: Perl on a 386 with 2 MB RAM??? <166959rl@student.eur.nl>
Re: Perl on a 386 with 2 MB RAM??? (Tad McClellan)
Re: Processing Multiple Select <gellyfish@gellyfish.com>
Re: Processing Multiple Select <tchrist@mox.perl.com>
RegEx for matching Mbx "From " delimeter <nicholas.brenckle@yale.edu>
Re: RegExp for the following string, w/o using split <aqumsieh@matrox.com>
Re: RegExp for the following string, w/o using split <rreidy@skyconnect.com>
Re: Regexp help needed (Tad McClellan)
Re: Regexp or subst (Larry Rosler)
Re: RegExs and question marks...a possible bug? <aqumsieh@matrox.com>
Re: search string syntax <emschwar@rmi.net>
Re: Signal stuff on NT ismail_pirani@my-dejanews.com
Simple Checksum "Confidence Level"?? jabarone@my-dejanews.com
Simple Checksum "Confidence Percentage"??? jabarone@my-dejanews.com
Re: single quotation " erases REST OF TEXT <dgris@moiraine.dimensional.com>
Sybase::DBlib and Two Phase commit nekoboh@my-dejanews.com
Re: using perl to manage passwords? <gellyfish@gellyfish.com>
Re: using perl to manage passwords? <dtbaker@bus-prod.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Apr 1999 09:57:12 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <xkfhfpym78n.fsf@valdemar.col.hp.com>
tadmc@metronet.com (Tad McClellan) writes:
> Perl saved me from using lex and C to get the power of
> regular expressions.
>
> I will be eternally grateful...
I still have to use regexes in C++ on occasion. *gibber* *fear*
It's like swimming in frozen molasses.
-=Eric
------------------------------
Date: 30 Apr 1999 10:20:44 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Advance Data Structure
Message-Id: <3729d85c@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Dave Lundborg <dave@davel.net> writes:
: ABCINC =>
: {
: 90001 => { "serverroom", "Corp", "Russia"}, #####hash
:of list I can't use a hash here the keys will be the same. ie Location
That's an odd number of elements to the hash. Perhaps you mean
90001 => [ "serverroom", "Corp", "Russia" ],
or
90001 => { "serverroom" => [ "Corp", "Russia" ] },
or something else entirely.
: $RefHoH=\$HoH{$client}{$contract};
What's the backslash for? $HoH{$client}{$contract} already contains
a reference to hash. You don't have to re-reference it, because
otherwise you get a reference to a reference.
: print "\t\t $$RefHoH\n";
No, that only gets back the original reference. I think you
need another loop. In general, N-level data structures
are traversed using N loops.
--tom
--
"Many folks want nothing more than to live and let learn." --Larry Wall
------------------------------
Date: Fri, 30 Apr 1999 15:38:45 GMT
From: Matthew Evans <matte_8000@my-dejanews.com>
Subject: Challenging problem
Message-Id: <7gciq5$tu2$1@nnrp1.dejanews.com>
I am trying to write a script which does the following.
Web browser activates cgi-script.
Script makes pipe
script sends to stdout a "location" which points to the pipe
Web browser connects to the pipe
script opens binary file
script streams binary info to pipe.
web browser displays file (pdf)
The reason I am using pipes is so I can name the pipe, the name of the binary
file so that the pdf file has the correct file name.
Why dont I just point the browser at the pdf file?
Because the files are outside the web root, for 2 reasons.
1. security
2. dont get indexed.
OK.
The only thing is, I dont know how to use pipes on NT.
I have used them on UNIX but that was a case of mknod and system calls etc.
So my real question is:
Does anyone have any examples of named pipes for NT?
Or can you think of another way of doing what I am trying to do?
Update: I just tried the named pipes way and it looks like the pipes are not
actually created in the file system. Only by perl programs in memory.
That doesnt help me at all!!! HELP!!
Cheers,
Matt
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 30 Apr 1999 10:47:42 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Checkbox is not working.
Message-Id: <x3yaevq6u7n.fsf@tigre.matrox.com>
jeffrey_f@my-dejanews.com writes:
> I have a script which saves data..and keeps it in hidden fields. Basically,
> you press next, and puts data into hidden fields.
Nice. Impressive.
> The problem is it only saves the last checkbox (last field in the HTML). I
> can figure out why!! Happens with any checkboxes...name doesnt matter, value
> doesnt...weird.
Strange. Weird.
> Thanks Alot.
Welcome.
> Jeff
Ala
------------------------------
Date: 30 Apr 1999 10:21:33 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Example Server Code
Message-Id: <m3g15i6pv6.fsf@moiraine.dimensional.com>
Brian Peisley <bdp@mutagenic.org> writes:
> Jonathan Stowe wrote:
> >
> -snip
> >
> > my $server = IO::Socket::INET->new ( LocalPort => 1112,
> > Type => SOCK_STREAM,
> > Reuse => 1,
> > Listen => SOMAXCONN )
> > || die "Couldnt open socket $@\n";
> ^^
>
> Why do you use $@ here instead of $! ?.
$! is only ever set by failed system calls. It corresponds to errno
in most C programs. In this case it could be set by failures of the
calls to socket, bind, listen, or accept--none of which will be of
direct interest to you (as you won't necessarily be able to tell which
call generated the error).
$@, on the other hand, is typically used to pass arbitrary exceptions
up the call stack. It can be set to essentially anything (even (in
new perls) a reference, but I haven't played with that yet and can't
say more) and will generally be the variable that you want to examine
to see if things went wrong in a module.
> Is there an eval hiding in here somewhere?
Yes, there is. But that isn't what is setting $@ in this
example. If you look at IO::Socket:INET::_error you'll see that it
handles setting $@ if something goes wrong.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 30 Apr 1999 09:04:52 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Global Filehandle ?
Message-Id: <3729c694@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de> writes:
:Hello,
:
:Maybe I am missing something here, but I am trying to do something
:which should be simple but I can't figure out how to make it work.
:
:I need to open a file with a global filehandle that is visible for
:all the modules of my program. Just declaring it in main gives the
:error
: 'Filehandle Netmap::STDLOG never opened at Netmap.pm line 144 (#1)
:or something similar for each write attempt.
I doubt whether you're declaring your filehandles.
I doubt whether you're quite firm on this concept of globals.
Here's your fish for the day:
Never use the unqualified "STDLOG" variable. It will get
package-qualified to the current package, as you see.
Instead, use main::STDLOG everywhere.
I don't know that I care for that solution very much, but it
should solve your immediate problem.
--tom
--
"Just because something is obviously happening doesn't mean something obvious
is happening." --Larry Wall
------------------------------
Date: Fri, 30 Apr 1999 18:11:52 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Global Filehandle ?
Message-Id: <3729D648.2781E494@ks.sel.alcatel.de>
[courtesy cc of this posting sent to cited author via email]
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de> writes:
> :Hello,
> :
> :Maybe I am missing something here, but I am trying to do something
> :which should be simple but I can't figure out how to make it work.
> :
> :I need to open a file with a global filehandle that is visible for
> :all the modules of my program. Just declaring it in main gives the
> :error
> : 'Filehandle Netmap::STDLOG never opened at Netmap.pm line 144 (#1)
> :or something similar for each write attempt.
>
> I doubt whether you're declaring your filehandles.
> I doubt whether you're quite firm on this concept of globals.
>
> Here's your fish for the day:
>
> Never use the unqualified "STDLOG" variable. It will get
> package-qualified to the current package, as you see.
> Instead, use main::STDLOG everywhere.
>
> I don't know that I care for that solution very much, but it
> should solve your immediate problem.
>
> --tom
Maybe you're right and I am not quite firm on the concept of globals
in Perl. I've read what I could find and, frankly, I don't think the
explanations are very clear. I did not find any references to global
variables - subroutine and formats, yes - that aren't "built-ins". I
tried 'use vars' both in and out of a BEGIN block and tried 'local'.
What I see in %main:: after the open *looks* the same as the entries
for STDOUT and STDERR but must somehow be different. So, Where can I
go to find the answers?
I don't care for that solution very much either. But does your reply
imply that a good solution is difficult or impossible?
Regards,
Wm Blasius
--
...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!
------------------------------
Date: 30 Apr 1999 10:55:29 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Global Filehandle ?
Message-Id: <3729e081@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de> writes:
:What I see in %main:: after the open *looks* the same as the entries
:for STDOUT and STDERR but must somehow be different.
That's right. STD{IN,OUT,ERR} when unqualified default to package main,
as do ARGV and ARGVOUT. Other filehandle when unqualified default to the
current package. Just don't not qualify them. Better yet, go through
a mediating function, one which "owns" that handle.
--tom
--
I believe in the waterbed theory of linguistics.
If you push down here, it pops up there.
-- <1993Jan20.181244.8680@netlabs.com>
------------------------------
Date: Fri, 30 Apr 1999 13:20:38 +0300
From: cederstrom@kolumbus.REMOVE_THIS.fi (Juho Cederstrom)
Subject: Re: How to flush CGI output?
Message-Id: <slrn7ij0vm.1i5.cederstrom@vortex.cede.net>
On 29 Apr 1999 21:28:11 GMT,
JUNYI J LIN <jlmy@orion> wrote:
> #!/usr/bin/perl
# Put here:
use IO::Handle;
STDOUT->autoflush( 1 );
> I tried to call flush(STDOUT) right before the
> sleep call, but it didn't help at all. It seems
This works fine for me, I have a Linux box running Apache 1.3.6.
But then, try to push the stop button of you browser during those 10
seconds... The next time you write something to STDIN your CGI receives
SIGTERM. So you need to catch it... And that's another story.
--
# This perl script will show juhoc's real email address
$_ = 'my e-mail address is NOT fi@cederstrom.kolumbus';
s/N\S+\s//g;s/(\S+)\@(\w+)\.(\w+)$/$2\@$3\.$1\n/;print;
------------------------------
Date: Fri, 30 Apr 1999 10:49:25 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: importing a namespace from an arbitrary file
Message-Id: <x3y90ba6u4q.fsf@tigre.matrox.com>
sstarre@my-dejanews.com writes:
> How can I tell the compiler to look for modules in ../mydir or any other
> specific dir? I folled aroud with system('PATH') but
use lib 'my/dir/';
use myModule;
HTH,
Ala
------------------------------
Date: Fri, 30 Apr 1999 07:32:55 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Instance Data / Instance Variables
Message-Id: <7d4cg7.9o3.ln@magna.metronet.com>
gzm@gmx.de wrote:
: I want to use instance variables for my perl objects but I don't know how to
^^^^ ^^^
: declare and use them correctly.
: Now I have these questions:
[snip]
: - What exactly does "shift" and {} do?
^^
^^
perl -ne 'print if /{}/' perlobj.pod
finds this line (among others):
constructors.) The C<{}> allocates an anonymous hash containing no
perldoc -f shift
: - How do I have to declare instance variables and how do I use them from other
: methods within the object they belong to?
perldoc perlobj
perldoc perltoot
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 30 Apr 1999 07:50:16 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Is this the best way to get a substring?
Message-Id: <3729C328.F3F52056@atrieva.com>
Tad McClellan wrote:
>
> Jerome O'Neil (jeromeo@atrieva.com) wrote:
> : It's a good example
>
> No it isn't.
Yes it is.
> : > Hint - what if the regex match fails? What $1 are you getting?
> : > Right... the PREVIOUS $1 from the PREVIOUS successful match.
> : There is no previous match.
>
> Q: So _then_ what would be the value of $1 if the match failed?
> A: undef
A: It matched. It's an example.
> : loop. (There is no spoon. :> ) There is a defined pattern, and a regex
> : that will match it.
>
> I think it is a regex that might match it, but might not match it.
Show me a pattern, as described, that wouldn't match. Then I'll
reconsider my position.
>
> : > Bad code.
> : Good Example.
> Bull.
My. I'll just respond with "Is so!"
Ahem...
QUOTE
>> Using your example, you could save one or
>> more digits at the begining of a string followed one or more non digits
>> thusly:
/QUOTE
> my $newstring = 'abc12';
This is not one or more digits at the beginning of a string followed by
one or more non-digits.
> $newstring =~ /^(\d+)\D+/; # unsuccessful match
Nor should it match. Your pattern is quite different from the one I
described.
> $newstring =~ /(\D+)/; # successful match
Unsuccessfull match, actualy. This will not match one or more digits at
the beginning of a string followed by one or more non-digits.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 30 Apr 1999 08:38:52 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Is this the best way to get a substring?
Message-Id: <m17lqujeyb.fsf@halfdome.holdit.com>
>>>>> "Jerome" == Jerome O'Neil <jeromeo@atrieva.com> writes:
Jerome> I'm afraid that Randall, Tad, yourself, and I are all going to have to
Jerome> agree to disagree on this particular topic. We shouldn't be answering
Jerome> questions that weren't asked, and the example was written to show
Jerome> specific uses. I'll stand by that every time.
A specific *unrecommend dangerous use*. I'll stand by THAT every time
too. :-)
People that read your answers should know that sometimes your answers
can get them into trouble if they don't understand the implications.
It's too bad we can't put out a warning now that the newbies will see...
"Jerome writes code that will probably get you into trouble..." :)
print "Just another Perl hacker,"
--
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: Fri, 30 Apr 1999 08:51:11 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: "Randal L. Schwartz" <merlyn@stonehenge.com>
Subject: Re: Is this the best way to get a substring?
Message-Id: <3729D16F.4A977B21@atrieva.com>
Randal L. Schwartz wrote:
>
> But that's actually why I pointed it out. Checking $1 without having
> checked whether the match succeeded leads to general errors akin to
> opening a file without checking the return of the open.
I don't want you to misunderstand my position. I *don't* disagree with
you. However, within the context of this example, it adds complexity
that doesn't need to be there.
There are many, many caveats that we can add to any particular code
snippet posted any given day. The drawback is that we end up writing
full blown applications to demonstrate simple concepts, and that often
adds confusion.
> And having an answerer provide bad bits of code is something I'm
> always on the watch for. We don't need to hand bad bits to newcomers.
If I had written:
#!/bin/perl -w
use strict;
while(<>){
my $string = $_;
next unless $string =~ /^(\d+)\D+/;
my $digits = $1;
# WooHoo!!
}
would you feel this is a clearer example of binding and backtracking? I
don't (and it's a whole lot more to type!)
> Yes, the experts know exactly when we can get away with it, but we're
> talking to non-experts here. It's like handing someone a lightsaber
> when they ask for a cutting tool, but not really telling them that
> it'll pretty much cut through *everything*, or how long the blade
> is. :)
I think a better analogy is a fellow asked for a butter knife, and got a
butter knife. I don't like to speculate on his motives, but if he
needed to cut down a tree, he should have asked for a chain saw.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Fri, 30 Apr 1999 09:16:11 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Is this the best way to get a substring?
Message-Id: <3729D74B.49669CC6@atrieva.com>
Randal L. Schwartz wrote:
>
> >>>>> "Jerome" == Jerome O'Neil <jeromeo@atrieva.com> writes:
> It's too bad we can't put out a warning now that the newbies will see...
> "Jerome writes code that will probably get you into trouble..." :)
If ya' gotta be famous...
I would prefer.
Jerome provides examples that will answer your question, but no warantee
is provided, express or implied, yadda yadda yadda...
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 30 Apr 1999 12:53:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Is this the best way to get a substring?
Message-Id: <x7d80m6odp.fsf@home.sysarch.com>
>>>>> "JO" == Jerome O'Neil <jeromeo@atrieva.com> writes:
JO> If I had written:
JO> #!/bin/perl -w
JO> use strict;
JO> while(<>){
JO> my $string = $_;
JO> next unless $string =~ /^(\d+)\D+/;
JO> my $digits = $1;
JO> # WooHoo!!
JO> }
JO> would you feel this is a clearer example of binding and backtracking? I
JO> don't (and it's a whole lot more to type!)
that isn't tremendous overkill, but it is obvious that you are trying to
hard to please randal. you could have just used:
if ( $string =~ /^(\d+)\D+/ ) {
$digits = $1;
blah;
}
which is clear and not burdened with too much extra stuff.
and you keep using the term backtracking incorrectly. that mean how
regexes retry earlier possible matches after a later one fails. it does
not mean paren grabbing (which doesn't have a single most popular term,
but backtracking is NOT correct).
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 30 Apr 1999 16:15:24 GMT
From: David Marshall <dmarshall@cwe2.com>
Subject: JavaScript/PERL for dynamic form generation
Message-Id: <3729D701.C5F8FD1@cwe2.com>
I am using a PERL script to generate a form. This makes calls to a SQL
database to generate a dynamic SELECTion list (L1) and executes a
JavaScript "onChange=" event if the user wishes to add an additional
option to that list. This part is working fine.
My problem is that there is another selection list (L2) field on this
form whose OPTION values (coming from the same SQL database) depend on
the value of the aforementioned selection list. This part is not
working fine.
EXAMPLE:
When the form loads and L1 has an initial value of "MICROSOFT", L2's
options should automatically be "NT 3.50", "NT 3.51", and "NT 4.0". If
the user selects a different option for L1 ("NOVELL" for instance), L2's
options should dynamically change to the corresponding version numbers
for NOVELL. Now, just to muddy the waters a bit more, if the user
chooses to add a new value to L1's list, L2 should actually be a text
box for the user to enter a version number.
I hope I have presented this dilemma clearly. Any assistance would be
greatly appreciated.
Sincerely,
David Marshall
------------------------------
Date: Fri, 30 Apr 1999 11:01:48 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: matching a quoted string
Message-Id: <x3y676e6tk4.fsf@tigre.matrox.com>
koch9@home.com (Jon) writes:
> I am using the following code to find an existing string in a line of input,
> then replace it with another string.
>
> if($line =~ /$compare/) {
> $line =~ s/$compare/$newstr/eg;
> }
The above lines are better written as:
$line =~ s/$compare/$newstr/eg;
This is faster since you don't need to match $compare twice. Also,
if $newstr is a simple scalar, then you can drop the /e modifier.
> This works fine unless the string is contained inside double quotes
> in the line
> of input. In that case, no match is found. How do you stop the double quotes
> in the input line from affecting the string match and substitution?
I don't see any reason for this behaviour:
% perl -wl
$_ = q/This is "a nice" thing/;
print "YES" if s/nice/good/g;
__END__
YES
% perl -wl
$_ = q/This is a nice thing/;
print "YES" if s/nice/good/g;
__END__
YES
Is there something else that you don't tell us? Post some code and
it'll be much easier to see where the problem is.
HTH,
Ala
------------------------------
Date: Fri, 30 Apr 1999 15:03:26 GMT
From: "Rick K" <rkoehler@osmre.gov>
Subject: Re: Newsfeed and Local Weather
Message-Id: <FB0CGx.H3F@igsrsparc2.er.usgs.gov>
Skyward Internet Technology wrote:
>Does anybody know of any Perl scripts available that go out to the Weather
>Channel and grab their local forecast? I've seen this done with a Cold
>Fusion application and just wondered if anybody had a Perl script to do the
>same.
Just for funsies, you might want to check out "Daily Update" at this link:
http://www.cs.virginia.edu/~dwc3q/code/DailyUpdate/index.html
since part of it includes "fetch some weather info" functionality.
As far as ColdFusion goes, I was doing some on my kitchen tabletop, but
my experiment exploded when I mixed the tomatillos into the salsa. Left a
crater, it did. And I paid later at the disposal facility. Oooch, ooch, ooch.
------------------------------
Date: Fri, 30 Apr 1999 11:04:15 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Passing Params
Message-Id: <x3y4sly6tg0.fsf@tigre.matrox.com>
Bob Walton <walton@frontiernet.net> writes:
> Try printing out everything in %ENV with something like:
>
> for(sort keys %ENV){print "$_=%ENV{$_}\n";}
You probably mean:
for (sort keys %ENV) { print "$_ = $ENV{$_}.\n" }
------------------------------
Date: Fri, 30 Apr 1999 18:21:13 +0200
From: "Ronald van der Lingen" <166959rl@student.eur.nl>
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <7gclkf$ece$1@news.casema.net>
Linux is not an option I think. My laptop has a harddisk of 60 MB, so there
isn't enough space for linux.
Benjamin Franz wrote in message ...
>In article <7gbvs0$u3$1@news.casema.net>,
>Ronald van der Lingen <166959rl@student.eur.nl> wrote:
>>hello I want to install a perl interpreter on a 386 laptop with 2 MB RAM.
Is
>>there a port that I can use on this system?
>
>Yes. It is spelled "Linux".
>
>--
>Benjamin Franz
------------------------------
Date: Fri, 30 Apr 1999 18:24:46 +0200
From: "Ronald van der Lingen" <166959rl@student.eur.nl>
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <7gclr9$eho$1@news.casema.net>
Yes I use MS-DOS. I have found a port of Perl 4 that works on my laptop. I
tried two different port of Perl 5, but they didn't work. But thanks. I can
now enjoy the sunshine and learn to program Perl at the same time! :-)
Ronald vd Lingen
Bbirthisel wrote in message
<19990430101245.26180.00000440@ng-fs1.aol.com>...
>Hi Ronald:
>
>>hello I want to install a perl interpreter on a 386 laptop with 2 MB RAM.
Is
>>there a port that I can use on this system?
>
>You can use one of the MS-DOS ports from
>CPAN (you don't say, but I suspect that is
>your OS). Expect limited module support -
>but CORE functions should work. There
>are a number of ports - you'll need to check
>the READMEs to see what is/isn't included
>in each one.
>
>-bill
>Making computers work in Manufacturing for over 25 years (inquiries
welcome)
------------------------------
Date: Fri, 30 Apr 1999 07:25:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <004cg7.9o3.ln@magna.metronet.com>
Ronald van der Lingen (166959rl@student.eur.nl) wrote:
: hello I want to install a perl interpreter on a 386 laptop with 2 MB RAM. Is
: there a port that I can use on this system?
Perl FAQ, part 2:
"What machines support Perl? Where do I get it?"
The OS matters more than the CPU architecture, but you
have not shared that information with us.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Apr 1999 15:59:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Processing Multiple Select
Message-Id: <3729c536@newsread3.dircon.co.uk>
info@gadnet.com wrote:
> I'm new to this, and after extensive searching online and in my books,
> I can't find anything that tells me how to process the result of a
> "SELECT MULTIPLE" HTML tag. With everything else you have name=value
> pairs separated by &. What does the result of a SELECT MULTIPLE look
> like, and how should I split it up?
>
You either use the module CGI.pm which behaves as is documented or you
ask in comp.infosystems.www.authoring.cgi .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 30 Apr 1999 09:07:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Processing Multiple Select
Message-Id: <3729c725@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, info@gadnet.com writes:
:I'm new to this, and after extensive searching online and in my books,
:I can't find anything that tells me how to process the result of a
:"SELECT MULTIPLE" HTML tag. With everything else you have name=value
:pairs separated by &. What does the result of a SELECT MULTIPLE look
:like, and how should I split it up?
I'm sure there must be perl content there, but I can't see it.
Didn't you really mean to post this to the CGI newsgroup where
it belong? Or were you just hoping someone would send you the
standard CGI.pm manpage? :-)
--tom
--
"It's ironic that you would use a language as large as English to express
so small a thought."
--Larry Wall
------------------------------
Date: Fri, 30 Apr 1999 12:11:31 -0400
From: Nicholas Brenckle <nicholas.brenckle@yale.edu>
Subject: RegEx for matching Mbx "From " delimeter
Message-Id: <3729D633.9A801A7F@yale.edu>
"Im thinking of switching to Perl..." (just to amuse Randal)
I need to parse some VERY large mailfiles. Because of their size I
cannot use the standard modules (My machine doesnt like to load 100 megs
of mail files into memory, certainly not during the day when its busy
doing other things) Since the access really only calls for a simple top
down access I really dont need all the module overhead anyway.
SO: The problem is my pattern matching doesnt conform to the RFC (Anyone
know the right number?) for mbx format and I miss a few here and there.
Does anyone have a suggested expression for this line?
Thanks
-Nick
--
----------------------------------------------------------------------
Nicholas Brenckle Yale University School of Medicine
nicholas.brenckle@yale.edu ITS Med - PO Box 208089
203-737-2377 New Haven, CT 06520-8089
------------------------------
Date: Fri, 30 Apr 1999 10:45:10 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: RegExp for the following string, w/o using split
Message-Id: <x3ybtg66ubt.fsf@tigre.matrox.com>
mshavel@erols.com (Michael Shavel) writes:
> I have a string that looks like this:
>
> " 4","123456","19990423","","","","","This is the text field","","",""
>
>
> I need to always parse what is between the first and second comma, so in
> this case I want to get 123456 into a variable. I've tried various regular
> expressions but can't seem to get it right. I know I could do this using
> split but I was trying not to because I have about 250,000 lines like this
> in each file that I have to parse. I thought the overhead of a split
> would be too great. Any suggestions please...
Well, if you insist on not using split(), then:
($num) = $string =~ /^.*?,(.*?),/;
Note that this keeps the double quotes around the number. Those you
could remove with tr/// or a slight modification of the regexp:
($num) = $string =~ /^.*?,"(.*?)",/;
HTH,
Ala
------------------------------
Date: Fri, 30 Apr 1999 09:52:44 -0600
From: "Ron Reidy" <rreidy@skyconnect.com>
Subject: Re: RegExp for the following string, w/o using split
Message-Id: <7gcjkq$oqi$1@news1.rmi.net>
What is wrong with split() ?
This works for me ...
#!/usr/local/bin/perl -w
#
# notice single qotes (') around your string ...
#
$data = '" 4","123456","19990423","","","","","This is the text
field","","",""';
$the_field = (split(/,/, $data))[1];
print "$the_field\n";
Michael Shavel wrote in message ...
>
>Hi
>
>I have a string that looks like this:
>
>" 4","123456","19990423","","","","","This is the text field","","",""
>
>
>I need to always parse what is between the first and second comma, so in
>this case I want to get 123456 into a variable. I've tried various regular
>expressions but can't seem to get it right. I know I could do this using
>split but I was trying not to because I have about 250,000 lines like this
>in each file that I have to parse. I thought the overhead of a split
>would be too great. Any suggestions please...
>
>Thanks very much
>
>Mike Shavel
>mshavel@erols.com
------------------------------
Date: Fri, 30 Apr 1999 07:15:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regexp help needed
Message-Id: <0d3cg7.am3.ln@magna.metronet.com>
Sean (s@undersea.net) wrote:
: What is the correct regular expression
: for matching ever character from the beginning of a string up to a
: comma?
/^[^,]*/; # this will work even when searching a multi-line string
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 30 Apr 1999 07:47:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regexp or subst
Message-Id: <MPG.11936267d41dcdfd989983@nntp.hpl.hp.com>
In article <3729910e.1942807@news.skynet.be> on Fri, 30 Apr 1999
11:21:07 GMT, Bart Lateur <bart.lateur@skynet.be> says...
...
> $msg =~ s/\$+/%s/g;
> $msg = sprintf($msg,@errors);
Cute. But just in case, I'd do this first:
$msg =~ s/%/%%/g;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 30 Apr 1999 10:54:25 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: RegExs and question marks...a possible bug?
Message-Id: <x3y7lqu6twe.fsf@tigre.matrox.com>
Kenneth Rose <kenrose@home.com> writes:
[snip]
> This is what I want...what I want to know is why the f*ck when I have a
> question mark in the string, it pukes on me?!
Did you read about ? in perlre. In regexps, a question mark is a
special character.
When you have a problem using a certain feature/function, it is best
to read some documentation about that feature/function. Makes sense?
> P.S. - could this be a bug in Perl?
A bug is defined as any behaviour that is different from what is
mentioned in the documentation. Did you check the documentation to see
what is says?
------------------------------
Date: 30 Apr 1999 10:17:58 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: search string syntax
Message-Id: <xkfeml2m6a1.fsf@valdemar.col.hp.com>
britts@pyro.net (Mike Brittain) writes:
> > Could someone please help me with the syntax to match the following :
> >
> > $string = "mobile internet communications"
> >
> > and I want to check to see if the word "mobile" is in that string, I also
> >would like to be able to check if the word "operating systems" in the string.
> Jae, you should look into regular expressions in perl for a large
> variety of possibilities (endless!) for pattern matching.
But in this case, he doesn't want to match patterns, but explicit
strings. In this case, index is a lot faster than using a regex.
#!/usr/bin/perl -w
use Benchmark;
my $string = "match something in this short string";
my $matchstring = "string";
timethese( 100000, {
INDEX => sub { index $string, $matchstring;
},
REGEX => sub { $string =~ m/$matchstring/;
},
});
$ /tmp/tmp.pl
Benchmark: timing 100000 iterations of INDEX, REGEX...
INDEX: 3 secs ( 3.30 usr 0.01 sys = 3.31 cpu)
REGEX: 6 secs ( 5.21 usr 0.02 sys = 5.23 cpu)
-=Eric
------------------------------
Date: Fri, 30 Apr 1999 15:51:22 GMT
From: ismail_pirani@my-dejanews.com
Subject: Re: Signal stuff on NT
Message-Id: <7gcjhn$ukc$1@nnrp1.dejanews.com>
In article <370D1E11.24A79E96@tritechnet.com>,
Eric Von Zee <evonzee@tritechnet.com> wrote:
> Hola everyone,
>
> How does one trap system signals on an NT box? I know that defining a
>
> local($SIG{'key'}) = sub {print "do something\n";}; #right?
>
> will do it for unix, and it seems to be the same for NT (IOW, I can
> create the signal handler with no error). However, (and maybe because
> nt's kills work on a higher level) I cant trap a kill based on terminate
> process or control-C or close window. (I'm running interactive now, but
> will in the future be switching to a background process)
>
> In addition, I don't know how to send signals from one program to
> another to test the signal handler routines (the PID would be known) ..
> is that possible? (maybe using the win32 module? Would I need to know
> the API calls?)
>
> If its in the perldocs, I'd be happy with a pointer to 'perldoc ntsig'
> or whatever..
>
> Thanks for all the help you guys have provided in teh past, and for all
> that I'm sure I'll be begging for in the future.
>
Hey Eric, did you ever manage to figure out if signal handling works in Perl
on Win32 (Win NT is what I am really interested in?). Please do let me know
as I am having difficulty trapping any signals on Win NT. Thanks.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 30 Apr 1999 15:19:26 GMT
From: jabarone@my-dejanews.com
Subject: Simple Checksum "Confidence Level"??
Message-Id: <7gchlo$sp4$1@nnrp1.dejanews.com>
Hello All,
I was wondering if anyone may have any ideas concerning some research I need
to do about a simple checksum routine to verify the programming of an 8 Meg
FLASH memory on a CPU module I'm working on.
I was asked to come up with a "confidence level", in so many percent, that a
simple 32-bit checksum (i.e., the addition of all the words in a FLASH memory
(firmware)) would verify the image was correct. We have a CPU module with
onboard FLASH that we calculate a checksum on to determine if it is programmed
correctly. The algorithm is simply to add each memory location in a 32-bit
accumulator, and then verify the result against a "good" checksum value.
We need to come up with a statement like "We are X% confident that the
checksum will verify the contents of the FLASH image is correct". I have
researched extensively on the net and in our library for this statement, but
all I can find is things like "..if the check sum matches, there is a
REASONABLE chance the data is the same". We are aware that a simple checksum
can be fooled if errors are present or data words are transposed. I just
can't seem to find any analysis to say a checksum is X% accurate.
Does anyone out there have any suggestions where I should look or maybe has
some sort of insight on this?... The person who needs this is adamant that he
needs a "X% confident" number....
Thanks in advance for any help....
Joseph A. Barone
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 30 Apr 1999 15:22:58 GMT
From: jabarone@my-dejanews.com
Subject: Simple Checksum "Confidence Percentage"???
Message-Id: <7gchsc$t5m$1@nnrp1.dejanews.com>
Hello All,
I was wondering if anyone may have any ideas concerning some research I need
to do about a simple checksum routine to verify the programming of an 8 Meg
FLASH memory on a CPU module I'm working on.
I was asked to come up with a "confidence level", in so many percent, that a
simple 32-bit checksum (i.e., the addition of all the words in a FLASH memory
(firmware)) would verify the image was correct. We have a CPU module with
onboard FLASH that we calculate a checksum on to determine if it is programmed
correctly. The algorithm is simply to add each memory location in a 32-bit
accumulator, and then verify the result against a "good" checksum value.
We need to come up with a statement like "We are X% confident that the
checksum will verify the contents of the FLASH image is correct". I have
researched extensively on the net and in our library for this statement, but
all I can find is things like "..if the check sum matches, there is a
REASONABLE chance the data is the same". We are aware that a simple checksum
can be fooled if errors are present or data words are transposed. I just
can't seem to find any analysis to say a checksum is X% accurate.
Does anyone out there have any suggestions where I should look or maybe has
some sort of insight on this?... The person who needs this is adamant that he
needs a "X% confident" number....
Thanks in advance for any help....
Joseph A. Barone
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 30 Apr 1999 09:10:37 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: single quotation " erases REST OF TEXT
Message-Id: <m33e1iqh3m.fsf@moiraine.dimensional.com>
NOSPAMcrstlblu@planet.eon.net writes:
> * * ? * * are there DIFFERENT syntax rules for:
> a: <input type=\"hidden"> or
> b: <input type=\"text\">
<snip much>
Yes. For your current application there are different
rules. I'm going to step through this slowly, hopefully
you'll see where your problem is.
0. You send an HTML document to the user's browser.
In this document you have a form field that looks
like-
<input type=text name=foo>
1. The user fills in the form widget with the literal string
I am 5'10" tall
2. The user clicks the submit button.
3. The browser, in response to the user submitting the form,
escapes the quotes and sends them to your server.
4. Your application receives this data and unescapes it.
You now once again have the original string.
5. At this point you can add the value to your DBM file
with no problems.
6. You generate a new HTML document. Somewhere in this document
generate a hidden form field with a piece of code that looks
like this-
$html .= "<input type=\"hidden\" name=\"foo\" value=\"$value\">"
7. Perl interpolates the variable in the text string. Now your
string looks like this-
<input type="hidden" name="foo" value="I am 5'10" tall">
^^^^^^^^
You now have a problem. When the user's browser receives
this invalid HTML it does what it can to recover--in this
case it appears to ignore the extraneous text after your
second " in the value attribute.
8. Your user completes the second screen of your application and
clicks the submit button. The browser sends the string that
it thinks is correct from your hidden form field.
9. You get results that are not what you expected.
See, it's very simple. You need to properly escape the text
you want to use in your HTML if you would like for it to
be handled properly by your users' browsers.
HTH.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Fri, 30 Apr 1999 14:45:47 GMT
From: nekoboh@my-dejanews.com
Subject: Sybase::DBlib and Two Phase commit
Message-Id: <7gcfmq$qve$1@nnrp1.dejanews.com>
Hello,
Where might I find some documentation on doing Two-phase commit using
Sybase::DBlib?
Michael Peppler's site
http://www.mbay.net/~mpeppler/Sybperl/sybperl.html#Sybase_DBlib
lists Sybase::DBlib's Two Phase commit routines.
But there's not enough explanation.
I'd like to find some examples if possible.
Thanks in advance.
Nekoboh.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 30 Apr 1999 15:57:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: using perl to manage passwords?
Message-Id: <3729c4d4@newsread3.dircon.co.uk>
Dan Baker <dtbaker@bus-prod.com> wrote:
> I need to implement some password protected areas of a website...
>
This is totally unrelated to Perl. You will need to ask in the
appropriate newsgroup for your server.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 30 Apr 1999 10:24:33 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: Re: using perl to manage passwords?
Message-Id: <3729CB31.615FA2BC@bus-prod.com>
Jonathan Stowe wrote:
>
> Dan Baker <dtbaker@bus-prod.com> wrote:
> > I need to implement some password protected areas of a website...
> >
>
> This is totally unrelated to Perl. You will need to ask in the
> appropriate newsgroup for your server.
----------
I don't think it's totally unrelated....
- I'm wondering if there are any things to be aware of if I use perl to
manage the username and password files.
- I'm wondering if there are perl admin tools already written that
people know about. I was thinking that perhaps there is a free script
around that is designed to maintain the username and password files?
Dan
------------------------------
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 5528
**************************************