[16402] in Perl-Users-Digest
Perl-Users Digest, Issue: 3814 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 26 21:05:28 2000
Date: Wed, 26 Jul 2000 18:05:13 -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: <964659912-v9-i3814@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Jul 2000 Volume: 9 Number: 3814
Today's topics:
A Problem with Split <scrampton71NOscSPAM@hotmail.com.invalid>
Re: A Problem with Split (Andrew J. Perrin)
Re: A Problem with Split <scrampton71NOscSPAM@hotmail.com.invalid>
Re: A Problem with Split (Logan Shaw)
Re: A Problem with Split (Marcel Grunauer)
Automating Web Page Update <claudiasmt@sprynet.com>
Re: backtick with spaces on win32 mikelot@my-deja.com
Re: Critiques, please (Marcel Grunauer)
Re: Critiques, please <lr@hpl.hp.com>
Re: difference between two times in seconds (Logan Shaw)
Re: difference between two times in seconds (Abigail)
Re: Formatting text file <coy@coystoys.com>
Re: Formatting text file (Marcel Grunauer)
Re: Formatting text file (Andrew Johnson)
Re: Formatting text file <coy@coystoys.com>
Re: Formatting text file <coy@coystoys.com>
Re: Formatting text file <lr@hpl.hp.com>
Help! System function from html page <r52270@email.sps.mot.com>
Re: Help! System function from html page (Marcel Grunauer)
Re: Help! System function from html page mr_calhoun@my-deja.com
Re: newbie hashes of hashes declartion question <o1technospam@skyenet.nospam.net>
Re: Nobody loves me? <mjcarman@home.com>
Re: Nobody loves me? <jason@mybowie.com>
Re: pattern match <lauren_smith13@hotmail.com>
Re: Perl sequivallent for tidy (HTML fixup program)? (William Herrera)
Re: perl-5.6.0: Bug with "not" operator? <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Jul 2000 15:02:27 -0700
From: steve cramton <scrampton71NOscSPAM@hotmail.com.invalid>
Subject: A Problem with Split
Message-Id: <127ace60.491e354d@usw-ex0105-036.remarq.com>
Does anyone have an idea why the script below does not work?
use DB_File ;
use fcntl ;
$delimiter ='|' ;
$database = 'c:\scripts\test\aerxa.db' ;
$mailhostsdb = 'c:\scripts\test\mailhosts.db' ;
tie %h, 'DB_File', "$database", O_CREAT|O_RDWR, 0666, $DB_HASH
or die "Cannot open database file: $!\n" ;
while (($k, $v) = each %h)
{
$values = $v ;
$mail, $time, $status = (split /|/ ,$values) ;
print "\nvalues is = $values" ;
($mail, $time, $status) = (split /|/ ,$k) ;
When this the run $mail, $time & $status are empty.
$v prints out correctly similar to hotmail.com|964641861|valid
Ive read the perl docs and played around with it for hours but
with no luck. Am I missing something here?
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 26 Jul 2000 18:18:58 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: A Problem with Split
Message-Id: <u3dkwwn59.fsf@demog.berkeley.edu>
steve cramton <scrampton71NOscSPAM@hotmail.com.invalid> writes:
> Does anyone have an idea why the script below does not work?
[snip]
>
> $delimiter ='|' ;
>
You never use this.... why set it?
[snip]
> $mail, $time, $status = (split /|/ ,$values) ;
> print "\nvalues is = $values" ;
> ($mail, $time, $status) = (split /|/ ,$k) ;
>
What do you think | means in a regular expression context? If | were a
special character, how might you tell perl to treat it as a regular
character?
--
--------------------------------------------------------------
Andrew J. Perrin - UC Berkeley, Sociology & Demography
Consulting: Solaris-Linux-NT-Samba-Perl-MS Access-Postgres
andrewperrin@netscape.net - http://demog.berkeley.edu/~aperrin
--------------------------------------------------------------
------------------------------
Date: Wed, 26 Jul 2000 15:32:41 -0700
From: steve cramton <scrampton71NOscSPAM@hotmail.com.invalid>
Subject: Re: A Problem with Split
Message-Id: <194a0e79.5101b657@usw-ex0105-036.remarq.com>
>[snip]
>> $mail, $time, $status = (split /|/ ,$values) ;
>> print "\nvalues is = $values" ;
>> ($mail, $time, $status) = (split /|/ ,$k) ;
>>
>
>What do you think | means in a regular expression context? If |
were a
>special character, how might you tell perl to treat it as a
regular
>character?
>
Yes I have tryed:-
$mail, $time, $status = (split /\|/ ,$values)
But $mail,$time and $status are still empty.
As for the $delimiter ='|' ; I just forgot to remove before
posting.
Steve C..
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 26 Jul 2000 18:43:25 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: A Problem with Split
Message-Id: <8lnt2t$mm2$1@provolone.cs.utexas.edu>
In article <127ace60.491e354d@usw-ex0105-036.remarq.com>,
steve cramton <scrampton71NOscSPAM@hotmail.com.invalid> wrote:
>
>Does anyone have an idea why the script below does not work?
>
>use DB_File ;
>use fcntl ;
>
>$delimiter ='|' ;
>
>$database = 'c:\scripts\test\aerxa.db' ;
>$mailhostsdb = 'c:\scripts\test\mailhosts.db' ;
>
>tie %h, 'DB_File', "$database", O_CREAT|O_RDWR, 0666, $DB_HASH
> or die "Cannot open database file: $!\n" ;
>
>
>while (($k, $v) = each %h)
>{
>$values = $v ;
>$mail, $time, $status = (split /|/ ,$values) ;
>print "\nvalues is = $values" ;
>($mail, $time, $status) = (split /|/ ,$k) ;
>
>
>When this the run $mail, $time & $status are empty.
I haven't tried the code, but I believe the key lies in the line
that goes like this:
$mail, $time, $status = (split /|/ ,$values) ;
The perl interpreter sees this as an expression with a comma operator,
so it does the following to evaluate that expression:
* it evaluates the expression "$mail".
* it evaluates the expression "$time".
* it evaluates the expression "$status = (split /|/ ,$values)".
Since split() is in a scalar context in the last one of those three
expressions, it should return the number of things that would be
returned by split() if it were in a list context. With a regular
expression that matches empty strings, that should probably equate to
the length of the string being split.
Also, I'm not sure why you're trying to set the same three variables
based on a split of $values and another split of $k.
- Logan
------------------------------
Date: Wed, 26 Jul 2000 23:42:02 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: A Problem with Split
Message-Id: <slrn8nuu54.1jm.marcel@gandalf.local>
On 26 Jul 2000 18:43:25 -0500, Logan Shaw <logan@cs.utexas.edu> wrote:
>In article <127ace60.491e354d@usw-ex0105-036.remarq.com>,
>steve cramton <scrampton71NOscSPAM@hotmail.com.invalid> wrote:
>>
>>Does anyone have an idea why the script below does not work?
>>$mail, $time, $status = (split /|/ ,$values) ;
>>print "\nvalues is = $values" ;
>>($mail, $time, $status) = (split /|/ ,$k) ;
>>
>>
>>When this the run $mail, $time & $status are empty.
>
>I haven't tried the code, but I believe the key lies in the line
>that goes like this:
>
> $mail, $time, $status = (split /|/ ,$values) ;
Also, you split along a regex, so the '|' needs to be escaped:
($mail, $time, $status) = split /\|/ => $values;
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Wed, 26 Jul 2000 20:48:53 -0400
From: "Claudia" <claudiasmt@sprynet.com>
Subject: Automating Web Page Update
Message-Id: <8lo0r6$smh$1@nntp9.atl.mindspring.net>
Does anyone know of a script that would allow me to update my web pages
automatically online?
For example: The html page is static Except for the content in certain
areas of the page (all text) that may or may not need updating from time to
time.
Also is there a script that could create a copy of a set of static html
pages based on user input? For example: The user chooses site 1 of 3 and
the script would
1 - Read the Site 1 input from user
2- Go out and retrieve all the necessary html pages associated to Site 1
3 - Copy these pages to a new name or new directory
4 -Allow the user to update these pages online with text content for
specific areas of the html pages.
Any help or direction (suggested reading) as to where to start would be much
appreciated.
Claudia
------------------------------
Date: Wed, 26 Jul 2000 22:22:46 GMT
From: mikelot@my-deja.com
Subject: Re: backtick with spaces on win32
Message-Id: <8lnobh$ajh$1@nnrp1.deja.com>
>
> what would happen if you typed
>
> c:\Program Files\Adobe\Reader\Acrord32.exe
>
> at the command prompt ?
>
Thanks - good point! I typically run from bash, which lets you use
command line entries like the above, as long as you escape the spaces
with a backslash (and backslash the backslashes)...hmm, maybe i can
tell perl what shell to run with backticks (like bash)?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 22:58:03 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Critiques, please
Message-Id: <slrn8nurh6.1jm.marcel@gandalf.local>
On Wed, 26 Jul 2000 12:23:16 -0500 (CDT), BUCK NAKED1
<dennis100@webtv.net> wrote:
>Is it "soup" yet? workable? perfect? as good as most counters? Critiques
>and constructive suggestions desired.
I hope you don't confuse obfuscated Perl with bad use of whitespace.
>#!/usr/local/bin/perl -w
>use strict;
A good beginning.
>seek(COUNT, 0, 0) or die "can't REWIND to beginning of data file: $!";
REWIND? Are you running your web site off a tape drive?
>print "Content-type: text/html\n\n"; print("You are the $num visitor to
>this webpage");
could use a here document, er, here.
Otherwise, well, if it works...
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Wed, 26 Jul 2000 17:39:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Critiques, please
Message-Id: <MPG.13e924b3ba5db2398abf3@nntp.hpl.hp.com>
In article <slrn8nurh6.1jm.marcel@gandalf.local> on Wed, 26 Jul 2000
22:58:03 GMT, Marcel Grunauer <marcel@codewerk.com> says...
> On Wed, 26 Jul 2000 12:23:16 -0500 (CDT), BUCK NAKED1
> <dennis100@webtv.net> wrote:
...
> >seek(COUNT, 0, 0) or die "can't REWIND to beginning of data file: $!";
>
> REWIND? Are you running your web site off a tape drive?
Oh, come on, now!
From the ANSI/ISO C Standard:
4.9.9.5 The rewind function
...
The rewind function sets the file position indicator for the stream ...
to the beginning of the file. It is equivalent to
(void)fseek(stream, 0L, SEEK_SET)
except that the error indicator for the stream is also cleared.
Not a hint of tape drives there. As near as I can tell, by not
including a rewind() function in Perl The Larry was just being unusually
parsimonious. As contrasted to the superflous printf() function,
equivalent to print sprintf ..., or several other examples of
redundancy, including synonyms such as for/foreach and tr/y.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 26 Jul 2000 18:33:56 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: difference between two times in seconds
Message-Id: <8lnsh4$ml7$1@provolone.cs.utexas.edu>
In article <8lnavr$5ii$1@brokaw.wa.com>,
Lauren Smith <lauren_smith13@hotmail.com> wrote:
>
>David T. Liu <david.t.liu@intel.com> wrote in message
>news:8ln97m$fnn@news.or.intel.com...
>> What's the quickest way to get the difference between two time objects in
>> seconds?
>
>sub datediff {
> my ($x, $y) = @_;
> return abs($x-$y);
>}
But as long as we're avoiding using the built-in operators, I think
this is more fun:
sub datediff
{
@_ = @_;
push (@_, shift) if $_[0] > $_[1];
--$_[1] while $_[0]--;
pop;
}
I'm sure there's a similar solution involving the ".." operator too.
- Logan, whose code is glad time() never returns something negative
------------------------------
Date: 26 Jul 2000 20:56:54 EDT
From: abigail@foad.org (Abigail)
Subject: Re: difference between two times in seconds
Message-Id: <slrn8nv26d.vcg.abigail@alexandra.foad.org>
Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXI September MCMXCIII in
<URL:news:8lnsh4$ml7$1@provolone.cs.utexas.edu>:
:) In article <8lnavr$5ii$1@brokaw.wa.com>,
:) Lauren Smith <lauren_smith13@hotmail.com> wrote:
:) >
:) >David T. Liu <david.t.liu@intel.com> wrote in message
:) >news:8ln97m$fnn@news.or.intel.com...
:) >> What's the quickest way to get the difference between two time objects in
:) >> seconds?
:) >
:) >sub datediff {
:) > my ($x, $y) = @_;
:) > return abs($x-$y);
:) >}
:)
:) But as long as we're avoiding using the built-in operators, I think
:) this is more fun:
:)
:) sub datediff
:) {
:) @_ = @_;
:) push (@_, shift) if $_[0] > $_[1];
:)
:) --$_[1] while $_[0]--;
:) pop;
:) }
There's nothing that can't be solved with a regex.
sub datediff {
local ($_, $:) = map {1 x $_} $_ [0] > $_ [1] ? @_ : reverse @_;
s/$:// and length;
}
--
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
------------------------------
Date: Wed, 26 Jul 2000 23:26:21 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: Formatting text file
Message-Id: <xsKf5.10127$Mt.123712@nnrp1.ptd.net>
: > Well, because im a amature perl programer, im not sure of any easy
: > way of doing this..
: > but, if I had to take a guess,
:
: Why do you think this newsgroup is appropriate for 'if I had to take a
: guess'? Maybe you shouldn't guess; and especially you shouldn't post
: code that has never seen the perl compiler. That is disrespectful to
: everybody.
:
: > i would attempt to dynamically build an array for each row
: > after /^Run/, and push (@dynamic_array, $line); each row into the proper array.
:
: OK, but you are going about it completely wrong, trying to use symbolic
: references instead of a two-dimensional data structure.
:
: > Something like :
:
: Actually, very little like :
:
: > $file = 'file.dat';
:
: You define this, but don't use it!
:
: > open (FILE,"<file.dat");
:
: You open a file, but don't check to see if the open succeeds.
:
: open FILE, $file or die "Couldn't open '$file'. $!\n";
:
: > foreach $line (<FILE>){
: > if ($line =~ /^Run.*/i) {
: > push (@row1, $line);
: > $num = 2;
: > else {
: > if (@row . $num) {
: > # I have no idea if u can call a dynamic array like this
: > # e.g: @row . $num = @row2
:
: Then why do you post your conjecture? What you show is the name of an
: array in scalar context (the value of which is the size of the array)
: concatenated with another number. Bah!
:
: <snip more untested nonsense>
:
: > Of course you will have to figure out how to declare dynamix array's
: > and fix the above, but, u get the general idea... (sorry, just woke up :)
:
: Perhaps you should go back to sleep until you can offer useful
: suggestions.
:
: > Good luck
: > -Coy
:
: He'll need it!
: (Just Another Larry) Rosler
: Hewlett-Packard Laboratories
: http://www.hpl.hp.com/personal/Larry_Rosler/
: lr@hpl.hp.com
personally, i don't get a damn who you are or what you think.
as I see it, at least I offered advice.. more than I can say for you.
Instead of sitting up criticizing everyone else's post, how about being a little
helpful yourself, or STFU.
remarks like yours are a direct insult to those trying to be
helpful, no matter how amateur, or professional they are.
Or do you not understand what a newsgroup is ?
Coming from HP Labs I would have thought otherwise,
regards.
- Coy.
------------------------------
Date: Wed, 26 Jul 2000 23:23:02 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Formatting text file
Message-Id: <slrn8nut1m.1jm.marcel@gandalf.local>
On Wed, 26 Jul 2000 23:26:21 GMT, Coy <coy@coystoys.com> wrote:
>: (Just Another Larry) Rosler
>: Hewlett-Packard Laboratories
>: http://www.hpl.hp.com/personal/Larry_Rosler/
>: lr@hpl.hp.com
>
>personally, i don't get a damn who you are or what you think.
Surely you mean "give a damn".
>as I see it, at least I offered advice.. more than I can say for you.
You seem to have no idea who you are responding to, do you?
>remarks like yours are a direct insult to those trying to be
>helpful, no matter how amateur, or professional they are.
But you weren't helpful. Maybe the intention was there, but what
you post goes out to thousands of people, so it had better be tested
beforehand. Guessing is easy, but it doesn't get you anywhere.
I guess (also untested, but has a good chance of being correct) that I
won't see another post from you.
*plonk*
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Wed, 26 Jul 2000 23:50:31 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Formatting text file
Message-Id: <bPKf5.12635$k5.162161@news1.rdc1.mb.home.com>
In article <xsKf5.10127$Mt.123712@nnrp1.ptd.net>,
Coy <coy@coystoys.com> wrote:
[snippage of LR's reply to Coy's reply]
> personally, i don't get a damn who you are or what you think.
> as I see it, at least I offered advice.. more than I can say for you.
You don't hang out here much do you? LR offers sage advice around
here plenty -- including the comments he gave regarding your untested
guesswork.
> Or do you not understand what a newsgroup is ?
> Coming from HP Labs I would have thought otherwise,
Score: -9999
andrew
--
Andrew L. Johnson http://members.home.net/andrew-johnson/
Doing linear scans over an associative array is like
trying to club someone to death with a loaded Uzi.
-- Larry Wall
------------------------------
Date: Thu, 27 Jul 2000 00:05:20 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: Formatting text file
Message-Id: <41Lf5.10241$Mt.124392@nnrp1.ptd.net>
: >personally, i don't get a damn who you are or what you think.
:
: Surely you mean "give a damn".
opps.
: >as I see it, at least I offered advice.. more than I can say for you.
:
: You seem to have no idea who you are responding to, do you?
actually, yes I do. and like I 'meant to say': I don't give a damn.
Larry Wall could have posted, and I would have replied in the
same fashion.
If your going to insult someone up and down when all they
were trying to do is help, then not only do u deserve a good
flame, but a smack in the face.. since u were in such a hurry
to smack them but not offer correction, or solve the problem yourself.
He has offered great advice elsewhere in this newsgroup..
and thats good. But like I said, being a all around good guy,
does not give you the right to be rude, or ignorant to someone
else later.
: >remarks like yours are a direct insult to those trying to be
: >helpful, no matter how amateur, or professional they are.
:
: But you weren't helpful. Maybe the intention was there, but what
: you post goes out to thousands of people, so it had better be tested
: beforehand. Guessing is easy, but it doesn't get you anywhere.
More helpful than the rest of the replies that have been posted.
And there has been so many posted (untested) code on this newsgroup
than Id like to count.. and I encourage testing code before posting of course..
But I'd also like to get everyones thoughts, and feelings on a problem,
then none at all, which currently, this poor guy who posted this
problem, only got one.. mine, and theres 5 replies to it.
: I guess (also untested, but has a good chance of being correct) that I
: won't see another post from you.
incorrect, but hey. we are all entitled to our 'opinions' now aren't we ?
: *plonk*
:
: --
: Marcel
: sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Thu, 27 Jul 2000 00:09:50 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: Formatting text file
Message-Id: <i5Lf5.10255$Mt.124841@nnrp1.ptd.net>
: > personally, i don't get a damn who you are or what you think.
: > as I see it, at least I offered advice.. more than I can say for you.
:
: You don't hang out here much do you? LR offers sage advice around
: here plenty -- including the comments he gave regarding your untested
: guesswork.
his comments were hardly gratifying in any way to solving the original problem.
Yes, as stated before, he has offered much advice around here.
But none regarding this problem that he decided to comment on, or more appropriatly
'my problem'.
: > Or do you not understand what a newsgroup is ?
: > Coming from HP Labs I would have thought otherwise,
:
: Score: -9999
....
anger feeds the mind sometimes.
------------------------------
Date: Wed, 26 Jul 2000 17:26:14 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Formatting text file
Message-Id: <MPG.13e921856378c72798abf2@nntp.hpl.hp.com>
In article <xsKf5.10127$Mt.123712@nnrp1.ptd.net> on Wed, 26 Jul 2000
23:26:21 GMT, Coy <coy@coystoys.com> says...
[without proper attribution. My lines start with '> : '.]
...
> : OK, but you are going about it completely wrong, trying to use symbolic
> : references instead of a two-dimensional data structure.
...
> personally, i don't get a damn who you are or what you think.
> as I see it, at least I offered advice.. more than I can say for you.
> Instead of sitting up criticizing everyone else's post, how about being a little
> helpful yourself, or STFU.
The sentence retained above from my post contains the hint needed to
address this problem: the use of a two-dimensional data structure. The
original poster is expected to take such a hint and try to generate code
that works.
Had I chosen to, I might have strengthened the hint by pointing
explicitly to the Perl documents perldsc and perllol. But until code
was shown indicating that those resources had been used, neither I nor
others would feel a compelling need to show specific code solutions. As
any code would have to be tested, the effort required for such a mundane
problem as this wouldn't be warranted -- at least until the original
poster had tried and needed more help.
> remarks like yours are a direct insult to those trying to be
> helpful, no matter how amateur, or professional they are.
>
> Or do you not understand what a newsgroup is ?
> Coming from HP Labs I would have thought otherwise,
Had you lurked here a while, you would have seen that certain criteria
are used to judge the acceptability of posted responses. The ones that
come most immediately to mind are:
Posting of tested code, unless specifically identified as such.
Posting of code that compiles and runs without warnings (use of the
'-w' flag).
Posting of code that compiles properly with the 'use strict;'
pragma. This specifically rules out the use of symbolic references,
which you were attempting to do by means of code such as this:
> : > if (@row . $num) {
> : > # I have no idea if u can call a dynamic array like this
> : > # e.g: @row . $num = @row2
Posting of advice only in areas where the responder has some
knowledge. Your comment above specifically disclaims knowledge of what
you were trying to help with.
Not only are posts here distributed worldwide, they are archived. The
archives may be used as references by people seeking authoritative
information or advice.
That is my understanding of what *this* newsgroup is. There are other
opportunities for contributors with less desire for professionalism.
I'm told that alt.perl is one such, though the HP Labs news server
doesn't offer it (for good reason :-), so I've never seen it. I don't
think I'm missing much!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 26 Jul 2000 15:50:48 -0700
From: Mike Huang-R52270 <r52270@email.sps.mot.com>
Subject: Help! System function from html page
Message-Id: <397F6B47.3453ABD5@email.sps.mot.com>
I have this section of code in a .pl file. It is displayed in the
browser. The process_cust_data program doesn't even seem to be called.
It works perfectly on the command line.
chdir ("$compiler_path");
system("process_cust_data.pl $cust_id $send_interval >
$data_path/temp.xls");
open(FILE, "$data_path/temp.xls");
print $data;
while (<FILE>) {
print;
}
close(FILE);
------------------------------
Date: Wed, 26 Jul 2000 23:15:03 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Help! System function from html page
Message-Id: <slrn8nusia.1jm.marcel@gandalf.local>
On Wed, 26 Jul 2000 15:50:48 -0700, Mike Huang-R52270
<r52270@email.sps.mot.com> wrote:
>I have this section of code in a .pl file. It is displayed in the
>browser. The process_cust_data program doesn't even seem to be called.
>It works perfectly on the command line.
If a program is display as text in the browser window instead of getting
executed, you need to make sure that the program has execute permission,
that the directory is marked as containing programs in the server
configuration (e.g., ExecCGI in Apache's httpd.conf), and/or (for IIS)
that the .pl file suffix is mapped to Perl in the server configuration.
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Wed, 26 Jul 2000 23:33:53 GMT
From: mr_calhoun@my-deja.com
Subject: Re: Help! System function from html page
Message-Id: <8lnsh1$dog$1@nnrp1.deja.com>
Is the file chmod(ed) and in an CGI'ish directory. PS You have to run
this from a browser like http://foo.com/cgi-bin/file.pl
hope this helps,
-court
In article <397F6B47.3453ABD5@email.sps.mot.com>,
Mike Huang-R52270 <r52270@email.sps.mot.com> wrote:
> I have this section of code in a .pl file. It is displayed in the
> browser. The process_cust_data program doesn't even seem to be
called.
> It works perfectly on the command line.
>
> chdir ("$compiler_path");
>
> system("process_cust_data.pl $cust_id $send_interval >
> $data_path/temp.xls");
>
> open(FILE, "$data_path/temp.xls");
>
> print $data;
> while (<FILE>) {
> print;
> }
> close(FILE);
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Jul 2000 17:53:26 -0500
From: "Jim Kauzlarich" <o1technospam@skyenet.nospam.net>
Subject: Re: newbie hashes of hashes declartion question
Message-Id: <ySJf5.127$Dw6.1079@newsfeed.slurp.net>
"Ala Qumsieh" <aqumsieh@hyperchip.com> wrote in message
news:7au2degtvw.fsf@merlin.hyperchip.com...
>
> "Jim Kauzlarich" <o1technospam@skyenet.nospam.net> writes:
>
> > #! /usr/bin/perl -w
> > use strict;
> > my %HoH;
> >
> > %HoH = {
> ^
> ^
> Why are you using curlies here? Curlies are used to construct anonymous
> hashes. What you want are regular parentheses ().
Ah. Thanks.
Gotta clean those glasses. :)
------------------------------
Date: Wed, 26 Jul 2000 16:48:32 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Nobody loves me?
Message-Id: <397F5CB0.C8AEF28D@home.com>
Jason Dixon wrote:
>
> Ok, so you'd rather waste both your time and mine by lecturing me on
> the etiquette of Usenet than just offer a hand?
*sigh*
It's only a waste of your time if you read it but ignore it. It's only a
waste of Mr. Pierce's time if *nobody* reads it and/or everybody who
does ignores it.
The points were valid, and if someone lurking out there absorbed a
little nettiquette, then the post you're so upset over served it's
purpose.
-mjc
------------------------------
Date: Wed, 26 Jul 2000 21:52:59 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Nobody loves me?
Message-Id: <397F6E59.88A3D6D9@mybowie.com>
> It's only a waste of your time if you read it but ignore it. It's only a
> waste of Mr. Pierce's time if *nobody* reads it and/or everybody who
> does ignores it.
>
> The points were valid, and if someone lurking out there absorbed a
> little nettiquette, then the post you're so upset over served it's
> purpose.
>
> -mjc
I'm not upset over his suggestions; I have no problem with that, and see
that his point is valid. My concern is that I've now had three people feel
the need to harp on the subject without offering any assistance to the
original problem. I'm not sure where to go now... I've had two individuals
graciously offer their assistance (albeit without resolution), and three
people who would rather correcting me on netiquette than letting the issue
rest (I'm sorry!!!) and helping a fellow geek to solve a problem.
People, I understand. And to everyone else out there... please learn from
my mistake! Now, is there anyone that would be generous enough to help me
with this problem? I can't express enough gratitiude for any assistance
offered!
-Jason
------------------------------
Date: Wed, 26 Jul 2000 14:52:18 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: pattern match
Message-Id: <8lnmgn$b2k$1@brokaw.wa.com>
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.13e8f58bce63188798abf1@nntp.hpl.hp.com...
> In article <8lnbja$5i7$1@brokaw.wa.com> on Wed, 26 Jul 2000 11:46:00 -
> 0700, Lauren Smith <lauren_smith13@hotmail.com> says...
> > Jimmy Lantz <jimmy.lantz@ostas.lu.se> wrote in message
> > news:397F25BE.11481918@ostas.lu.se...
>
> > > Even better, pattern memory.
> > > you should look up on Regular expressions and pattern memory, by
> > > using ().
> >
> > How is that better?
> >
> > @info = split / \| /, $string;
>
> @info = $string =~ /(.*?)(?: \| |$)/g;
>
Here's a quick benchmark of the two:
use Benchmark;
$str = "someinof | moreinfo | evenmore | more | less";
timethese( 100000, {
'split' => sub {@arr = split / \| /, $str},
'regex' => sub {@arr = $str =~ /(.*?)(?: \| |$)/g}
});
Benchmark: timing 100000 iterations of regex, split...
regex: 8 wallclock secs ( 7.56 usr + 0.00 sys = 7.56 CPU)
split: 2 wallclock secs ( 1.86 usr + 0.00 sys = 1.86 CPU)
Lauren
------------------------------
Date: Thu, 27 Jul 2000 00:00:18 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Perl sequivallent for tidy (HTML fixup program)?
Message-Id: <397f7758.579163890@news.rmi.net>
On Wed, 26 Jul 2000 12:06:08 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>> >Hi, I am currently looking at running some program HTML output (from a
>> >text or MS word to HTML translator) through tidy via system() in a perl
>> >program. Is there a native perl equivalent to the tidy program for
>> >cleaning up HTML?
>>
>> http://www.fourmilab.ch/webtools/demoroniser/
>>
>> was made with that purpose
>>
>> by
>> John Walker
>> http://www.fourmilab.ch/
>>
>> It might be just what you are looking for.
>
>A somewhat updated version of that program can be found at
>
><URL:http://www.perl.com/language/misc/demoroniser.html>
Grabbed and saved to disk. However there is the matter of old HTML -> XHTML,
which involves changing
<p> sometext <p> someothertext
to
<p> sometext </p> <p> someothertext </p>
which tidy does nicely. I guess I'll just use the tool.
And, to thie standard module writers:
Does anyone (ie Lincoln Stein) know how close to standard XHTML current CGI.pm
output is nowadays?
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Wed, 26 Jul 2000 22:06:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <e6ouns8jtgloc1tlgk118ckf19jeq9scia@4ax.com>
mike@excite.com () wrote:
>>Any other behaviour, like the one you propone, is only confusing.
>
>I'm not proposing anything.
I meant you're in favor of it (proponent).
--
Bart.
------------------------------
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 3814
**************************************