[7550] in Perl-Users-Digest
Perl-Users Digest, Issue: 1176 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 14 18:17:14 1997
Date: Tue, 14 Oct 97 15:00:21 -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 Tue, 14 Oct 1997 Volume: 8 Number: 1176
Today's topics:
Re: [Q] executing a perl script on a win-nt box (Jeremy D. Zawodny)
Bulk email solution needed that works with Linux, Perl <chris@ixlabs.com>
Cannot Use use <rbrewer@ccmail.dsccc.com>
Re: Constants (brian d foy)
Re: Constants (Matthew Cravit)
Re: Constants (Faust Gertz)
Counting the individual characters in a string <krishna@lts-csi.com>
Re: Counting the individual characters in a string <krishna@lts-csi.com>
Re: Credit Card Number Validation (Joel Potischman)
Getting data from external data <simtest@nortel.ca>
Re: HELP PLEASE!!! <ramon@ramonc.icix.net>
How to do a questionnaire <christian.dubuc@mks.net>
Re: How to do a questionnaire (Faust Gertz)
Re: Passing arguments to a script in HTML <forda@monroe.army.mil>
Re: Perl on IIS 3.0 (Jeremy D. Zawodny)
Re: Posting to a Newsgroup with a Perl Script. (Jeremy D. Zawodny)
Re: Reg expr. question (SEARCH and REPLACE) <usenet-tag@qz.little-neck.ny.us>
Re: Search: Reference Book (Jeremy D. Zawodny)
Re: Search: Reference Book (Tad McClellan)
Re: Server-Push and MS IE (Jeremy D. Zawodny)
Re: split(/$dirsep/) problem ($dirsep = "\\") [solved] (Simon Oosthoek)
Re: statics or const in perl ? (dave)
strange perl semop behavior <jtau@spd.analog.com>
Re: Telnet <ramon@ramonc.icix.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 14 Oct 1997 19:18:34 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: [Q] executing a perl script on a win-nt box
Message-Id: <3445c53e.92078551@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 14 Oct 1997 13:44:14 -0400, Carl Joel Kuzmich
<cjk@vms.cis.pitt.edu> wrote:
>Maybe someone could help me with a problem that I'm having. I know that
>the first line of a *.pl program on a unix box starts something like so:
>#!/usr/bin/perl
>
>My question is this: What do use as the first line when the file is on
>an NT-box???
>
>Any and all help will be greatly appreciated.
The first line doesn't *have* to be anything special, provided that
you've got a file association from *.pl to perl.exe setup.
You *can* use the "#!perl -w" type syntax to set switches on the Perl
command-line, though. It's up to you.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 14 Oct 1997 13:27:08 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Bulk email solution needed that works with Linux, Perl
Message-Id: <3443D59C.A19EE9AA@ixlabs.com>
Hi,
We have a email subscription service for the users of one of our
client's websites. The user can specify the information which appears in
their email, which results in all the email contents being unique.
We have been sending out the email (about 400 subscribers now) from Perl
with an open2 (we tried 'open' also) call to sendmail, looping through
each user, building the content, and piping the content.
The problem is that the program is crashing because of too many open
pipes. We tried waiting on the pid but that didn't work either. We also
tried using the qmail sendmail wrapper and got the same results.
We would rather not sleep long in the loop between sends.
Any suggestions or pointers to solving this problem would be
appreciated.
Thanks,
Chris
------------------------------
Date: Tue, 14 Oct 1997 16:09:43 -0700
From: Rick <rbrewer@ccmail.dsccc.com>
Subject: Cannot Use use
Message-Id: <3443FBB7.24A8@ccmail.dsccc.com>
Hello,
I am trying to make use of Perl modules but cannot get "use"
to find the modules. Even when adding the command:
push (@INC, "/usr/local/perl/lib");
then
use Carp;
I still get the same error:
Can't locate Carp.pm in @INC at test.pl line 14.
BEGIN failed--compilation aborted at upload.pl line 14.
I have read through the FAQ, Perl manpages, and am fixing to buy
another book but suspect I have some small item out of place.
Any suggestions would be appreciated,
Rick
------------------------------
Date: Tue, 14 Oct 1997 16:29:26 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Constants
Message-Id: <comdog-ya02408000R1410971629260001@news.panix.com>
In article <3443BCD1.3BE6@us.oracle.com>, Allen Choy <achoy@us.oracle.com> wrote:
>Is there a way to declare constants in Perl
#!/usr/bin/perl
*PI = \3.14;
*string = \'some data';
$PI = 3;
$string = 'other data'; # we'll never get this far, but we'll get the
# same error anyway
__END__
Modification of a read-only value attempted at test.pl line 6.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 14 Oct 1997 13:20:53 -0700
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Constants
Message-Id: <620k75$qtl$1@shell3.ba.best.com>
In article <3443BCD1.3BE6@us.oracle.com>,
Allen Choy <achoy@us.oracle.com> wrote:
>Is there a way to declare constants in Perl, like finals in Java?
There are a number of ways of doing this. The one I like to use takes
advantage of the fact that a sub in perl which finishes without a return
statement returns the last value evaluated. So, you can do something
like this:
sub NUMERIC_CONSTANT { 27.3; }
sub STRING_CONSTANT { "Hello, world!"; }
sub LIST_CONSTANT { (1, 2, 3); }
Then you can do things like:
$foo += NUMERIC_CONSTANT;
print STRING_CONSTANT, " My name is $name.";
map { $total += $_ } LIST_CONSTANT;
Hope this helps.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Tue, 14 Oct 1997 21:39:30 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Constants
Message-Id: <3443e4bf.2808644@news.wwa.com>
On Tue, 14 Oct 1997 11:41:21 -0700, Allen Choy <achoy@us.oracle.com>
wrote:
>Is there a way to declare constants in Perl, like finals in Java?
I don't know anything about Java. But to declare constants, try
use constant CONSTANT=>'value';
or, if you don't have the constant module,
sub CONSTANT { 'value' }
or, there is some weird reference thing I don't understand.
Look for something like
*PI = \3.14285;
in previous messages or in the documentation.
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: Tue, 14 Oct 1997 16:30:16 -0400
From: Krishna Podury <krishna@lts-csi.com>
Subject: Counting the individual characters in a string
Message-Id: <3443D658.3F003560@lts-csi.com>
<HTML>
Hi all!!
<P>The problem I'm trying to solve is something like this...
<P>I get two words for example
<P>$word1 = "HELPUS";
<BR>$word2 = "FLOP";
<P>I would like to compare each letter in $word2 with the $word1 and print
out the number of occurances of this letter. In the above example, the
output would be
<BR>F = 0
<BR>L = 1
<BR>O = 0;
<BR>P = 1;
<P>How would I achieve this? What I'm trying to do is extract each character
in $word2 using substr() and do something like
<BR>$cnt = ($word2 =~ tr/$char//);
<P>But this doesnt seem to work. Your input is highly appreciated,
<BR>Krishna.</HTML>
------------------------------
Date: Tue, 14 Oct 1997 16:47:12 -0400
From: Krishna Podury <krishna@lts-csi.com>
Subject: Re: Counting the individual characters in a string
Message-Id: <3443DA50.DE2156C8@lts-csi.com>
<HTML>
<BLOCKQUOTE TYPE=CITE>$cnt = ($word2 =~ tr/$char//);
<P>But this doesnt seem to work. Your input is highly appreciated,
<BR>Krishna.</BLOCKQUOTE>
Is the $char in the above expression the culprit? If so, what is
the solution?</HTML>
------------------------------
Date: Tue, 14 Oct 1997 19:36:11 GMT
From: joel.potischman@csfbJUNKMAIL.com (Joel Potischman)
Subject: Re: Credit Card Number Validation
Message-Id: <3443c930.106658328@jusdnews.fir.fbc.com>
Well, if you do decide to settle for less, there's a free script at
Matt's Script Archive (http://www.worldwidemart.com/scripts).
-joel
On Wed, 01 Oct 1997 15:06:29 -0400, comdog@computerdog.com (brian d
foy) wrote:
>In article <3431DF71.154C@ddx.com>, nmuller@ddx.com wrote:
>
>>Hi,
>>
>>I would like to add a statement to my Perl script that processes credit
>>card orders which will do a simple online card number verification such
>>that a Visa card number, for example, must start with the number 4 and
>>be followed by 15 random digits. Can anyone suggest a line of code to
>>start me off?
>
>better than that even (why settle for less?)! check out the
>Business::CreditCard module at CPAN [1].
>
>good luck :)
>
>[1]
>Comprehensive Perl Archive Network
>find one near you at <URL:http://www.perl.com>
>
>--
>brian d foy <comdog@computerdog.com>
>NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
>CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
=======================================================
Joel Potischman joel.potischman@csfbJUNKMAIL.com
Delete 'JUNKMAIL' from my address to send me email.
Spammers, I never buy ANYTHING advertised by bulk
email, so don't waste your time putting me on a list.
=======================================================
------------------------------
Date: Tue, 14 Oct 1997 16:14:28 -0400
From: Adeel Ahmad <simtest@nortel.ca>
Subject: Getting data from external data
Message-Id: <3443D2A4.41C67EA6@nortel.ca>
Hi,
I need to be able to get a stock quote from an external web site and
have it scroll across my own homepage. Has anyone had to deal with this
kind of thing before?
Thanks for any help.
Adeel.
------------------------------
Date: Tue, 14 Oct 1997 14:51:50 -0400
From: Ramon Castillo <ramon@ramonc.icix.net>
To: u1436039 <u1436039@csi.uottawa.ca>
Subject: Re: HELP PLEASE!!!
Message-Id: <3443BF46.3995@ramonc.icix.net>
u1436039 wrote:
>
> We are beginners with PERL and we need to write a program to make search
> for a certain string.
> Actually, we started to use the Command " m // " but we just figured
> out how to find such a string as the following situation:
>
> string : word1 and word2 or word3
> | |____ Boolean
> opreator
> |______Boolean operator
>
> we used the following command:
>
> print if m/word1.*word2|word2.*word1|word3/
>
> We need to write a string ( query ) like this:
>
> print lines with word1 and word2 or word3 andnot word4
>
> |_____ How to write the code for this boolean
>
> Thank you in advance.
In a first fly I'd say .. Oh that's easy but going deeper it might
depends in how complex is the data that u r dealig with.
for instance I'd say:
$text = "the angel are in the heaven";
$word1 = "the";
$word2 = "gel";
$word3 = "face";
print "passOK" if $text =~ /($word1|$word2|$word3)/;
In this case it will be true with $word1 and that's good though. It is
what we want , don't we?
*BUT*
It will be also true with $word2 'couse it'll match with 'angel' so be
carefull and you can use /b "boundary word".
Any way I'll invite you to take a look at the Perl FAQ's
--
#!/usr/local/bin/perl
use Hart::WithBrain;
while ($god->bless == $Internet && $Perl == $Cool){
$Be = "Happy";
$Live = "Love";
$Hack = "Fun";
} # RC ray@icix.net
------------------------------
Date: Tue, 14 Oct 1997 16:46:38 -0400
From: Christian Dubuc <christian.dubuc@mks.net>
Subject: How to do a questionnaire
Message-Id: <3443DA2E.576A0B98@mks.net>
Hi there:
Someone told me that PERL is the correct language to do what I want to
do ! I am doing a web page with a questionnaire. There are about 10
questions, each one with a choice of 4 answers (radio buttons). At the
bottom of the page, I will put a submit button that will do this action:
check every answers and display the result on a seperate page (how many
good answers).
Can somebody give me the code to do that ?
Thanks
Christian Dubuc
<christian.dubuc@mks.net>
------------------------------
Date: Tue, 14 Oct 1997 21:42:49 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: How to do a questionnaire
Message-Id: <3445e6c2.3250461@news.wwa.com>
On Tue, 14 Oct 1997 16:46:38 -0400, Christian Dubuc
<christian.dubuc@mks.net> wrote:
>Someone told me that PERL is the correct language to do what I want to
>do ! I am doing a web page with a questionnaire. There are about 10
>questions, each one with a choice of 4 answers (radio buttons). At the
>bottom of the page, I will put a submit button that will do this action:
>check every answers and display the result on a seperate page (how many
>good answers).
>
>Can somebody give me the code to do that ?
Sure, how much are you paying? Seriously, if you want a PERL question
answered or even some code optimized for free, this is the place to
ask. If you want someone to code your project for free, I am not sure
you have found the right newsgroup.
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
------------------------------
Date: 14 Oct 1997 20:30:08 GMT
From: "Allie Ford" <forda@monroe.army.mil>
Subject: Re: Passing arguments to a script in HTML
Message-Id: <01bcd8d9$36032590$7664f893@forda>
brian d foy <comdog@computerdog.com> wrote in article
<comdog-ya02408000R1010972306320001@news.panix.com>...
> <form action="/scripts/HelloWorld.pl?arg1+arg2">
>
> or many other forms depending on what you are doing. these arguments
> will show up in the query string. beware that CGI.pm effectively
> concatenates the query string with the HTTP message body, so you won't
> be able to tell the difference between the two through the module
> (although $ENV{'QUERY_STRING'} is still available and untouched).
In using IIS 3.0 and <FORM ACTION="/scripts/HelloWorld.pl" METHOD="GET">,
the form's arguments get concatenated to form a query string that appears
in the browser's URL field as follows
http://.../scripts/HelloWorld.pl?ListOne=red&ListTwo=blue.
But the arguments (ListOne and ListTwo) are empty when printed as indicated
by the HTML page that HelloWorld.pl generates. According to Microsoft
Knowledge Base,
http://premium.microsoft.com/support/kb/articles/q156/7/55.asp
IIS 2.0 requires a registry entry in order to Use Standard Program I/O in
PERL Script. Registry entry exists in IIS 3.0 so assuming problem is fixed
in 3.0.
Just now sure if it is an IIS 3.0 issue or a passing argument issue.
Should I beable to use the ListOne and ListTwo arguments inside the
HelloWorld.pl script by just referencing them as $ListOne and $ListTwo.
The query string generated from the FORM ACTION GET indicates that the
value for each argument exists. Just not sure how to access the argument
values.
------------------------------
Date: Tue, 14 Oct 1997 19:23:22 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Perl on IIS 3.0
Message-Id: <3447c65c.92364923@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 14 Oct 1997 09:37:18 -0600, han7159@cs.nyu.edu wrote:
>Hi,
>I use IIS 3.0 on NT 4.0 sever. I made Perl CGI running fine but I
>have two problems using PerlScript.
>
>1. PerlScript in HTML does not respond anything. Here's the sample
>code.
>
><script language="PerlScript">
>$window->document->write("PerlScript says: Hello, world!");
></script>
>
>This is a part of helloworld example included in PerlSei310.exe
>
>2. Active server page (.asp) was not running. I set the virtual
>directory permission as "execute" but it gives me "http 1.0 403 Access
>forbidden.." error message.
>
>I need to find a solution for PerlScript in Active Server Page. Does
>anyone have some information?
Your are trying to use browser stuff on the server. The PerlScript
code you've cited above was meant to be run in a browser. Server-side
code typically uses the modules that are built into IIS.
Check out the docs and samples at the ActiveState web site. They're
quite helpful, I think.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 14 Oct 1997 19:00:20 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Posting to a Newsgroup with a Perl Script.
Message-Id: <3443c132.91042632@igate.hst.moc.com>
[cc'd automagically to original author]
On Thu, 09 Oct 1997 16:56:21 -0700, Brandon Stirling
<brandons@uidaho.edu> wrote:
>Posting to a Newsgroup with a Perl Script.
>
>This should be an easy task, but I can only find a method to read
>Newsgroups with a perl script.
>
>Can anyone in Perl land give me a starting point for this process?
Lookup the NTTP module on CPAN.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 14 Oct 1997 19:14:08 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Reg expr. question (SEARCH and REPLACE)
Message-Id: <eli$9710141502@qz.little-neck.ny.us>
Posted and mailed to Vinny.
brian d foy <comdog@computerdog.com> wrote:
> Vinny Carpenter <vscarpenter@qgraph.com> wrote:
> >Run through a text file. Find all lines that are ALL CAPS and add
> >something to them.
> >ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU..
> ><H3>ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ..</H3>
> while( $line = <DATA> )
> {
> $line =~ s| ^ ([A-Z\s]+) \n $ |<h2>$1</h2>\n|x;
> print $line;
> }
That will make a line of " " into a H2. It also fails for his
example with periods on the end.
s| ^ ( [^a-z]* [A-Z] [^a-z]* ) \n $ |<h2>$1</h2>\n|x;
Will require at least one capital in the line, and handle all non-
lower case characters.
Elijah
------
$n="\n"; print "the sound of a mime shouting on Usenet: \U$n";
------------------------------
Date: Tue, 14 Oct 1997 19:19:22 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Search: Reference Book
Message-Id: <3446c5a4.92180798@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 14 Oct 1997 15:53:04 GMT, 2002@calva.net (Christophe ODDO)
wrote:
>I mean...uuhh... I'm not a professional programmer...
>I programmed old languages (Basic, Turbo-Pascal) some years ago.
>Now, I've some (few) rudiments of Java programming...
>Consider I've a little programming background only!
>
>In your opinion, what have I to choose:
>Randall Schwartz's "Learning Perl"
>or Wall's "Programming Perl" ?
In that case, start with "Learning Perl" and work your way up.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 14 Oct 1997 14:20:36 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Search: Reference Book
Message-Id: <4mg026.472.ln@localhost>
Christophe ODDO (2002@calva.net) wrote:
: On Tue, 14 Oct 1997 06:28:39 -0500, tadmc@flash.net (Tad McClellan)
: wrote:
: >The ultimate and definitive Perl reference is not a book at all.
: >It is free!
: >It comes with every proper perl distribution!
: >It is the man pages (Plain Old Documentation) ;-)
: Yeah!
: Where can I find it on the Web, please ? Have you an URL ?
^^^^^^^^^^^^^^^^^^^
As I said above, they are included with every proper perl distribution.
So they are probably already on your system somewhere.
They have a '.pod' filename extension.
Failing that, you can get a perl distribution, unpack it, copy out
the pod files, and delete the distribution ;-)
They must be available at www.perl.com somewhere too...
See the enclosed snippet from the Perl FAQ about where to get perl stuff.
: >What do you mean by that?
: >Do you mean "I have never programmed before"?
: >Do you mean "I am a programmer, but I've never done Perl or CGI
: >programs before"?
: I mean...uuhh... I'm not a professional programmer...
I forgive you ;-)
: I programmed old languages (Basic, Turbo-Pascal) some years ago.
: Now, I've some (few) rudiments of Java programming...
: Consider I've a little programming background only!
: In your opinion, what have I to choose:
: Randall Schwartz's "Learning Perl"
: or Wall's "Programming Perl" ?
I would go with "Learning Perl" first (or maybe the Gecko, but I have
never read the windoze-centric books)
: Thank you for your answers, Tad!
Hope they helped.
Good luck!
Perl FAQ, part 2:
------------------------------
=head2 What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?
CPAN stands for Comprehensive Perl Archive Network, a huge archive
replicated on dozens of machines all over the world. CPAN contains
source code, non-native ports, documentation, scripts, and many
third-party modules and extensions, designed for everything from
commercial database interfaces to keyboard/screen control to web
walking and CGI scripts. The master machine for CPAN is
ftp://ftp.funet.fi/pub/languages/perl/CPAN/, but you can use the
address http://www.perl.com/CPAN/CPAN.html to fetch a copy from a
"site near you". See http://www.perl.com/CPAN (without a slash at the
end) for how this process works.
CPAN/path/... is a naming convention for files available on CPAN
sites. CPAN indicates the base directory of a CPAN mirror, and the
rest of the path is the path from that directory to the file. For
instance, if you're using ftp://ftp.funet.fi/pub/languages/perl/CPAN
as your CPAN site, the file CPAN/misc/japh file is downloadable as
ftp://ftp.funet.fi/pub/languages/perl/CPAN/misc/japh .
Considering that there are hundreds of existing modules in the
archive, one probably exists to do nearly anything you can think of.
Current categories under CPAN/modules/by-category/ include perl core
modules; development support; operating system interfaces; networking,
devices, and interprocess communication; data type utilities; database
interfaces; user interfaces; interfaces to other languages; filenames,
file systems, and file locking; internationalization and locale; world
wide web support; server and daemon utilities; archiving and
compression; image manipulation; mail and news; control flow
utilities; filehandle and I/O; Microsoft Windows modules; and
miscellaneous modules.
------------------------------
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 14 Oct 1997 19:04:12 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Server-Push and MS IE
Message-Id: <3444c1b4.91173170@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 14 Oct 1997 15:16:19 +0100, Gary Howland
<ghowland@hotlava.com> wrote:
>Jeremy D. Zawodny wrote:
>>
>> [cc'd automagically to original author]
>>
>> On 10 Oct 1997 23:14:43 GMT, "Matthias Hellmund"
>> <matthias.hellmund@nienburg-weser.de> wrote:
>>
>> >I'd like to have some chat-lines as a datastream via Server-Push. I know,
>> >that there is no new-page-clear with MS IE, but why are lines not printed
>> >out line by line with pauses like with Netscape?!?
>>
>> Netscape is a company, Navigator is their flagship product. You
>> wouldn't say "Microsoft" when you meant "Excel", would you?
>
>He might, if he had just typed 'microsoft' in order to run it. And so
>would I.
>
>So, perhaps you should be asking "Why the hell do Netscape name their
>executables after the company?"
The historical precedent is what they're battling there. Remember back
when the company was *NOT* named Netscape Communications? In the old
days it was Mosaic Communications and their flagship product was
Netscape. Since then they've obviously renamed both their company and
product(s).
Such is life with small start-ups, I guess. :-)
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 14 Oct 1997 19:07:12 GMT
From: s.oosthoek@student.utwente.nl (Simon Oosthoek)
Subject: Re: split(/$dirsep/) problem ($dirsep = "\\") [solved]
Message-Id: <620ft0$92t$1@pandora.cs.utwente.nl>
In a previous article Tad McClellan <tadmc@flash.net> says...
>Don't forget to check the newsgroup where you asked the question ;-)
I won't, but I think news only is too unreliable, therefore I ask for
two path redundancy ;-) and netiquette says that posting solutions to a
problem is useful for everyone!
anyway, I think all responses have solved my problem, thanks all!
you all found it necessary to remark on my quick typo of using double
quotes in the example path ;-), which indeed is absolutely wrong...
below are the solutions to my problem. When the script is finished,
I'll probably post it and some others, as they might be useful to more
people ;-)
Guy Decoux wrote:
#!/usr/local/bin/perl
$dirsep = '\\';
$path = "C:\\foo\\bar\\blip";
@path = split (/\Q$dirsep/, $path);
print join('|', @path),"\n";
which produces:
C:|foo|bar|blip
Glenn West <westxga@ptsc.slg.eds.com> suggested:
>Right. You actually have two problems. You need to add an extra \\
>sequence to the $dirsep variable assignment so that you are left with
> \\ by the time execution gets to the split. In addition, the
>assignment to $path has the same sort of problem in that your \ is
>being interpreted as an escape sequence. So you need to double up the
> \ in the $path assignment.
And Brian d foy <comdog@computerdog.com> suggested:
(which also uses the \Q modifier to prevent further evaluation of the \
in $dirsep)
#!/usr/bin/perl -wT
# using double quotes when you aren't interpolating leads to
# headaches. if you want exactly what you type use single
# quotes!
$dirsep = '\\'; # double \, otherwise it thinks we're escaping '
$path = 'C:\foo\bar\blip';
# use \Q, or quotemeta() when using a variable for a regex to
# avoid acrobatics in your patterns.
@path = split (/\Q$dirsep/, $path);
foreach( @path )
{
print "$_\n";
}
__END__
C:
foo
bar
blip
---------------------
The solution from Guy seems to me slightly more generic (especially
since I also use $dirsep to concatenate paths and filenames...)
Thanks again,
Simon.
------------------------------
Date: Tue, 14 Oct 1997 20:35:25 GMT
From: over@the.net (dave)
Subject: Re: statics or const in perl ?
Message-Id: <3443d73f.1106793@news.one.net>
Doug Seay <seay@absyss.fr> wrote:
>Jeremy D. Zawodny wrote:
>
>> *PI = \3.14159.
>
>I prefer
>
> use constant PI => 3.14159;
>
>I think Tom Phoenix's "constant.pm" started shipping with 5.004. Maybe
>it was with 5.003, I don't remember.
>
>- doug
I took a look and "use constant" seems to have some gotchas. Why use it over
typeglob references?
Thanks,
Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________
------------------------------
Date: 14 Oct 1997 17:15:30 -0400
From: James Tau <jtau@spd.analog.com>
Subject: strange perl semop behavior
Message-Id: <ndk67r0rqq5.fsf@clio.spd.analog.com>
Hi there,
I was wondering if anyone has experienced this curious situation:
a parent forks off some children in some order without waiting for one
to finish before forking the next one. Then it sits back and waits
for the first to finish, then the second, and so on so as to preserve
the original order in which the data are fed back. The
synchronization is done with semaphores(semget,semop) on an ultra II.
The curious thing is while the children have no problems executing
semop, when the parent attempts to wait on it it fails, no matter how
many times it tries! I have also tried to simultaneously use a C
program with semop to wait on it and it works! I have no idea
why this is so, and would appreciate any information any one can share
which sheds light on what I'm seeing. Thanks very much.
Befuddled,
James
------------------------------
Date: Tue, 14 Oct 1997 15:17:49 -0400
From: Ramon Castillo <ramon@ramonc.icix.net>
To: Huron Internet <support@huron.net>
Subject: Re: Telnet
Message-Id: <3443C55D.3DC8@ramonc.icix.net>
Huron Internet wrote:
>
> I need to be able to telnet to a site and issue some commands. How do I
> do this.
>
> I do NOT want to use a module.
>
> Any help would be appreciated :-)
> Thanks...
I've been very happy using Comm.pl under Solaris 2.5 it works with some
legacy Perl versions and does the job pretty good though.
You can find it in CPAN his Author is Eric Arnold
I hope this help.
RC
--
#!/usr/local/bin/perl
use Hart::WithBrain;
while ($god->bless == $Internet && $Perl == $Cool){
$Be = "Happy";
$Live = "Love";
$Hack = "Fun";
} # RC ray@icix.net
------------------------------
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 1176
**************************************