[7938] in Perl-Users-Digest
Perl-Users Digest, Issue: 1563 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 1 16:07:36 1998
Date: Thu, 1 Jan 98 13:00:23 -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, 1 Jan 1998 Volume: 8 Number: 1563
Today's topics:
Re: 'flock'ing <doug@tc.net>
Avoiding regular expressions (was: Re: Newbie question) <rootbeer@teleport.com>
Re: Excel->perl functions? <rootbeer@teleport.com>
Re: Going multiple directions from a list of checkboxes <rootbeer@teleport.com>
Re: help compiling dynamic perl5_04 on hpux (Bob Goldstein)
Re: HELP! Newbie needs advice on h2ph and SysV IPC <rootbeer@teleport.com>
Re: How do I exit <rootbeer@teleport.com>
Re: Mysterious FileHandle + fork() behavior; possible P <rootbeer@teleport.com>
Re: newbie: what am i doing wrong? (John Moreno)
Re: Perl compiler (Mark A. Stanfill)
Perl not Y2K compliant (John Nagle)
Re: Perl not Y2K compliant <ebohlman@netcom.com>
Re: Perl not Y2K compliant (brian d foy)
Re: reading in passwords (Tad McClellan)
Re: Search and replace questions (Pete Holsberg)
Re: Simple(!) regular expression problem <rootbeer@teleport.com>
Re: Sorting Data File (Laurel Shimer)
Re: SQL Error??? (Emmanuel Bataille)
SSL server in Perl (Huu Da Tran)
Re: undefined value snailgem@aol.com
warning: setting locale failed (??) (5.004_04) <wardk@halcyon.com>
Re: Win95 Perl <eddie@NOSPAMMING.cs.odu.edu>
Re: Win95 Perl <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 01 Jan 1998 12:34:27 -0500
From: Douglas McNaught <doug@tc.net>
Subject: Re: 'flock'ing
Message-Id: <m2g1n8m730.fsf@ono.tc.net>
? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> writes:
> In <34AA9E46.54421165@mystech.com> "Mark S. Reibert" <reibert@mystech.com> writes:
>
> [...]
>
> >Network File System - remote mounted from another machine. Maybe the network
> >traffic causes a problem with the flock(). Better yet, maybe flock() can't
> >handle NFS because the file system may have different characteristics on the
> >remote machine. [I don't know - I'm reaching here! :-)]
>
> NFS can't handel locking as locking was not inclued in the NFS model. As
> NFS was created as a stateless it is difficalt to alter the model so that
> it would have one.
>
> I don't know if this has been sovled by anyone, normaly work arounnds are
> used.
It's been solved for a long time, on almost every Unix variant. The
solution is called lockd. For a long time it was a crapshoot trying
to get lockd's on different Unix flavors to work together, but these
days it's somewhat better. One thing to make sure of is that Perl is
using the right underlying locking calls--there have been systems
(older Irices among others) where flock() didn't work across NFS but
lockf()/fcntl() locking did.
-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";
------------------------------
Date: Thu, 1 Jan 1998 12:14:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joseph Cotton <jcotton@erols.com>
Subject: Avoiding regular expressions (was: Re: Newbie question)
Message-Id: <Pine.GSO.3.96.980101120721.19455I-100000@user2.teleport.com>
On Wed, 31 Dec 1997, Joseph Cotton wrote:
> I'm new to perl, too, and I retch at the sight of such code. Can any
> one of you nice perl nerds create a series of functions to format
> strings and numbers, so I can format things like I am able to in some
> more civilized languages, that is, with out the use of a tilde and
> slashes =~s/u/c/k/s; I am not judgemental, this is just my own humble
> opinion. I believe in "each to his own", and I could be much more
> productive without tildes.
When I teach my classes about Perl, I always explain that hashes and
regular expressions are fundamentally important parts of Perl. If you're
not using both of those in virtually every page of every program you
write, you're not really "thinking in Perl".
Sure, you can (and often should) avoid using regular expressions for many
tasks. But they're often the best way to say exactly what you want to do.
(OTOH, have you tried index and substr? Those are more like what you may
be used to using in "some more civilized languages". :-)
Perl isn't the right language for everyone; maybe you should consider
learning another language that better suits the way you think.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 1 Jan 1998 11:52:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Thanh Luu <jeffrey@halcyon.com>
Subject: Re: Excel->perl functions?
Message-Id: <Pine.GSO.3.96.980101114807.19455F-100000@user2.teleport.com>
On 31 Dec 1997, Thanh Luu wrote:
> Is there a math library with the functions commonly used in spread
> sheets?
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
> Is there a perl subroutine that averages space seperated numbers
> on the command line?
Although you could make one, it would be more generally useful if it
took its parameters like any standard Perl subroutine. Maybe like this.
sub average (@) {
return 0 unless @_;
my $tot;
for (@_) { $tot+=$_ }
return $tot/@_;
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 1 Jan 1998 11:13:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Keith Sullivan <sull@au13.ecn.purdue.edu>
Subject: Re: Going multiple directions from a list of checkboxes
Message-Id: <Pine.GSO.3.96.980101111131.19455D-100000@user2.teleport.com>
On 31 Dec 1997, Keith Sullivan wrote:
> I need to go one way if a box is checked, then return and check if any
> other boxes were checked, and then go in a different direction. Where I
> am lost is how to go in the second direction.
How about something like this, with a series of if-tests?
&deal_with_first_box if is_checked(1);
&deal_with_second_box if is_checked(2);
&deal_with_third_box if is_checked(3);
Is that all you need? Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 1 Jan 1998 18:20:53 GMT
From: bobg@uic.edu (Bob Goldstein)
Subject: Re: help compiling dynamic perl5_04 on hpux
Message-Id: <68gmq5$2kj4$2@piglet.cc.uic.edu>
Michael P Chandler (mpchandler@mema.mail.fedex.com) wrote:
: I get this error message when trying to 'sh Configure'.....even
: if I try to bypass with a -DCC=gcc (version 2.7.3)
: I need to know if there is a patch for cc that I need or an
: option that I'm not stating.....for the reasons below....
: >[from 'sh Configure']
: >
: >The bundled C compiler can not produce shared libraries, so you will
: >not be able to use dynamic loading.
: >
You may need to purchase the ANSI C compiler from HP. The bundled
compiler is not full-featured :-)
bobg
------------------------------
Date: Thu, 1 Jan 1998 12:49:59 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Timothy E. Morgan" <tem@energid.demon.co.uk>
Subject: Re: HELP! Newbie needs advice on h2ph and SysV IPC
Message-Id: <Pine.GSO.3.96.980101123011.19455L-100000@user2.teleport.com>
On Thu, 1 Jan 1998, Timothy E. Morgan wrote:
> Subject: HELP! Newbie needs advice on h2ph and SysV IPC
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> The problem is that when I try to use IPC_PRIVATE in msgget, the
> following happens:
> - when I try to use &IPC_PRIVATE, it gets read as a subroutine;
> - when I try $IPC_PRIVATE, it gets treated as a variable (which I
> expected, but I wanted to try all possibilities);
> - and plain old IPC_PRIVATE is expected to be numeric.
Well, IPC_PRIVATE _is_ a subroutine, one which returns a numeric value.
But maybe h2ph didn't get the correct value. Does your ipc.ph give
something different than ipc.h does? Also, does the IPC::SysV module from
CPAN do anything good for you? Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 1 Jan 1998 12:28:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Aamer Nazir <nazira@cadvision.com>
Subject: Re: How do I exit
Message-Id: <Pine.GSO.3.96.980101122419.19455K-100000@user2.teleport.com>
On 1 Jan 1998, Aamer Nazir wrote:
> I am a beginner in perl.I am using perl 5 on windows 95 based system.How
> do I quit after I have written the program or script I want after typing
> perl.
I usually stand up, walk to the refrigerator, and see what's for lunch.
:-)
But it sounds as if you want something different, although I'm not sure
what it is.
If you are typing your code directly into Perl (rather than, say, running
it from a file) you'll want to send the end-of-file signal for your
machine. That's usually control-Z for DOS/Windows machines and control-D
on Unix.
If you're wanting Perl to finish running, maybe you want the exit()
function, documented in the perlfunc manpage.
If you're wanting to mark the end of your code in a text file, you may
want the __END__ token.
If you're trying to save your work and exit your text editor, you'll need
to check its documentation.
If you're having some other Perl problem which isn't covered in the docs,
please post again. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 1 Jan 1998 11:44:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Allen Chen <achen@nssdc.gsfc.nasa.gov>
Subject: Re: Mysterious FileHandle + fork() behavior; possible Perl bug?
Message-Id: <Pine.GSO.3.96.980101111353.19455E-100000@user2.teleport.com>
On Wed, 31 Dec 1997, Allen Chen wrote:
> What exactly happens when you run your code?
When I try it, I see the parent process continuing to the end of the file,
then silently looping back and re-reading the whole file. That's not
right, of course, but I'm not sure whether the fault is Perl's, the
program's, or my system's. (For the benefit of people who want to try this
on their own machines, I'm appending a different version of my test code
after this message. When I run it, it dies with the message 'Saw #! line
in wrong place at tempo line 14, <FILE> chunk 22.' Can anyone explain its
behavior?)
> It doesn't always work when I run it. It's probably because the parent
> finishes up before the child has a chance to seek back to the beginning.
> A sleep() in the parent would probably do the trick.
Well, that doesn't hurt anything when I add it. The bug still shows, for
whatever reason.
> open (LIST, "<$ARGV[0]"); # open the specified file
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
(Of course, that's not the problem in this case.)
As I said above, I'm including my test code again in the hopes that
someone else will be able to shed some light upon this problem. My best
guess is that the input buffer is somehow being confused when the child
seeks back, even though that shouldn't happen from what I know. Shows how
little I know, doesn't it? :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
#!/usr/bin/perl -w
use strict;
my $filename = $0;
open FILE, "<$filename" or die "Can't open file '$filename': $!";
die "Can't read one line" unless defined($_=<FILE>);
my $pid; die "Can't fork: $!" if not defined($pid = fork);
if ($pid) {
# parent process here
sleep 2; # Allow slow forkers to catch up
while (<FILE>) {
die "Saw #! line in wrong place" if /^#!/ and $. > 1;
}
} else {
# child process here
seek FILE, 0, 0 or warn "Can't seek: $!";
}
__END__
------------------------------
Date: Thu, 1 Jan 1998 14:48:42 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: newbie: what am i doing wrong?
Message-Id: <1d26lvp.12ammc213072qhN@roxboro-176.interpath.net>
jay <mocat@NOSPAM.best.com> wrote:
> I'm bored at work, so I'm working on a random password geneator.
> I have lots of ideas for it, but I can't implement those until I get
> this problem worked out. I see no problem in my code, but then again,
> I don't have a lot of experience with PERL. If you can tell me what I
> am doing wrong, it'd be much appreciated. Thx.
>
> What it does is continuously loops, and it doesnt give me a variable
> for $nextchar... *shrug*
You have two problems - the if statement should be == not =
The assignement to $nextchar requires TWO $$
> #!/usr/bin/perl
> srand; $stat = 0;
> @caplet = qw(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z);
> @lowlet = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z);
> @numbers = qw(1 2 3 4 5 6 7 8 9 0);
> @arrays = qw(caplet lowlet numbers);
> while ($stat < 8) {
> $nextarr = $arrays[rand(@arrays)];
> $nextchar = $nextarr[rand(@$nextarr)];
> if ($stat = 0) {
> print "new password: $nextchar";
> $stat++;
> } else {
> print $nextchar;
> $stat++;
> }
> }
>
> jay... feeling stupid
--
John Moreno
------------------------------
Date: Thu, 01 Jan 1998 19:04:19 GMT
From: mstan@flash.SPAAM.net (Mark A. Stanfill)
Subject: Re: Perl compiler
Message-Id: <34ace004.59828224@209.30.0.7>
There are some cludges that still need to be worked out in this
program, but I do find it valuable in distributing sources. One
of the things to realize about this program is that it uses a
modified version of Dynaloader. If you want to compile in extra
packages, I find that the following solution works nicely for me
(YMMV):
1. make sure that perl2exe.exe and the modified Dynaloader.pm
are in the same directory as perl.exe (has to be build 313)
2. ensure that your path includes the perl\bin directory for 313
only
3. You MUST include any additional packages that are called by
the packages in your script. eg:
use DynaLoader;
use Exporter;
use Carp;
use Net::Ping
4. Now, here's the part that caused me a few more grey
hairs---if you are using packages, explicitly include the
modified Dynaloader in your path.
'perl2exe foo.pl \perl313\bin\dynaloader.pm'
I've had very good luck compiling scripts in this manner.
Perl2exe lack some features (every executable will be >500k,
these programs will be easy to disassemble, etc), but I feel that
it is a more than adequate work-around for the time being.
Apparently, the Win32 Perl Resource kit will include a 'perl
compiler'. Does anybody have any information about this?
On Wed, 31 Dec 1997 17:16:57 GMT, rurban@xarch.tu-graz.ac.at
(Reini Urban) wrote:
<snip>
>Errors:
>if you include packages like for example
>package Net::Ping;
>
>then perl looks for a directory called Net but this is not
created in
>the packaging step. so you have to manually change all packages
to
>something like
>package Net_ping;
>
>rename Net\ping.pm to net_ping.pm
>and package this.
>So you may say that packages are NOT supported.
>
>Some troubles for professionals who want to hide their perl
code:
>1) The complete source code is in the exe, neither encrypted nor
>compressed.
>2) If you press <Pause> during the script evaluation, the whole
stuff is
>visible at %temp%
>
>so there you have your source code if you need it.
------------------------------
Date: Thu, 1 Jan 1998 18:20:40 GMT
From: nagle@netcom.com (John Nagle)
Subject: Perl not Y2K compliant
Message-Id: <nagleEM4AyG.LzG@netcom.com>
"gmtime" returns a two-digit year. Bad. It's 1998 already.
John Nagle
------------------------------
Date: Thu, 1 Jan 1998 18:49:40 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl not Y2K compliant
Message-Id: <ebohlmanEM4CAs.Dwv@netcom.com>
John Nagle <nagle@netcom.com> wrote:
: "gmtime" returns a two-digit year. Bad. It's 1998 already.
>From the listing for gmtime in the Camel, p.177:
"..., and the year has had 1900 subtracted from it."
Subtracting 1900 from a year is not the same thing as taking only the
last two digits of a year, is it?
------------------------------
Date: Thu, 01 Jan 1998 14:28:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl not Y2K compliant
Message-Id: <comdog-ya02408000R0101981428400001@news.panix.com>
Keywords: from just another new york perl hacker
In article <nagleEM4AyG.LzG@netcom.com>, nagle@netcom.com (John Nagle) wrote:
> "gmtime" returns a two-digit year. Bad. It's 1998 already.
gmtime returns two significant digits because that's all that is
left after 1900 is subtracted from years in the current millineum.
perhaps you neglected to read the documentation. or maybe you
are using Perl 4, which is long since dead.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 1 Jan 1998 09:50:40 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: reading in passwords
Message-Id: <g0eg86.i21.ln@localhost>
Devin P. Anderson (dev@sgi.net) wrote:
: How can you read from STDIN and not display what is being typed on the
: screen? Like a password. Is this possible though a socket?
Perl FAQ, part 8:
"How do I ask the user for a password?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 1 Jan 1998 15:12:13 -0500
From: pjh@mccc.edu (Pete Holsberg)
Subject: Re: Search and replace questions
Message-Id: <68gtat$lk@tecoma.mccc.edu>
Keywords: just another new york perl hacker
In article <68fcso$3g8@bgtnsc02.worldnet.att.net>,
brian d foy <comdog@computerdog.com> wrote:
=In article <68e9kc$g3o@tecoma.mccc.edu>, pjh@mccc.edu (Pete Holsberg) posted:
=
=
=> <FONT SIZE=+1><a
=> href="/cgi-bin/htgrep.cgi/isindex=AC106&file=/SCHED/spr/msched.html&style=pre">AC106</a>
=
=oy! such an ugly PATH_INFO. it looks like a query string
=without the ? at the beginning. perhaps you can post the
=bits of code which produce that and we can turn that /
=into a ?.
Begorrah, my friend -- htgrep.cgi likes that PATH_INFO
string just fine. :-)
In any case, I can't get the replacement to occur. Here's
my code:
#!/usr/local/bin/perl -w
# pjh 12/31/97
# This script looks for two patterns: SIZE=+1>, and a
# course name (eg, EG 101). It adds a string based on the
# course name and a CGI script between them.
#
# This was written to edit the files in /AA/fall or spring or summer.
print "What file do you want to edit? ";
$file = <STDIN>;
chop($file);
print $file,"\n";
open(IN, $file) || die "Couldn't open $file";
open(OUT, ">tmp") || die "Couldn't open tmp";
my $url1 = "<a href='/cgi-bin/htgrep.cgi/isindex=";
my $url2 = "&file=/SCHED/spr/msched.html&style=pre'>";
$i = 0;
while(<IN>)
{
if ($_ =~ /(SIZE\=\+1>)([A-Z]{2}) (\d{3})/)
{
# $1 is SIZE=+1>
# $2 is the two course letters
# $3 is the three course numbers
$search[$i] = "$1"."$2"." "."$3";
my $crsno = "$2" . "$3";
$repl[$i] = "$1" . "$url1" . "$crsno". "$url2" . "$2" . " " . "$3" . "<\/a>";
$i++;
}
}
$s_len=@search;
close(IN);
open(IN, $file) || die "Couldn't open $file";
while(<IN>)
{
print $_;
for ($i = 0; $i < $s_len; $i++)
{
print $search[$i],"\n";
if ($_ =~ /$search[$i]/)
{
s/$search[$i]/$repl[$i]/;
print $_;
$i++;
}
}
print OUT $_;
}
close(IN);
close(OUT);
#system("mv tmp $file");
=========================
And here's a sample data file:
<P><A NAME="P17_232"></A><B><FONT SIZE=+1>AC 106 Office
Accounting I (3)</FONT></B>
<P>Prerequisites: BA 103, MA 101 or equivalent proficiency
<P>Basic course for non-transfer students. Emphasizes the
techniques of double-entry bookkeeping. Introduces
computerized accounting through general ledger software. 3
lecture hours.
<p><A NAME="P60_674"></A><B><FONT SIZE=+1>AC 109 Food,
Beverage, and Labor Cost Control (3)</FONT></B>
<P>Prerequisites: AC 108 with a minimum C grade
<P>Principles and theories underlying cost control as it
applies to the hospitality industry. Computer programs are
an integral part of the instruction. 3 lecture hours.
<p><A NAME="P74_966"></A><B><FONT SIZE=+1>AC 111 Principles
of Financial Accounting (4)</FONT></B>
<P>Prerequisite: MA 030 or equivalent proficiency
<P>A study of the accounting cycle and how accounting data
impacts business decisions. Emphasizes the uses and users
(both internal and external) of financial data gathered
through accounting. 3 lecture/2 lab hours. Tuition plus $30
fee.
<p><A NAME="P112_1416"></A><B><FONT SIZE=+1>AC 112
Principles of Managerial Accounting (4)</FONT></B>
<P>Prerequisite: AC 111 with a minimum C grade
<P>A study of the uses of accounting information by
internal and external stakeholders: planning, recording,
communicating equity and debt financing decisions,
performance evaluation and cash flows. 3 lecture/2 lab
hours. Tuition plus $30 fee.
Thanks and Happy New Year.
Pete
------------------------------
Date: Thu, 1 Jan 1998 11:59:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Simple(!) regular expression problem
Message-Id: <Pine.GSO.3.96.980101115724.19455H-100000@user2.teleport.com>
On Thu, 1 Jan 1998, Eric Bohlman wrote:
> Dashes have a special meaning inside regular expressions.
Not really.
> That's what's causing your problem.
I don't think so.
> : if (/\b$reqinput\b/ =~ /\b$reqmatch\b/) {print "matched\n";}
> : else {print "no match\n";}
>
> This one is syntactic garbage,
No, it isn't. (Although it's not likely to be what anyone actually wants.)
> and perl should complain about it.
I'd say that you're right about that. Patches welcome! :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 1 Jan 1998 18:23:29 GMT
From: autopen@autopen.com (Laurel Shimer)
Subject: Re: Sorting Data File
Message-Id: <autopen-0101981024030001@dynamic57.pm03.mv.best.com>
You can use the Unix sort command.
sort junk.data > junkier.data
There are all kinds of ways that you can specify different special things
to happen in the sort. For more info look in a Unix manual or type
man sort
at your Unix command prompt.
Laurel
In article <34AB2DAC.1F4AB2FA@cybernex.net>, hudson@cybernex.net wrote:
> Hi, I have a data file that contains about 20k records (about 200bytes
> each) that I need sorted. Unfortunately,
> I don't have access to a sort utility on my platform, and I need the
> file sorted (daily) so that I can compare it to
> the previous day's file. Does anyone have a relatively efficient PERL
> algorithm that might help me order the
> file? Thanks in advance,
>
> Dunc.
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
Did you miss? The Pigeon, A St.John Bathshirker Mystery
http://www.autopen.com/pigeon.shtml
------------------------------
Date: Thu, 01 Jan 1998 16:56:14 GMT
From: ebat@micronet.fr (Emmanuel Bataille)
Subject: Re: SQL Error???
Message-Id: <34aaf23c.207414469@news.micronet.fr>
"S. Sarkar" <s027119@income.com.sg> icrivait :
>I am using the Minisoft Odbc for HP 3000 mini from within a Perl script.
>The following
>sql statement did not retrieve any records though there were records in the
>table satisfying the condition.
>
>select * from table where upper(name) like upper('mr lim%')
>
>Doesn't does the odbc support sql statements with certain clauses in it?
>If so, what is the replacement for the above stmnt? Please help ASAP.
Try to see what's going wrong after sql statement. I use this piece of
code :
use Win32::ODBC;
if (!($db = new Win32::ODBC($DSN))){
Win32::ODBC::Error();
exit();
}
$sql = "select * from table
where upper(name) like upper('mr lim%') ";
if ($db->Sql($sql)){ # dump error if sql fail.
$db->DumpError;
$db->Close();
exit;
}
Hope this help
------------------------------
Date: Thu, 01 Jan 1998 20:02:36 GMT
From: tranhu@jsp.umontreal.ca (Huu Da Tran)
Subject: SSL server in Perl
Message-Id: <slrn6antid.qr.tranhu@derby.jsp.umontreal.ca>
I've asked this question in comp.lang.perl.modules, but got no answer. So
I'm trying here...
I want to wirte a SSL server in Perl. We've installed both SSL-0.6.6 and
the Net_SSLeay.pm-0.04 perl module.
I somehow managed to produce a CERT file for my purpose. Here's a part of
my code:
print "Cli privie: '$conf{plain_rsa}'...\n";
Net::SSLeay::use_RSAPrivateKey_file($ssl, $conf{plain_rsa},
&Net::SSLeay::FILETYPE_PEM) or
die "use_RSAPrivateKey_file: $!\n";
print "Certificat: '$conf{plain_cert}'...\n";
Net::SSLeay::use_certificate_file($ssl, $conf{plain_cert},
&Net::SSLeay::FILETYPE_PEM) or
die "use_certificate_file: '$!' et (" .
&Net::SSLeay::ERR_get_error() . ")\n";
print "On est passi... Yeah!\n" if $debug;
$err = Net::SSLeay::accept($ssl);
print "Cipher '" . Net::SSLeay::get_cipher($ssl) . "'\n";
#
# Connexion itablie. Ichange de donnies.
#
It seems that everything went right until Net::SSLeay::accept($ssl);
it doesn't do the print statement.
I've been going crazy for this for almost 2 weeks (holiday weeks ;-)...
Can someone help me out with this.
PS: Yes, I've been looking and trying out the example provided in the
"perldoc" output without any luck (because of the certs in the first
place).
--
__________________________________________________________________________
TRAN, Huu Da Universiti de Montrial
tranhu@jsp.umontreal.ca http://www.jsp.umontreal.ca/~tranhu/
//////////////////////////////////////////////////////////////////////////
Pour se soustraire ` la fatigue de penser, beaucoup sont mjme disposis `
travailler. -- A. Marandotti
------------------------------
Date: Thu, 01 Jan 1998 12:23:42 -0500
From: snailgem@aol.com
Subject: Re: undefined value
Message-Id: <34ABD11C.51F3@aol.com>
Joseph N. Hall wrote:
>
> Works for me. Maybe $common_dir or $this_htm are undefined?
>
You mean you don't get the warning message? 'Cause as far as the file
being copied, it works for me too. . .
I tried to do this just with a simple script, without variables using
some files in my home directory:
#!/usr/local/bin/perl -w
use diagnostics;
use File::Copy;
chdir "/usr/home/snailgem";
copy ("guts.html", "guts2.html");
Again, the copy happens, but so does the message.
I also got one of Tom Phoenix's canned messages saying this is a bug in
the Copy module, and that I should fix it, etc. In the meantime, though,
I'm doing:
$cp_cmd = "cp '$from_file' '$to_file'";
system($cp_cmd);
$retval = $? >> 8;
if ($retval == 0) {print "Copy succeeded";}
else {print "Copy failed";}
Thanks.
Will
>
> snailgem@aol.com wrote:
> >
> > This is driving me crazy:
> >
> > #!/usr/local/bin/perl -w
> > use diagnostics;
> > use File::Copy;
> >
> > ##stuff initialized here
> >
> > $from_file = "$common_dir/$this_htm";
> > $to_file = "$common_dir/copy_$this_htm";
> >
> > copy ("$from_file", "$to_file");
> >
> > The only new file here is $to_file.[..]
------------------------------
Date: Thu, 01 Jan 1998 09:18:57 -0800
From: Ward Kaatz <wardk@halcyon.com>
Subject: warning: setting locale failed (??) (5.004_04)
Message-Id: <34ABD000.3263D450@halcyon.com>
I received this message during INSTALL and when I execute perl 5.004_04
Setting locale failed.
Please check that you locale settings :
LC_ALL=(unset),
LANG="us"
are supported and installed on your system.
Falling back to the standard locale <"C">.
I cannot find anything more than a single vague reference to locale (man
pages) .
I am using a full-blown OpenLinux 1.1 Base Install with perl 5.004_04
compiled over the base perl included in OpenLinux.
Thank you for any advice,
Ward Kaatz
------------------------------
Date: Thu, 01 Jan 1998 13:40:46 -0500
From: Eddie Brown <eddie@NOSPAMMING.cs.odu.edu>
Subject: Re: Win95 Perl
Message-Id: <34ABE32E.920B452@NOSPAMMING.cs.odu.edu>
I'm not running a web server locally on my PC. Do I have to??
Eddie
etta wrote:
> What webserver are you using?
>
> Eddie Brown <eddie@NOSPAMMING.cs.odu.edu> wrote in article
> <34AAF65B.D28129BC@NOSPAMMING.cs.odu.edu>...
> > I have a html file on my Windows 95 box that calls a perl program:
> >
> > <form action="test.cgi" method="get">
> >
> > When I use Netscape locally on my win95 box, netscape displays
> > the source instead of executing it. I made it so that .cgi files open
> > with
> > perl but then an externaal dos shell spawns from netscape and executes
> > it.
> >
> > ????
> >
> > I know that the top line of the program has to be changed from the unix
> > path to a win95 path :
> >
> > #!/usr/bin/perl
> >
> > but #!C:/bin/perl
> >
> > doesn't seem at all right.
> >
> > HELP!! :^)
> >
> > Thanks,
> > Eddie
> >
> >
------------------------------
Date: Thu, 1 Jan 1998 12:23:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: etta <etta@worldnet.att.net>
Subject: Re: Win95 Perl
Message-Id: <Pine.GSO.3.96.980101121547.19455J-100000@user2.teleport.com>
On 1 Jan 1998, etta wrote:
> What webserver are you using?
You know, paradoxically, this question is more informative than its
answer could be!
If the answer, "Webserver W", means that something is different than if it
were "Webserver X", we can conclude that the problem (whatever it is) is
not truly a Perl problem. Perl neither knows nor cares what webserver
you're using (or even, in fact, whether you're using a webserver at all).
Of course, a question about webservers which isn't answered in the docs
and FAQs is better asked in a newsgroup about webservers than one about
Perl. The people there will be able to give a better and more-complete
answer than we can here.
Cheers!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 1563
**************************************