[11627] in Perl-Users-Digest
Perl-Users Digest, Issue: 5226 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 25 15:07:34 1999
Date: Thu, 25 Mar 99 12:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 25 Mar 1999 Volume: 8 Number: 5226
Today's topics:
$alreadyHaveError parameter problem <dsmorey@unconundrum.com>
Accessing Secure Site <donny@impulsesoftware.com>
Re: ANNOUNCE: Boston.pm Social Meeting, Thurs Mar 25 <elaine@cts.wustl.edu>
Anything lchown()-like in Perl? <halfdan@no-junk-mail.pison.com>
Re: array question (Mark P.)
Re: Date/Time calculation: % through current month? <tony@crux.blackstar.co.uk>
Re: Date/Time calculation: % through current month? <tony@blackstar.co.uk>
don't understand ||= operator <jdudley@inna.net>
Re: don't understand ||= operator (Bill Moseley)
Re: don't understand ||= operator (Larry Rosler)
Re: don't understand ||= operator (George Crissman)
FFT/FT in perl? mnanao@sbl.salk.edu
Re: How to make my database? <prochak@my-dejanews.com>
Re: How to take advantage of Win9X printer drivers. (Matthew Bafford)
Re: HTML LINK verifier ? <jamesht@idt.net>
HTML Parse Tree Tools in Perl <marciano@sdsc.edu>
Re: HTML Parse Tree Tools in Perl <jamesht@idt.net>
Re: index contents of text files to corresponding html (Tad McClellan)
Re: Input Password (Greg Bacon)
insert html links in big list of equations <htaylor@mit.edu>
Re: need help getting started! (George Crissman)
Need tips on improving performance. <webmaster@giftregistry.hypermart.net>
Re: New Bee Alert (Bart Lateur)
Re: Odd/Even (M.J.T. Guy)
Re: Perl Composer Needed (George Crissman)
Re: Perl, Oracle, and SQL <prochak@my-dejanews.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Mar 1999 14:03:04 -0500
From: "Dan Smorey Jr." <dsmorey@unconundrum.com>
Subject: $alreadyHaveError parameter problem
Message-Id: <7157B516B5F8D11198320080296571A25EF6C1@EXCHANGE>
I got to ask this question. This problem does not make any sense to me.
I wanted to use a parameter named $alreadyHaveError. Problem is, it
kept showing up blank. Nothing could be assigned to it. It was a
simple assignment...
$alreadyHaveError = $haveError;
$haveError always has something in it, either 1 or 0, so
$alreadyHaveError should be assigned. First thing I thought was, global
variable, maybe this variable is assigned somewhere else and being
assigned null. I grep'd all the files in my project and didn't find a
single $alreadyHaveError. So, I thought maybe it's the away I'm
assigning it...
($alreadyHaveError) = $haveError;
my ($alreadyHaveError) = $haveError;
Tried both of those and they both didn't work. So, after that, I
thought the next best thing, try another parameter name. I tried...
$alreadyHadError = $haveError;
Worked the first time. Can somebody explain this to me? Is
$alreadyHaveError a system supplied parameter or something? How can
changing...
$alreadyHaveError = $haveError;
to this...
$alreadyHadError = $haveError;
change anything?
Thanks in advance for an answer to my perplexing problem.
Dan R. Smorey Jr.
Programmer/Analyst
UnConundrum, Inc.
www.unconudnrum.com
dsmorey@unconundrum.com
smory@ptdprolog.net
------------------------------
Date: Thu, 25 Mar 1999 18:07:41 GMT
From: Donny Widjaja <donny@impulsesoftware.com>
Subject: Accessing Secure Site
Message-Id: <36FA7BE3.FA0B6179@impulsesoftware.com>
I need to do a credit card processing and I need to access it via https.
Does anybody know a module that prodive a access to https?
Thank you
------------------------------
Date: Thu, 25 Mar 1999 14:38:02 -0500
From: Elaine Ashton <elaine@cts.wustl.edu>
Subject: Re: ANNOUNCE: Boston.pm Social Meeting, Thurs Mar 25
Message-Id: <36FA909A.F297CE88@cts.wustl.edu>
Ronald J Kimball wrote:
>
> Elaine Ashton <elaine@cts.wustl.edu> wrote:
>
> > You know, I also had this wacky idea today to turn my rusting 16yo volvo
> > wagon into the "Perl Mobile" in time for YAPC...so..if you were a perl
> > mobile what would you look like? This could be a fun group thing to
> > paint it....:)
>
> Like a camel, of course.
c'mon Ron, be creative :) I was thinking of having the entire car sanded
since the rear wheel wells need to be re-built anyway, having it
re-painted an opaque/irredescent white (perl-like) and then stenciling
on #!/usr/local/bin/perl, a schwartzian transform, etc and possibly
camels, llamas, panthers and rams topped off with a giant perl (read
shiny ball) as the hood ornament....maybe call it the 'shebang
mobile'...I have no idea why I am so taken with this...
e.
------------------------------
Date: Thu, 25 Mar 1999 19:05:24 +0000
From: Halfdan Ingvarsson <halfdan@no-junk-mail.pison.com>
Subject: Anything lchown()-like in Perl?
Message-Id: <36FA88F4.B3EA4C22@no-junk-mail.pison.com>
Haloo..
Was there any way in perl to change the owner of a symbolic link (ie.
not the file it points to) without resorting to 'system()' (which is
slow)?
(BTW. I'm using perl 5.005 and I don't seem to have syscall.ph)
Ciao,
H.
Halfdan Ingvarsson, Guru, Pison Ltd. -- What do you want to crash today?
'What sets us programmers apart from other trades is that we have the
ability to create our own tools if we don't like the current ones.'
------------------------------
Date: Thu, 25 Mar 1999 18:47:34 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: array question
Message-Id: <36fa83b6.72840108@news.ionet.net>
Thanks to everyone who helped on this project. I finally got
it to work incorporating a lot of your suggestions. Here's the
finished code BTW.
$file_extension = $in{'file-to-upload-01'};
$file_extension =~ s/.*\\([^\\]+)$/$1/;
$file_extension =~ s/.*\.//g;
if ($file_extension) {
foreach $extension (@extension){
if($file_extension =~ m/$extension/i){
$check_extension = 1;
last;
}
}
}
else {
$check_extension = 0;
}
if ($check_extension == 1) { do everything else }
If my code isn't totally optimized its because I was fighting
this thing all the way. I only started to figure it out when I started
printing output on error.
Thanks again
------------------------------
Date: 25 Mar 1999 19:17:00 GMT
From: Tony Bowden <tony@crux.blackstar.co.uk>
Subject: Re: Date/Time calculation: % through current month?
Message-Id: <922389401.346646@news.tibus.net>
dana watanabe <dwatanab@uci.edu> wrote:
: Try Time::Local
: specifically the 'timelocal' function
interesting ...
: $sec=$min=$hour=0;
: $day=1;
: $month=2; #2=March
: $year=1999;
: $march1st=timelocal($sec,$min,$hour,$day,$month,$year);
: $april1st=timelocal($sec,$min,$hour,$day,$month+1,$year);
Is there an easy way of working this out though .. I don't want to hardcode
the date, and I want it to work all the time ... this code will start
breaking nastily in December ...
: $now=time;
: $equation=($now-$march1st)/($april1st-$march1st);
Tony
--
-----------------------------------------------------------------------------
Tony Bowden | tony@blackstar.co.uk http://www.blackstar.co.uk/
Black Star | The UK's Biggest Video & DVD store * Free Postage Worldwide
-----------------------------------------------------------------------------
------------------------------
Date: 25 Mar 1999 19:19:23 GMT
From: Tony Bowden <tony@blackstar.co.uk>
Subject: Re: Date/Time calculation: % through current month?
Message-Id: <922389546.536826@news.tibus.net>
David L. Cassell <cassell@mail.cor.epa.gov> wrote:
: This was answered yesterday, with a very nice piece of code. I'm going to
: assume this re-post a day later is a glitch with your news software, and
: that you have already checked that thread for the answer. If not, here's
: a hint: localtime in scalar context returns all the info you need.
My newsreader reported that the first post didn't go through, so I posted again
from a different machine! It them seems both did go through ...
However, I'm unsure if you're referring to the article I replied to, which
suggested using Time::Local, but only dealt with half the question (I still
need the best way to get the start and end of the month ...)
Tony
--
-----------------------------------------------------------------------------
Tony Bowden | tony@blackstar.co.uk http://www.blackstar.co.uk/
Black Star | The UK's Biggest Video & DVD store * Free Postage Worldwide
-----------------------------------------------------------------------------
------------------------------
Date: Thu, 25 Mar 1999 13:19:12 -0500
From: Jane Dudley <jdudley@inna.net>
Subject: don't understand ||= operator
Message-Id: <Pine.BSF.3.96.990325130952.11408A-100000@butterfly.inna.net>
Hello, all.
I am trying to understand a script fragment I found, that has an ||=
expression. I looked at
http://www.effectiveperl.com/recipes/searching.html and
http://www.codebits.com/p5be/ch04.cfm, which have brief explanations, but
I'm afraid I don't understand them. I think I don't understand the
difference between |, which is "bitwise" and || which is "logical."
(Hey, I'm a mechanical engineer. Either there IS water flowing in that
pipe OR there isn't. There ain't no logical or bitwise flow about it).
Can someone make up a simple example to illustrate the difference?
Jane
------------------------------
Date: Thu, 25 Mar 1999 10:49:20 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: don't understand ||= operator
Message-Id: <MPG.1164250d717e5f1d9896f1@206.184.139.132>
In article <Pine.BSF.3.96.990325130952.11408A-100000@butterfly.inna.net>,
jdudley@inna.net says...
> Hello, all.
>
> I am trying to understand a script fragment I found, that has an ||=
> expression.
> (Hey, I'm a mechanical engineer. Either there IS water flowing in that
> pipe OR there isn't.
But what if you want to make sure there's water flowing if not already
flowing?
# Set $flow_level to 5gpm if not already set.
$flow_level ||= 5;
Or
$flow_level = 5 unless $flow_level;
Or
if (!$flow_level) { $flow_level = 5 } # yuck
Or
if ($flow_level == 0) { $flow_level = 5 } # yuck
I find that it is useful when running under -w so that I don't generate
undefined variable errors.
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Thu, 25 Mar 1999 11:25:23 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: don't understand ||= operator
Message-Id: <MPG.11642d7e33dc04199897c7@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <Pine.BSF.3.96.990325130952.11408A-100000@butterfly.inna.net>
on Thu, 25 Mar 1999 13:19:12 -0500, Jane Dudley <jdudley@inna.net>
says...
> I am trying to understand a script fragment I found, that has an ||=
> expression. I looked at
> http://www.effectiveperl.com/recipes/searching.html and
> http://www.codebits.com/p5be/ch04.cfm, which have brief explanations, but
> I'm afraid I don't understand them. I think I don't understand the
> difference between |, which is "bitwise" and || which is "logical."
...
> Can someone make up a simple example to illustrate the difference?
#!/usr/local/bin/perl -w
use strict;
my $a = 5;
my $b = 3;
$a ||= $b; # same as $a = $a || $b; (logical or)
print "$a\n"; # prints 5 (because 5 is 'true')
$a |= $b; # same as $a = $a | $b; (bitwise or)
print "$a\n"; # prints 7 (because all those bits are set)
$a = 0;
$a ||= $b; # same as $a = $a || $b; (logical or)
print "$a\n"; # prints 3 (because 0 is 'false')
$a = 0;
$a |= $b; # same as $a = $a | $b; (bitwise or)
print "$a\n"; # prints 3 (because all those bits are set)
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Mar 1999 19:33:44 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: don't understand ||= operator
Message-Id: <36fa8d14.2673613@news2.tmisnet.com>
Instead of "bitwise", think "mathmatics".
Here's a bitwise/mathmatic "or":
0110
0111
-------
0111
If either bit is set, then the corresponding answer bit is set.
Think of it as 0111 = 0110 | 0111
=============================================
Instead of "logical", think "philosophy"
Here's a logical/philosophic "or":
If you would like dessert, you must either (pick one or more)
a) eat your vegetables,
b) eat your salad, or
c) drink your milk.
Think of it as dessert = vegetables || salad || milk
dessert will occur if any one (or more) of the conditions occur.
Wrapup:
A single | (bitwise) gives you a binary/numeric answer.
A double || (logical) gives you a true/false answer.
It's two completely different fuctions using the same
name ("or"). Using the same symbol ("|") in two different
ways therefore makes sense from a programming
standpoint.
Hope this helps.
-- George Crissman
-- strads@tmisnet.com
On Thu, 25 Mar 1999 13:19:12 -0500, Jane Dudley <jdudley@inna.net>
wrote:
>Hello, all.
>
>I am trying to understand a script fragment I found, that has an ||=
>expression. I looked at
>http://www.effectiveperl.com/recipes/searching.html and
>http://www.codebits.com/p5be/ch04.cfm, which have brief explanations, but
>I'm afraid I don't understand them. I think I don't understand the
>difference between |, which is "bitwise" and || which is "logical."
>(Hey, I'm a mechanical engineer. Either there IS water flowing in that
>pipe OR there isn't. There ain't no logical or bitwise flow about it).
> Can someone make up a simple example to illustrate the difference?
>
>Jane
>
>
>
-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the (relatively small) 10,000 member
DEAA. What does he mean by "other ways already working"?
Maybe: <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------
------------------------------
Date: Thu, 25 Mar 1999 17:53:18 GMT
From: mnanao@sbl.salk.edu
Subject: FFT/FT in perl?
Message-Id: <7ddt69$qcs$1@nnrp1.dejanews.com>
Does anyone have any routines for calculating FFTs or FTs
in perl? I'm sure there is a way to embed a C/C++ FFT into
perl, but I'm looking for actual perl code, if possible. TIA,
max
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 25 Mar 1999 19:03:08 GMT
From: Ed Prochak <prochak@my-dejanews.com>
To: "Nathan" <penner@jps.net>
Subject: Re: How to make my database?
Message-Id: <7de194$ua9$1@nnrp1.dejanews.com>
In article <36f9f08e.0@news1.jps.net>,
"Nathan" <NOSPAMpenner@jps.net> wrote:
> Hello,
>
> I am going to be making a database in perl. The database will be a list of
> links, and each site will have maybe about 15 fields providing information.
> The total length of the info for each site would be at most 1200 characters
> (rough estimate). I will have about 200 sites indexed. Anyway, I was
> wondering what the best way to store this information would be. Would using
> a simple text file with field separators be too slow for the information
> (site name|creator|URL|etc.|etc.)? I would need the ability to search and
> sort by each category. If this would be too slow, would I be better off
> using a hash of arrays or has of hashes? I would need to store the
> information in a file (of course :-) ). My problem with this is that I am
> not confident enought to install and use MLDBM :-). Also, is it possible to
> install MLDBM in my account's space?
>
> Thank you for your help. I would appreciate if you also reply by e-mail to
> NOSPAMpenner@jps.net (remove the NOSPAM)
>
> -Nathan
>
>
If the data is really that small (~200 records at 1200 characters is less than
a quarter megabyte), then just read in the file to an array. Do your searches
and updates on the array. Write it out when you are done.
PERL is very good at handling arrays like this.
Ed Prochak
Magic Interface, Ltd.
ORACLE services
440-498-3702
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 25 Mar 1999 18:35:17 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: How to take advantage of Win9X printer drivers.
Message-Id: <slrn7fl048.7b6.dragons@scescape.net>
Wed, 24 Mar 1999 13:10:46 +0100 -- J|rgen Ibelgaufts <ibelgaufts@gfc-net.de>:
-> As wordpad forks itself off, your command line or perl program will be released
-> immediately and there is no conveniant way to find out when wordpad has finished
-> printing, so you can't find out when to delete it.
FWIW, look into the /w switch to the 'start' program.
-> Hoe this helps
Hope this helps!
-> Juergen Ibelgaufts
--Matthew
------------------------------
Date: Thu, 25 Mar 1999 13:57:10 -0500
From: James Tolley <jamesht@idt.net>
To: steven <abc12@hotmail.com>
Subject: Re: HTML LINK verifier ?
Message-Id: <36FA8706.D8B632D3@idt.net>
http://www.webtechniques.com/cgi-bin/listings/1999/03/perl.lst
steven wrote:
> Can you let me know the best HTML LINK verifier u have used or
> installed ?
>
> Also, where can I get it?
> thanks,
> Steven/-
------------------------------
Date: Thu, 25 Mar 1999 10:36:00 -0800
From: Richard Marciano <marciano@sdsc.edu>
Subject: HTML Parse Tree Tools in Perl
Message-Id: <36FA8210.F2619B01@sdsc.edu>
I'm new to this list and have been poking around for decent HTML Parse
tree building tools in Perl.
I have seen the HTML::Parser stuff. Are there some better
implementation out there I could look at?
Thank you,
-Richard
marciano@sdsc .edu
------------------------------
Date: Thu, 25 Mar 1999 14:01:34 -0500
From: James Tolley <jamesht@idt.net>
To: Richard Marciano <marciano@sdsc.edu>
Subject: Re: HTML Parse Tree Tools in Perl
Message-Id: <36FA880D.169ABAD7@idt.net>
HTML::Filter
HTML::TokeParser
HTML::TreeBuilder
HTML::Element
...
Take your pic. It all depends what you want to do...
James
Richard Marciano wrote:
> I'm new to this list and have been poking around for decent HTML Parse
> tree building tools in Perl.
> I have seen the HTML::Parser stuff. Are there some better
> implementation out there I could look at?
>
> Thank you,
>
> -Richard
> marciano@sdsc .edu
------------------------------
Date: Thu, 25 Mar 1999 08:06:55 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: index contents of text files to corresponding html files
Message-Id: <fdcdd7.dl4.ln@magna.metronet.com>
Sheila Eugenio (seugenio@man.amis.com) wrote:
: I apologize for the long posting. I am having trouble with this code. What
Please limit your line lengths to the customary 70-72 characters,
else it gets hard to read after being quoted a few times.
: I want to do is index from the contents of text files in a directory to
: corresponding HTML files in another directory. So if I have back.txt, all
: of its contents will appear in back.htm.
: I am encountering the ff problems:
: 1. The contents of the previous files are indexed to the succeeding files
: so that the last file, toas.txt, has the largest size!
I dunno about that problem. Sorry.
: 2. I cannot change the HTML filename so that it will trim the .txt ending,
: like so, back.txt.htm instead of back.htm.
I answer that one below.
: I have tried using chomp but to
: no avail.
Because chomp() removes line ending sequences (usually \n),
you want to remove other characters. Wrong tool for the job.
: Forgive me, I am just starting with Perl. Thank you for all your help!
OK then, here are some things that I have seen Experts here
point out to new folks to help them get started.
1) always enable warnings with the -w switch (see perlrun.pod)
or platform-specific docs if not on Unix.
2) you should use the "use strict;" pragma (compiler directive)
and declare all of your variables (nearly always with my(),
eg: my $var; ) when you first use them.
Those two alone will catch over half of the errors that you will
make in your first few weeks/months of using Perl!
All the Experts use both of them for all of their production code.
If _they_ want help catching their mistakes, then certainly
someone who is new to Perl should want the help too...
Learning how to write programs that remain silent with those
two features enabled takes some effort
But it will be *MUCH* less effort than spending hours
debugging a thousand line program only to discover that
the problem was you typed "$line" when you should have
typed "$lines".
That mistake would have been pointed out in *milliseconds*,
if you had asked perl to point it out to you (by doing 1 & 2 above).
3) The very first place you should always look when having
a Perl problem, is in the the standard docs that are
included when perl is distributed.
There are about 50 individual files, which can be
pretty daunting.
You can get a list (about 50 lines) of just the titles of each
file with a Perl one-liner (if you can find the POD format
files on your system):
perl -ne 'print if m/^=head2 perl/' /usr/lib/perl5/pod/perltoc.pod
The most important ones (in addition to the 9 FAQ files) are:
=head2 perlfunc - Perl builtin functions
=head2 perlop - Perl operators and precedence
=head2 perlre - Perl regular expressions
Those 12 files should be considered "required reading" if
you value your time. (you don't really _read_ all of each
of them, but at least look enough to know where to look
when you hit a question).
To get to a second echelon in the path to Perl enlightenment,
you might then turn to:
=head2 perldata - Perl data types
=head2 perlsyn - Perl syntax
=head2 perlrun - how to execute the Perl interpreter
=head2 perldiag - various Perl diagnostics
=head2 perlvar - Perl predefined variables
=head2 perlsub - Perl subroutines
Nearly all of the others (hope I didn't miss any of the rudimentary
ones) are Advanced topics that you can leave until later.
4) Do a word search in an archive of the newsgroup, such as:
http://www.dejanews.com
5) Post a question to the newsgroup
You should be able to get the answers to a whole boatload of
common questions before ever getting to step 5).
: *********************************
: $html_dir = 'F:/actl/html';
: $date = localtime(time);
: opendir (DIR, "E:/inet/actlspec") or die "Cannot open directory: $!\n";
: @filenames = sort readdir(DIR);
Since you are done with DIR here, it is "best" if you go ahead
and close() it now. Perl will do this for you when the program
finishes, but I think it is safer to release it as soon as
you no longer need it.
closedir(DIR);
: foreach $file (@filenames)
: {
:
: if ($file
: =~/(^assy|back|fras|frnt|mbxs|mdbkd|mdbkw|pdie|slow|sort|toas)\.txt/i)
: ##### files ending in .txt
^^^^^^^^^
If you want that to be true, then you need to anchor your regex
to the end of the string:
/... \.txt$/i
^
^ match when at end of string (kinda)
: if (($line =~/^Q-/) || ($line=~/^T-/) || ($line =~/^S-/) || ($line
: =~/^V-/))
That would be much more clear if you wrote the above line like this:
if ($line =~/^[QTSV]-/)
: {
: $stage = substr($line, 0, 10);
: $partid = substr($line, 11, 16);
: $lotid = substr($line, 28, 12);
: $lotstate = substr($line, 41, 6);
: $location = substr($line, 48, 10);
: $curmainq = substr($line, 78, 6);
: $cursubq = substr($line, 86, 6);
: $curmainm = substr($line, 93, 2);
: $cursubm = substr($line, 96, 2);
: $age = substr($line,100, 6);
: $stagetime= substr($line,107, 9);
Probably should be using unpack() there.
Have a look at it in perlfunc.pod.
: if ($cursubm == "{O") {$cursubm =~tr/\{O/ /;}
I don't think tr/// works like you think it does.
It replaces *every* zero or curly bracket with a space,
without regard to whether they are next to each other or not.
I think you can replace that line with:
$cursubm =~ s/{O/ /; # replace two chars with one space char
: @part1 = ($stage,$partid,$lotid,$lotstate,$location,$curmainq,
: $curmainm, $cursubq, $cursubm, $age,$stagetime);
:
: $part1 = join(" ",@part1);
You don't need to put it into the temp @part1 array, you can
supply the list directly to join():
$part1 = join(' ', $stage,$partid,$lotid, ... );
: $actl{$inv} = $part1 . "\n";
:
: open (HTML, ">$html_dir/$file.htm");
# change filename extension for output to '.htm'
$outfile = $file; # copy it
$outfile =~ s/\.txt$/.htm/; # change the extension
open (HTML, ">$html_dir/$outfile.htm") || die "...";
[ snip HTML output ]
: closedir (DIR);
_There_ it is! A bazillion lines away from where you were done
with it :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 25 Mar 1999 18:13:23 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Input Password
Message-Id: <7dduc3$b7k$1@info2.uah.edu>
In article <7ddshe$596$2@gemini.ntu.edu.tw>,
Huang Lee <hlee@ccserv2.ee.ntu.edu.tw> writes:
: My problem is that the program need users to input password,
: but when users input password,I can not "hide" the password for users.
: Users can see their own password when they key-in password.
If you're using the Telnet protocol, you (the server) can tell the
client that you'll worry about echoing characters. Assuming that the
client agrees, you simply refrain from echoing characters to the client
while receiving a password.
Have a look at RFC 857. You might also find the Net::Telnet module
useful in handling Telnet option negotiation.
Greg
--
There's a lovely paper which compares Unix to Zork in both cognitive and user
motivational terms. Maybe you like Unix because it's an adventure game?
Still, I just don't think Unix will succeed as a theme park (some small
fraction of :-) -- Bruce Cohen
------------------------------
Date: Thu, 25 Mar 1999 14:46:01 -0500
From: Hank <htaylor@mit.edu>
Subject: insert html links in big list of equations
Message-Id: <36FA9279.5505A207@mit.edu>
i have a big list of equations (>2k lines) from an economics model that
i would like to turn into a hyperlinked document for easy perusal. i
want to be able to click on a right hand side variable (a link) in an
equation and have the link move me to the variable's defining equation.
eg:
x = y + 2
so, click on y on this equation and you move to:
y = 9
the utility would go through and substitute hyperlinks for each instance
of every variable on the right hand side of every equation. variables
would be determined from the left hand side of each equation.
this seems like such a useful thing i wondered if anyone else had
already done it. imho this would be a neat utility for looking at code
for *some* programming projects too, perhaps even perl programming
projects (providing that some *smart* constraints could also be built
into the parser utility).
let me know... thanks,
hank
hanktaylor@mediaone.net
------------------------------
Date: Thu, 25 Mar 1999 19:29:09 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: need help getting started!
Message-Id: <36fa8c58.2485673@news2.tmisnet.com>
Are you calling the perl script from a "submit" button
located inside a form? Or are you calling it some
other way? (I would think something along the lines of
<A HREF="http://www.isp.com/~myacct/program.cgi">
would be expected to show the contents of a text file
instead of executing it).
-- George Crissman
-- strads@tmisnet.com
On Thu, 25 Mar 1999 12:19:57 -0500, sheela tiwary
<stiwar1@gl.umbc.edu> wrote:
>Hi,
>
>I have a simple perl script that works fine when I run it in the UNIX
>environment. However it won't run on the web-page, the web page just
>displays the contents of the file instead of the results.
>
>I would appreciate any suggestions on how to fix this problem.
>
>Sheela
>
-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the (relatively small) 10,000 member
DEAA. What does he mean by "other ways already working"?
Maybe: <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------
------------------------------
Date: Thu, 25 Mar 1999 13:00:41 -0500
From: Gift Registry <webmaster@giftregistry.hypermart.net>
Subject: Need tips on improving performance.
Message-Id: <36FA79C8.90337C55@giftregistry.hypermart.net>
Is there any good set of guidelines for tweaking better performance from
Perl, besides the section in Wall's, "Programming Perl"?
I currently have a large script, about 100k, which runs a site. I
suspect that I can improve performance substantially by splitting this
script up into smaller, logically related pieces. Is this true?
If I break up large scripts into a series of smaller scripts which are
conditionally pulled in during runtime with a conditional REQUIRE, will
performance likely improve?
In other scripted languages, there is a CALL or PLAY verb, which loads
the next requested script. Is there anything equivalent in PERL?
Thanks,
Emmett McGuire
------------------------------
Date: Thu, 25 Mar 1999 18:31:59 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: New Bee Alert
Message-Id: <36fc80f6.853259@news.skynet.be>
Ala Qumsieh wrote:
>or maybe:
>
> elsif (/\S/) { print "<br>" }
Reverse that.
elsif(!/\S/) { print "<br>" }
Bart.
------------------------------
Date: 25 Mar 1999 19:02:10 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Odd/Even
Message-Id: <7de17i$7f7$1@pegasus.csx.cam.ac.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>
>I think that 32-bit twos-complement binary representation is so
>ingrained in Perl that the compiler would have to simulate that
>representation on any hardware, no matter what the native machine
>representation of an integer might be.
The twos complement binary representation is mandated by the underlying
C, and in particular by the C operators & | and ~.
But Perl isn't necessarily 32 bit. There exist 64 bit implementations.
Mike Guy
------------------------------
Date: Thu, 25 Mar 1999 19:29:01 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: Perl Composer Needed
Message-Id: <36fa8a21.1918974@news2.tmisnet.com>
I believe that's discussed in the first chapter of
"Learning Perl" published by O'Reilly & Associates.
An excellent work, worth the money. And an
excellent place to start.
-- George Crissman
-- strads@tmisnet.com
On Wed, 24 Mar 1999 08:15:07 -0500, "SPH"
<heebe@nospamthanks.hotmail.com> wrote:
>Hey all,
>
>I am getting into Perl developing and need a composer/compiler for Perl (and
>CGI). I use a Win 98 desktop, and would like to load a program with an easy
>interface. Any recommendations?
>
>Thanks
>
>
-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the (relatively small) 10,000 member
DEAA. What does he mean by "other ways already working"?
Maybe: <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------
------------------------------
Date: Thu, 25 Mar 1999 18:54:14 GMT
From: Ed Prochak <prochak@my-dejanews.com>
To: john_warner@tivoli.com
Subject: Re: Perl, Oracle, and SQL
Message-Id: <7de0oi$tol$1@nnrp1.dejanews.com>
In article <36F95382.2345F36C@tivoli.com>,
john_warner@tivoli.com wrote:
> I'm trying to write a Perl script to query an Oracle db. The Perl
> portion works fine but I seem to be having a problem with performing
> substring searches in SQL. (I know, I know it's a little off topic but
> please bear with me.) The SQL string Perl is building is:
>
> SELECT SOLUTION_ID,SOLUTION,DESCRIPTION FROM EXAV.SOLUTIONS WHERE
> DESCRIPTION = some_portion_of_text;
>
> _The SQL Guide to Oracle_ hasn't been much help in how I should be going
> about searching for, say *FAQ*. Where are there any decent on-line
> references for SQL that can help me?
>
> --
>
> John Warner Tivoli Systems Inc.
> Sales Support Engineer 9442 Capital Of Texas Hwy North
> Sales Infrastructure Group Austin, TX 78759
> john_warner@tivoli.com
>
>
Oracle SQL has limited pattern matching features. The underline (_) character
matches any single character and the percent (%) character matches zero or
more characters. TO use pattern matching, you MUST use the LIKE operator.
So for example
SELECT SOLUTION_ID,SOLUTION,DESCRIPTION FROM EXAV.SOLUTIONS WHERE
SOLUTION = 'H2%' ;
finds all rows with a value in the solution column of literally 'H2%'
while
SELECT SOLUTION_ID,SOLUTION,DESCRIPTION FROM EXAV.SOLUTIONS WHERE
SOLUTION = 'H2%' ;
finds all rows with values in the solution column that begin with 'H2'.
So the second example will match solutions
H2O
H2CO3
H2SO4
H2
as well as others.
I've cross posted to one of the Oracle newsgroups. (hope I typed the group
name right) There's lots of helpful folks over there, just as there are
in the perl group.
Hope this helps.
Ed Prochak
Magic Interface, Ltd.
ORACLE services
440-498-3702
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 5226
**************************************