[8804] in Perl-Users-Digest
Perl-Users Digest, Issue: 2421 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 26 14:14:31 1998
Date: Sun, 26 Apr 98 11:00:54 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 26 Apr 1998 Volume: 8 Number: 2421
Today's topics:
Re: == vs. eq (Stefaan A Eeckels)
Re: Appending Lines 1&2, 3&4, ETC., (Tad McClellan)
Re: Appending Lines 1&2, 3&4, ETC., <danboo@negia.net>
Re: Appending Lines 1&2, 3&4, ETC., (Andrew M. Langmead)
Re: books for learning perl (David Oswald)
Re: Changing @INC <grimes@msn.com>
Re: File matching, file handle and defined(<...>) probl (Tad McClellan)
Re: Free http perl cgi windows95 practice platform (Daniel)
Re: Hash ref slice syntax? (Kevin Reid)
Re: help...can't rcp a file to another machines <rootbeer@teleport.com>
How do I get perl5 working with TK widgets? <sunburst@nedernet.nl>
How do I get Perl5 working with TK widgets? <sunburst@nedernet.nl>
How strong is the perl crypt function ? (Michael Haertfelder)
Re: How strong is the perl crypt function ? <rjk@coos.dartmouth.edu>
Re: http Reg Exp <tchrist@mox.perl.com>
Re: http Reg Exp <rjk@coos.dartmouth.edu>
Re: http Reg Exp (Michael Fuhr)
Re: Implementing sh in perl <rootbeer@teleport.com>
Re: Multiple forms data collation <rootbeer@teleport.com>
Re: perl 5.004 is better than 5.004004 ?! (Mike Bristow)
Re: perl 5.004 is better than 5.004004 ?! <captain@pirate.de.nospam-delete-this>
Re: Perl Complier <rootbeer@teleport.com>
Perl experts!! help me!! (Tau Kim)
Re: Perl script as NT service? patrick.mannion@us.socgen.com
QRe: == vs. eq <palincss@tidalwave.net>
Re: Question on sorting (Andrew M. Langmead)
Re: Question on sorting <rootbeer@teleport.com>
Re: QUESTION: How do I print file contents to screen? <danboo@negia.net>
Re: Reg Exp problem <rootbeer@teleport.com>
Re: RFI: Counting repeated substrings within a string <rootbeer@teleport.com>
Re: RFI: Counting repeated substrings within a string dejanews@net-school.com
Re: RFI: Counting repeated substrings within a string dejanews@net-school.com
Re: Signatures (Kevin Reid)
Re: spoiled noobie (Kevin Reid)
Re: use IPC::Open2; works on command line, but not CGI <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Apr 1998 16:20:28 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: == vs. eq
Message-Id: <6hvmsc$4hd$1@justus.ecc.lu>
In article <6htn10$pu3$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> writes:
>
> The way of the post-docu-literate future. Lovely. Should have
> seen it coming:
>
> X-Newsreader: Microsoft Outlook Express 4.71.1712.3
> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Uh! Release 4, version 71, build 1712 - and we finally got it
to run after compiling it 3 times? Someone please clue me in
on MS' versioning method ;-)
--
Stefaan
--
PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
"Don't worry about people stealing your ideas. If your ideas
are any good, you'll have to ram them down people's throats."
-- Howard Aiken
------------------------------
Date: Sun, 26 Apr 1998 09:58:27 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Appending Lines 1&2, 3&4, ETC.,
Message-Id: <j2ivh6.0g4.ln@localhost>
Michael Gray (sysop@dsrt.com) wrote:
: I need to take
: lines one and two, three and four, etc,... and print line 1 and line 2,
: on one line, then line 3 and line 4 on the next line, up to "x" number
: of lines
-----------------------
#!/usr/bin/perl -w
while (<DATA>) {
chomp; # remove newline from first line
print; # print the first line
print scalar <DATA>; # print the second line
}
__DATA__
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
-----------------------
There better be an even number of lines in the file...
: Please reply via e-mail....... sysop@dsrt.com
^^^^^^^^^^^^^^^^
Nope.
If we do that, then nobody else gets the benefit of the answer.
Usenet is not a free consulting service.
We're here to help all of the Perl community, not individuals.
: Much thanks for your help!
: Mike, an ISP in New Mexico....sysop@dsrt.com
^^^^^^
Hmmm.
An ISP that doesn't know standard netiquette.
In the cut-throat market of Service Providers, that might be used
as a product differentiater (folks should choose a more clueful
provider).
You might should brush up a little on how Usenet works.
See news.announce.newusers (and subscribe ALL of your new users to it as well)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 26 Apr 1998 11:07:42 -0400
From: Dan Boorstein <danboo@negia.net>
To: sysop@dsrt.com
Subject: Re: Appending Lines 1&2, 3&4, ETC.,
Message-Id: <35434DBE.E8371031@negia.net>
Michael Gray wrote:
>
> HI,
>
> I'm using shell scripts, to manipulate the output of "radiusreport", and
> I'm pretty happy, so far. Except one "simple" task. I need to take
> lines one and two, three and four, etc,... and print line 1 and line 2,
> on one line, then line 3 and line 4 on the next line, up to "x" number
> of lines, depending on the number of active users. I tried "chop" and
> it works for the first USER, but doesn't for the rest. Is there a way
> to set ut an array delineated by skipping line numbers instead of
> fields?
if i'm understanding this correctly, you simply want to 'chomp' (safer
than 'chop') odd numbered lines. if so, do so:
while(<DATA>) {
$. % 2 && chomp; # '$.' is the current input line number
print;
}
__END__
potato
spam
monkey
fred
rutabaga
if you've already got your data in an array, you can do likewise, but
you'll want to 'chomp' non-odd indices instead:
@data = <DATA>;
for (0 .. $#data) {
$_ % 2 || chomp $data[$_];
}
print @data;
__END__
potato
spam
monkey
fred
rutabaga
hope this helps, and in the future you may want to post some code from
your attempts. it helps me (and the others) to better understand your
problem, and will likely lead to a more positive educational experience
for you.
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sun, 26 Apr 1998 16:35:19 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Appending Lines 1&2, 3&4, ETC.,
Message-Id: <Es14qw.EpI@world.std.com>
Michael Gray <sysop@dsrt.com> writes:
>I'm using shell scripts, to manipulate the output of "radiusreport", and
>I'm pretty happy, so far. Except one "simple" task. I need to take
>lines one and two, three and four, etc,... and print line 1 and line 2,
>on one line, then line 3 and line 4 on the next line, up to "x" number
>of lines, depending on the number of active users.
If you are looping through lines in the file, why not just perform
another read inside the loop?
while(defined($firstline = <REPORT>)) {
chomp($firstline);
$nextline = <REPORT>;
print $firstline, $nextline;
}
--
Andrew Langmead
------------------------------
Date: Sun, 26 Apr 1998 16:49:40 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: books for learning perl
Message-Id: <35436459.512581697@news.xmission.com>
On Sat, 25 Apr 1998 02:24:58 +0000, jason bass <jkbass@netnet.net>
wrote:
>hello i'm new to perl and i would like to know if there are any good
>books for learning perl
>i already have perl 5 for dummies but it seems the author wrote the book
>for people that
>are already familier with other programming languages.
>please help i want to learn so bad, it seems so interesting.
>thanks
>jason
Search DejaNews, or the FAQ (Avaliable at www.perl.com) for an answer
to that question; it's been asked and answered about 30,000 times on
this group.
There are a lot of great books on Perl; Perl for Dummies isn't really
one of them. For that matter, .*\s[fF]or\sDummies isn't generally the
best book on any given subject. It's only the book with the brightest
colored cover. You can't judge a book by its cover.
Good luck on your search. There are many sources of the information
you're requesting, so it shouldn't be too hard to find all the reviews
and recommendations your wallet can afford to follow through on.
------------------------------
Date: Sun, 26 Apr 1998 10:37:08 -0700
From: "Grimes" <grimes@msn.com>
Subject: Re: Changing @INC
Message-Id: <6hvrqh$bel$1@nntp2.ba.best.com>
Grimes wrote in message <6huob9$t13$1@nntp2.ba.best.com>...
>How do I change the default @INC list of paths?
>
>I'm running Win32 Perl 5.004. I've searched through the installed files to
>see where this is set up but cannot find it. I've also searched registry
>keys, INI files, etc.
>
>Fergal
>
Still haven't figured this out. Any help would be appreciated. It must be
an easy question for someone!
Funny thing is that, although the list of paths is incomplete, Pel can find
the modules while running in debug mode, but not in regular mode.
Thanks in advance,
Fergal
------------------------------
Date: Sun, 26 Apr 1998 10:04:45 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: File matching, file handle and defined(<...>) problems
Message-Id: <deivh6.og4.ln@localhost>
Jonathan Feinberg (jdf@pobox.com) wrote:
: haert@wharp.rhein-main.de (Michael Haertfelder) writes:
: > 2.) I had to recognize that FILEHANDLES created during an open
: > statement are local to a subroutine only. Are there any
: > possibilities to make them global or pass them via a parameter ?
: You'll need to do some reading: please see perldata in the section
: titled "Typeglobs and Filehandles," perlsub under "Pass By Reference."
: In general you pass a reference to the filehandles typeglob, like so:
See also your Frequently Asked Question in the Perl Frequently Asked
Question list, which you should have done before posting anyway...
"How can I make a filehandle local to a subroutine?
How do I pass filehandles between subroutines?
How do I make an array of filehandles?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Apr 1998 14:26:39 GMT
From: daniel.mendyke@digital.com (Daniel)
Subject: Re: Free http perl cgi windows95 practice platform
Message-Id: <6hvg6v$g7$1@nntpd.lkg.dec.com>
In article <Pine.GSO.3.96.980424081631.5518X-100000@user2.teleport.com>,
rootbeer@teleport.com says...
>
>On Fri, 24 Apr 1998, Mark Fynes wrote:
>
>> Can anyone recommend a freeware setup for testing / learning perl web
>> programming ( through cgi ) on the windows95 platform?
>
>Yes. It's the Perl distribution on CPAN. Did you realize that you don't
>need a server to run Perl CGI scripts? Hope this helps!
Tom
Please explain what you mean. I don't understand
why I don't need a server? How will Netscape
display the results without one? Normally when
this is tried the script runs in a popped up
command shell window.
Daniel Mendyke
==============================================
daniel@virtualvoices.com
Sell it OnLine at http://www.virtualvoices.com
==============================================
------------------------------
Date: Sun, 26 Apr 1998 11:10:00 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Hash ref slice syntax?
Message-Id: <1d7yetz.p7pxw91cf0ol6N@slip166-72-108-214.ny.us.ibm.net>
Craig Berry <cberry@cinenet.net> wrote:
> I've banged away at this for a while, but seem to be suffering partial
> brain lock today, so...
>
> Suppose I have a hash reference:
>
> $hr = { a => 1, b => 2, c => 3 };
>
> Now, suppose I want to obtain two of the values of this hash as a list
> through a hash slice. With an ordinary hash, I'd use syntax like this:
>
> %h = ( x => 11, y => 12, z => 13 );
> @xyvals = @h{'x', 'y'};
> print "@xyvals\n"; # Prints: 11 12
>
> What's the equivalent syntax for getting a slice {'a', 'b'} of the hash
> refered to by $hr? I've tried a number of increasing ugly variants
> without success. I can't find it in the docs, on or offline.
$hr = { x => 11, y => 12, z => 13 };
@xyvals = @$hr{'x', 'y'}
print "@xyvals\n";
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Sun, 26 Apr 1998 17:10:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David Waffen <dmwaff@erols.com>
Subject: Re: help...can't rcp a file to another machines
Message-Id: <Pine.GSO.3.96.980426100936.12179L-100000@user2.teleport.com>
On Sat, 25 Apr 1998, David Waffen wrote:
> only portion that does not work is rcp.
If you're using the proper commands to run another program from perl, but
the other program doesn't cooperate, then it's the other program's fault.
If you're not using the proper commands, then it's your fault. If you
aren't sure about the proper commands, you should read the program's
documentation. If you've read it and you're still not sure, you should ask
in a newsgroup about the program.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 19:23:29 +0200
From: "Johan Zijlstra" <sunburst@nedernet.nl>
Subject: How do I get perl5 working with TK widgets?
Message-Id: <893610986.364952@nntpcache.support.nl>
I am a newby in this group and I have the following question:
I am a Windows95 user and have downloaded the following files:
- perlw32 (perl5)
- pw32i316 (perl5) from CPAN
- tcl80p2.exe (tcl en tk 8) from sunscript
- tk800_004 (tk 8 alpha) from CPAN (?)
- specTcl1.1
- specPerl
Perl5, specTcl and Tcl/Tk are working fine.
But...HOW DO I GET PERL WORKING WITH TK-WIDGETS????
I guess I've got all I need, but if not, please let me know where to get the
other stuff I need. What must I do, install, configure, copy, paste, insert
of whatever to get this thing on the road?
Please let me know by e-mail to <martijn.figee@cmg.nl>!
I'll owe you forever...
Thanks in advance
Martijn Figee
------------------------------
Date: Sun, 26 Apr 1998 19:19:13 +0200
From: "Johan Zijlstra" <sunburst@nedernet.nl>
Subject: How do I get Perl5 working with TK widgets?
Message-Id: <893610733.753830@nntpcache.support.nl>
I am a newby in this group and I have the following question:
I am a Windows95 user and have downloaded the following files:
- perlw32 (perl5)
- pw32i316 (perl5) from CPAN
- tcl80p2.exe (tcl en tk 8) from sunscript
- tk800_004 (tk 8 alpha) from CPAN (?)
- specTcl1.1
- specPerl
Perl5, specTcl and Tcl/Tk are working fine.
But...HOW DO I GET PERL WORKING WITH TK-WIDGETS????
I guess I've got all I need, but if not, please let me know where to get the
other stuff I need. What must I do, install, configure, copy, paste, insert
of whatever to get this thing on the road?
Please let me know by e-mail to <martijn.figee@cmg.nl>!
I'll owe you forever...
Thanks in advance
Martijn Figee
------------------------------
Date: 26 Apr 1998 14:16:00 +0200
From: haert@wharp.rhein-main.de (Michael Haertfelder)
Subject: How strong is the perl crypt function ?
Message-Id: <6scFmyvFZZB@wharp.rhein-main.de>
There is a built-in function "crypt" in perl. It resembles at the crypt
function in C and it guess that this is not as strong as PGP.
But how strong is this really ? In other words: How many hours does it
take for an expert with a Pentium 300MHZ machine and the best known crypto
analysis program to decrypt such data ?
Is it possible to apply this function to whole files ?
Thanx
Michael
------------------------------
Date: Sun, 26 Apr 1998 13:27:30 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: How strong is the perl crypt function ?
Message-Id: <35436E87.884016BC@coos.dartmouth.edu>
Michael Haertfelder wrote:
>
> There is a built-in function "crypt" in perl. It resembles at the crypt
> function in C...
>From the perlfunc manpage:
crypt PLAINTEXT,SALT
Encrypts a string exactly like the crypt(3) function in
the C library
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 26 Apr 1998 15:45:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: http Reg Exp
Message-Id: <6hvkqi$mii$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
perl.misc@cglis.com writes:
:I'm writting a Perl based web interface for reading/sending email.
I suggest you include a spelling checker in said interface. :-)
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Interestingly enough, since subroutine declarations can come anywhere,
you wouldn't have to put BEGIN {} at the beginning, nor END {} at the
end. Interesting, no? I wonder if Henry would like it. :-) --lwall
------------------------------
Date: Sun, 26 Apr 1998 12:05:25 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: http Reg Exp
Message-Id: <35435B47.5BFBF97D@coos.dartmouth.edu>
Chris Lambrou wrote:
>
> $msg =~ s!(ftp|https?)://([^\s]+)!<a href="$1://$2">$1://$2<\/a>!gsi;
>
> 90% this works. The problem is that the above will match text that
> starts with
> ftp/http/https followed by :// up to the next white space character,
> so this breaks down if the URL is followed by a non word character such
> as comma, a ">" or something else.
>
> Any ideas how to fix it?
Put those characters in the negated character class?
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 26 Apr 1998 16:20:58 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: http Reg Exp
Message-Id: <6hvmt8$3lj@flatland.dimensional.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc,
> perl.misc@cglis.com writes:
> :I'm writting a Perl based web interface for reading/sending email.
>
> I suggest you include a spelling checker in said interface. :-)
Could that be a writ of "execution" to make the program run? :-)
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: Sun, 26 Apr 1998 17:15:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David Lee Lambert <lamber45@EGR.msu.edu>
Subject: Re: Implementing sh in perl
Message-Id: <Pine.GSO.3.96.980426101104.12179M-100000@user2.teleport.com>
On Sat, 25 Apr 1998, David Lee Lambert wrote:
> I'm thinking of writing a replacement Bourne shell in perl. Has anyone
> else already done this, or tried to?
And, if so, has the programmer yet been released from treatment? :-)
> What minimum of commands would I have to implement to make most shell
> scripts continue to work, or to achieve POSIX compliance?
Maybe you want to check the POSIX spec.
> Is there some reason why this cannot be done in perl?
Nope; Perl can do all that the Bourne shell can do. Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 16:12:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Phil Shankland <phil_shankland@credo.shef.ac.uk>
Subject: Re: Multiple forms data collation
Message-Id: <Pine.GSO.3.96.980426090733.12179H-100000@user2.teleport.com>
On Fri, 24 Apr 1998, Phil Shankland wrote:
> No-one likes filling in long HTML response forms. :-(
> Idea: why not split it into multiple POST forms e.g. form1 - name &
> address etc; form2 - professional associations etc. Then collate the
> output into a single mailto: response.
Why not indeed?
> I know how to do this using perl and cookies to collect the 'NAME' value
> of radio buttons but I can't hack it for text and SELECT type data
> fields. Similar in concept to a shopping cart where you pick up and
> store data from a variety of pages? Ideas welcome.
I'd say that this is a task you could do in Perl - although it would be
even better if you implement it without using cookies, since not everybody
supports those (or wants to). If you're not sure how shopping cart scripts
work, the people in a newsgroup about CGI scripting (or their FAQ) should
be helpful. If you're having trouble getting Perl to do what you need, let
us know what part of your script is giving you trouble. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 15:27:00 GMT
From: michaelb@bessie.mojo.org (Mike Bristow)
Subject: Re: perl 5.004 is better than 5.004004 ?!
Message-Id: <893604420.14291.1.nnrp-02.c29ff71c@news.demon.co.uk>
In article <slrn6k6gfd.6jv.stolze@paxp01.mipool.uni-jena.de>,
stolze@paxp01.mipool.uni-jena.de (Knut Stolze) writes:
> Das ist hier uebrigens eine deutsche Newsgruppe. Du musst also nicht
> zwingend englisch posten :-))
Newsgroups: comp.lang.perl.misc,de.comp.lang.perl
^^^^^^^^^^^^^^^^^^^
If you can't guess what I'm going to say here, there's
probably not much point in me saying it ;-)
--
Mike.
``My waist isn't that bad, considering the rest of me.''
------------------------------
Date: Sun, 26 Apr 1998 18:45:30 +0200
From: Mark Seuffert <captain@pirate.de.nospam-delete-this>
Subject: Re: perl 5.004 is better than 5.004004 ?!
Message-Id: <354364AA.734B@pirate.de.nospam-delete-this>
Hi...
> Can I see the script ?
I have a better idea. This error occurs only with little bit longer
script, so let's us something common:
I also tried it with mhttpd (A personal web server for unix
systems), here are the errors when starting with 5.004004:
Number found where operator expected at ./mhttpd line 116,
near "getprorequire 5.0"
(Do you need to predeclare getprorequire?)
syntax error at ./mhttpd line 116, near "getprorequire 5.0"
BEGIN not safe after errors--compilation aborted at
./mhttpd line 117.
And this is line 115 and 116:
$sockaddr = 'S n a4 x8';
($name, $aliases, $proto) = getprotobyname('tcp');
Let me say again: this script works with perl 5.003 and 5.004 but
NOT with anything higher. As far as I can see, there are no
errors, the error message are strange, they must be false... strange
strange!
I use Linux 2.0.29 on a 486DX/33 with 16 MB RAM,
from "config.sh": gccversion='2.7.2, libc='/lib/libc.so.5.2.18'
--
/Mark (EMailadresse ab ".nospam" lvschen-delete)
http://home.pages.de/~irc ~html ~unix
------------------------------
Date: Sun, 26 Apr 1998 16:24:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Dwornick <bdwornick@usa.net>
Subject: Re: Perl Complier
Message-Id: <Pine.GSO.3.96.980426092159.12179K-100000@user2.teleport.com>
On Sat, 25 Apr 1998, Brian Dwornick wrote:
> I am looking for a perl compiler
Seen the FAQ's info about a compiler?
> or a program that will let me write perl and then give me the output of
> my script without having to upload it...
That's what Perl does, when it's installed on your computer. It lets you
run your scripts and get their output. Or am I missing something here?
> I have perl 5 on my system...
> But i don't have a cgi server
You don't need a webserver to run CGI scripts. Maybe that's what you're
looking for?
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 15:48:33 GMT
From: thee@pcrc.hongik.ac.kr (Tau Kim)
Subject: Perl experts!! help me!!
Message-Id: <35435742.8608410@usenet.kornet.nm.kr>
Hi, I'm a student studying computer science. And I've got in trouble
with this!
I'm writing a program which mesures the performance of the compiler.
Underlying source is C source. I'm trying covert this source to java,
perl, cobol & etc
But in other languages except C, I don't know how to mesure the time
during the loop is performed.
Please somebody give me idea or send the coverted source. HELP
ME...^.^ (JAVA,PERL,COBOL... anythin' else)
(Please send it via e-mail : thee@usa.net).
---------------------------------------------------------------
#include <dos.h>
#include <stdio.h>
double timeused(struct time *tm2, struct time *tm1);
struct time start, end;
void main(){
long i, n;
float x, t1, t, Mflops;
n=100000000;
x=0.;
/* Test Routine */
gettime(&start);
for (i=1; i<n; i++){
x=x*.99+1.0;
x=x*.99+1.0;
x=x*.99+1.0;
x=x*.99+1.0;
}
gettime(&end);
t1 = timeused(&end, &start);
Mflops = 8.*n/t1/10000000.;
printf("value of x = %f\n", x);
printf("Mflops = %f\n", Mflops);
printf("spending time = %f\n", t1);
}
double timeused(struct time *tm2,struct time *tm1){
float c;
/*c=tm1-tm2;*/
c=
((tm2->ti_hour-tm1->ti_hour)*3600+(tm2->ti_min-tm1->ti_min)*60+(tm2->ti_sec-tm1->ti_sec)+(tm2->ti_hund-tm1->ti_hund)/100.);
return c;
}
-----------------------------------------------
------------------------------
Date: Sun, 26 Apr 1998 10:36:29 -0600
From: patrick.mannion@us.socgen.com
To: jtlawson@emba.uvm.edu
Subject: Re: Perl script as NT service?
Message-Id: <6hvk9t$k7s$1@nnrp1.dejanews.com>
In article <35412241.F02A865D@emba.uvm.edu>,
Jim Lawson <jtlawson+bulk@emba.uvm.edu> wrote:
>
> Hi,
>
> I've written a small script which opens a socket, listens, and takes SQL
> commands - after which it uses ODBC
> to talk to the MS SQL server.
>
> It works OK, so I am now trying to get it to run as a service, so that
> no one has to be logged in while it is running. Ah,
> for the days when I could just put a script in /etc/rc.d/init.d.
>
> I've tried two different tools - srvany, and runexesrv. I didn't have
> much success with srvany. Runexesrv works - more or less - but it pops
> up a window for the perl script, regardless of who is logged in. Worse,
> the service will sometimes die when people log in or out.
>
> Is anyone successful in running a Perl script as an NT service?
>
> When responding, please write me email as well as a followup. I do read
> this newsgroup, but I don't entirely trust my
> newsfeed at the moment.
>
> If you do respond, remove the +spam from my email. (I love procmail)
>
> --
> Jim Lawson 237 Votey Building
> EM Computer Facility The University of Vermont
> jtlawson+spam@emba.uvm.edu Burlington, VT 05405
>
>
Just a thought... what about scheduling the job after using su from the
ntreskit to have it masquerade as a user with the appropriate priv's? I have
an event log archiving and auditing script i've scheduled for 2AM daily using
at and su... it runs consistently, the dosbox never pops up on the logged-in
user, and i have no worries about leaving a domain-admin equiv account logged
in...
obviously, there's two steps... the scheduler service has to log in as a
da-equiv account, and your at job must be a batch first starting su and then
calling your script... try it.
-p
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 26 Apr 1998 09:31:13 -0700
From: Steve Palincsar <palincss@tidalwave.net>
Subject: QRe: == vs. eq
Message-Id: <35436151.59D@tidalwave.net>
John Moreno wrote:
>
> Tom Christiansen <tchrist@mox.perl.com> wrote:
>
> > In comp.lang.perl.misc, "Kelby Valenti" <kelby@mplx.com> writes:
> > :What exactly is the difference between == and eq in an if statement. Also
> > :is there a function that can tell me whether a string is numbers or chars.
> >
> > The way of the post-docu-literate future. Lovely. Should have
> > seen it coming:
> >
> > X-Newsreader: Microsoft Outlook Express 4.71.1712.3
> > X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
> >
>
> The idea that you can tell (negatively at least) how competent a person
> is by what newsreader they use has a certain appeal. But I think it's
However it is wrong, stupid, and prejudicial, as well as
being needlessly derogatory. Personally, I have no
problem with Tom or Abigail responding to someone like
Kelby that they should RTFM, since they so richly deserve
that response, but I do deeply and profoundly resent being
lumped together such people based on the software I am
using to read this newsgroup.
> not going to fly in the end. As long as they can be configured not to
> do things that are actively harmfully you're going to get people using
> all of them.
>
> --
> John Moreno
------------------------------
Date: Sun, 26 Apr 1998 16:15:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Question on sorting
Message-Id: <Es13to.7ox@world.std.com>
"Bug" <bugking@usa.net> writes:
>==== a.txt ====
>Aqua::Barbie Girl::1
>Aqua::Doctor Jones::4
>Aqua::Happy Boys And Girls::3
>=============
>I've a text file like above. I want to get the data out and sort them in
>decending order. How to perform this? e-mail to bugking@usa.net
Since you don't specifically say so, I'm assuming that the character
sequence "::" separates each field, and that you want to sort on the
third field numerically. Just as a suggestion, you may "know" this
information, but if you express it, it makes it easier for others to
help. Also, if you state information like this explicitly when asking
for help, you may come up with your own ideas by the time you are
done.
You may want to look at the FAQ entry "How do I sort an array by
(anything)?", which is in the doucmentation that comes with perl. If
you have trouble accessing it on your own machine, it is avaiable via
HTTP at <URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq4/
How_do_I_sort_an_aray_by_anyth.html>
You also might want to take a look at the Sort::Fields module
<URL:http://www.perl.com/cgi-bin/cpan_mod?module=Sort::Fields>
#!/usr/bin/perl -w
use Sort::Fields;
print fieldsort '::', ['3n'], <>;
--
Andrew Langmead
------------------------------
Date: Sun, 26 Apr 1998 16:19:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Bug <bugking@usa.net>
Subject: Re: Question on sorting
Message-Id: <Pine.GSO.3.96.980426091842.12179J-100000@user2.teleport.com>
On Sat, 25 Apr 1998, Bug wrote:
> I've a text file like above. I want to get the data out
Open the file and read the data.
> and sort them in decending order.
Use Perl's sort function.
You may also benefit from a good book on Perl, such as the Llama book.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 11:13:36 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: QUESTION: How do I print file contents to screen?
Message-Id: <35434F20.A94C78CE@negia.net>
David Joyce wrote:
>
> How do I print the contents of a file to screen? For instance, I have a
> log-file .txt file that I want to print out
> to screen, along with any entries I have just appended. Do I use <STDOUT>?
yes, STDOUT will do nicely for such a procedure. simply 'open' the file
and print to STDOUT as you read the input filehandle.
if you're having a particular problem, perhaps you could elaborate, or
even share a piece of dysfunctional code.
hope this helps,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sun, 26 Apr 1998 17:24:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: troxel@sammcgees.com
Subject: Re: Reg Exp problem
Message-Id: <Pine.GSO.3.96.980426102327.12179N-100000@user2.teleport.com>
On Sat, 25 Apr 1998 troxel@sammcgees.com wrote:
> The problem I am having is skipping the text inside the tags < >.
> Any pointers on an example or module that would help would be greatly
> appreciated.
How about HTML::Parser? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 26 Apr 1998 17:53:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Alfred Landrum <agl3@cornell.edu>
Subject: Re: RFI: Counting repeated substrings within a string
Message-Id: <Pine.GSO.3.96.980426104849.12179O-100000@user2.teleport.com>
On 26 Apr 1998, Alfred Landrum wrote:
> I'm working on a cryptology problem. I would like to create
> a perl script that will read in a cyphertext file, and find all
> repeated substrings within that file.
Well, you should probably put a limit on the minimum length of such a
substring - substrings of length one are too common to be generally
useful! :-)
But here's some code like what I've done for some cryptology I've done in
Perl; it's fairly fast. Note that this won't report 'alf' from 'alfalfa',
since it finds 'alfa' in there. If you want those shorter strings, though,
they're easy to generate from the ones given.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
#!/usr/bin/perl -w
use strict;
sub repstrs ($) {
# returns a list of repeated substrings in the given string
# (Given string must not contain any null characters.)
my($string) = @_;
my($copy, $mask, %hash);
for (
$copy = substr($string,1) . "\0";
$copy =~ /[^\0]/;
$copy = substr($copy,1) . "\0") {
$mask = $string ^ $copy;
while ($mask =~ /(\0{2,})/g) {
my $len = length $1;
$hash{ substr($string, pos($mask)-$len, $len) }++;
}
}
keys %hash;
}
for ('werasdwerasdwer', 'this is a test with some repeated substrings',
'fred is a man who is a fanatic fan of manfred mann', 'alfalfa'
) {
print "$_\n", map(" '$_'\n", repstrs($_)), "\n";
}
__END__
------------------------------
Date: Sun, 26 Apr 1998 11:46:48 -0600
From: dejanews@net-school.com
Subject: Re: RFI: Counting repeated substrings within a string
Message-Id: <6hvodo$rer$1@nnrp1.dejanews.com>
In article <6htts7$6nf@newsstand.cit.cornell.edu>, agl3@cornell.edu (Alfred
Landrum) wrote:>
> Ex: An input of 'werasdwerasdwer' would return all of
the times> that 'wer', 'era', 'ras', 'asd' occured. (For the assignment,
I'm just> going to be looking at repeated patterns with 4 or more
characters, then> do some frequency study on the results to try and crack
the cyphertext.)
a variation inspired by one of abigail's signatures:
#!/usr/bin/perl -w
$test_string = 'werasdwerasdwer';
foreach $match
(($test_string =~ /(?=(...))/g)) { $match_hash{$match}++;
}
foreach $key
(sort keys %match_hash) { print "$key: $match_hash{$key}\n";
}
-----------------prints:
asd: 2
dwe: 2
era: 2
ras: 2
sdw: 2
wer: 3
hope
this helps,
Lance
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 26 Apr 1998 12:25:11 -0600
From: dejanews@net-school.com
Subject: Re: RFI: Counting repeated substrings within a string
Message-Id: <6hvqlo$g6$1@nnrp1.dejanews.com>
In article <6htts7$6nf@newsstand.cit.cornell.edu>, agl3@cornell.edu (Alfred
Landrum) wrote:
> Ex: An input of 'werasdwerasdwer' would return all of the
times> that 'wer', 'era', 'ras', 'asd' occured. (For the assignment, I'm
just> going to be looking at repeated patterns with 4 or more characters,
then> do some frequency study on the results to try and crack the
cyphertext.)
inspired by one of abigail's signatures:
#!/usr/bin/perl -w
$test_string = 'werasdwerasdwer';
foreach $match (($test_string =~
/(?=(...))/g)) { $match_hash{$match}++;
}
foreach $key (sort keys
%match_hash) { print "$key: $match_hash{$key}\n";
}
-----------------
prints:
asd: 2
dwe: 2
era: 2
ras: 2
sdw: 2
wer: 3
Hope this helps,
Lance
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 26 Apr 1998 11:09:51 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Signatures
Message-Id: <1d7y57x.72e6rz1u27iwuN@slip166-72-108-214.ny.us.ibm.net>
Brandon Golm <br@ndon.com> wrote:
> BTW: impressive sig!
>
> > --
> > #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> > $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> > 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> > rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
Yup. Did you spot the hidden eval?
Here's my own:
#!/usr/bin/perl -w-e 'open ${-%{$@}};print'
$_=q=_=;s##scalar((($_='!;_$$,!$_!;') =~
tr@_$;!,@=",$;@),$_)#ee;eval "@{[reverse
split+/[1-9]/, '>1A2T3A5D4<6 7t8in1r2p2;4'
.'05,801,8A9AT3k D5e6e7s8']}" __END__
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Sun, 26 Apr 1998 11:10:03 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: spoiled noobie
Message-Id: <1d7yn7d.1d2hhnz4weoqmN@slip166-72-108-214.ny.us.ibm.net>
Bill 'Sneex' Jones <chasecreek.systemhouse@usa.net> wrote:
> Kevin Reid wrote:
> >
> > $you{intelligence} += 65535 if $^O eq "MacOS"; # :-)
> >
<snip>
> PS - Anyone else thinks it's funny that Kevin 'Thinks Different', but
> still surfs in on IBM.NET ??? Just wondering... :-)
I have nothing to do with the company IBM. The "ibm" in the domain name
is the ISP I am using.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Sun, 26 Apr 1998 16:13:42 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Craig Simpson <craigs@3rdstone.net>
Subject: Re: use IPC::Open2; works on command line, but not CGI
Message-Id: <Pine.GSO.3.96.980426091300.12179I-100000@user2.teleport.com>
On Fri, 24 Apr 1998, Craig Simpson wrote:
> Subject: use IPC::Open2; works on command line, but not CGI
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 2421
**************************************