[11540] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5140 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 15 16:07:32 1999

Date: Mon, 15 Mar 99 13:00:24 -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           Mon, 15 Mar 1999     Volume: 8 Number: 5140

Today's topics:
    Re: 2d-array sort <aqumsieh@matrox.com>
    Re: CGI form that calcs order form totals? <aghaeim@genesis.co.nz>
    Re: Datastream API Problem Help! (Bart Lateur)
    Re: does perl discourage obfuscated code? (was Re: Perl <jeromeo@atrieva.com>
    Re: Finding end of line <jglascoe@giss.nasa.gov>
        Help: Conditional use of packages in Perl edward@echarge.com
        I want to run win32 program by running CGI under winNT <teamfm@yyhome.com>
    Re: IDE for Perl swamichandra@my-dejanews.com
    Re: inv. cos <cassell@mail.cor.epa.gov>
    Re: inv. cos <jhi@alpha.hut.fi>
    Re: loading code only if it is needed (Abigail)
    Re: localtime (Abigail)
    Re: Memory management & Perl to C extensions (Helena Jeeves)
    Re: need better way to print external file withen perl  <jim@*nospam*network-2001.com>
    Re: Newbish Prob - Output to File <aqumsieh@matrox.com>
    Re: open port from behind firewall, with no proxy <droby@copyright.com>
    Re: Output to file - Thanks - but it still don't work! <aqumsieh@matrox.com>
    Re: Perl Keeps reading the A: drive (Bart Lateur)
    Re: Perl scripts written for UNIX. Will they work on NT (ICG's opinionated tripe)
    Re: Perl v C (Abigail)
    Re: Perl v C <zenin@bawdycaste.org>
        Please can we stop this PIII thread RIGHT HERE? As it's <binary@eton.powernet.co.uk>
    Re: Please can we stop this PIII thread RIGHT HERE? As  (Kenny A. Chaffin)
    Re: RAD or WYSIWIG for Perl ??? (Damian Conway)
    Re: Segmentation Fault (Abigail)
    Re: Sendmail and Cc: field (brian d foy)
    Re: Setting LD_LIBRARY_PATH inside perl script (Abigail)
    Re: Shopping Cart with Email Encryption? <westmj@esvax.dnet.dupont.com>
    Re: The need for speed <sugalskd@netserve.ous.edu>
    Re: Two questions (Abigail)
    Re: Two questions <jim@*nospam*network-2001.com>
    Re: unlink a filename with spaces (Abigail)
        Why are unresolved refs not reported? <mymail@nospam.com>
    Re: Why are unresolved refs not reported? (brian d foy)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 15 Mar 1999 20:40:05 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: 2d-array sort
Message-Id: <7cjr74$fif$1@nnrp1.dejanews.com>

In article <7cdni1$f4k$1@nnrp1.dejanews.com>,
  Stefan@Stark.net wrote:

> I have an array which looks like this: @Data1 = ( ( "1", "Hans", "Hamburg" ),
> ( "5", "Maria", "Mainz" ), ("2", "Fred", "Frankfurt" ) );

That is not the way to construct a List of Lists (or 2D arrays). Check out
perldsc for a good introduction to data structures in Perl.

Your above construct will flatten your array into 1-D array. What you want is:

@Data1 = (
		["1", "Hans", "Hamburg],
		["5", "Maria", "Mainz"],
		["2", "Fred", "Frankfurt"],
	);

> Now I want to write a piece of source which sorts the array so that the result
> looks like this:
> @Data1 = ( ( "1", "Hans", "Hamburg" ), ("2", "Fred", "Frankfurt" ), ( "5",
> "Maria", "Mainz" ) );

So you want to sort on the first element of the inner arrays.

@sorted = sort { $a->[0] <=> $b->[0] } @Data1;

Type 'perldoc -f sort' in any empty window for more information.

HTH,
--Ala

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Tue, 16 Mar 1999 08:31:12 +1300
From: Meh <aghaeim@genesis.co.nz>
Subject: Re: CGI form that calcs order form totals?
Message-Id: <36ED6000.5ED30165@genesis.co.nz>

Tim Ware wrote:
> 
> Hello,
> 
> Does anyone know of a script that will handle the simple math of an online
> order form? The form is located at:
> 
> www.metronomeballroom.com/registration2.html
> 
> Please copy response to: tim@hyperarts.com
> 
> Thanks.
> 
> Tim Ware

The easiest way is to use a piece of Javascript code to calculate what
you want and add a calculate button to your web page.



---------------------------------------------------------------------
Protect privacy, boycott Intel PIII: http://www.bigbrotherinside.org
---------------------------------------------------------------------


------------------------------

Date: Mon, 15 Mar 1999 19:47:18 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Datastream API Problem Help!
Message-Id: <36ee619e.879568@news.skynet.be>

Dimensions wrote:

>Unfortunately, I do not have rights to install perl libraries on the server
>that is hosting my site, only access to my CGI-BIN.
>
>Any other suggestion?

I think this is a FAQ. Check your documentation, or the docs on
<www.perl.com>. (perlfaq8)

Create a subdirectory "lib" in your cgi-bin, and add this to the front
of all of your scripts:

	use lib "./lib";

This will add the path to that directory to Perl's search path. place
your added LIB hierarchy in there.

If the lib library isn't on your server, there are also some somewhat
less clean ways of achieving this (changing @INC directly in a BEGIN
block).

   HTH,
   Bart.


------------------------------

Date: Mon, 15 Mar 1999 11:34:17 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: does perl discourage obfuscated code? (was Re: Perl evangelism)
Message-Id: <36ED60B9.C9783667@atrieva.com>

Russell Schulz wrote:
> 
> Jerome O'Neil <jeromeo@atrieva.com> writes:
> > Perl allows one to write *more* readable code.
> 
> I already said I agreed to this.  why did you feel I didn't agree?

Because of statements like this:

Russell> I believe it.  Perl encourages hard-to-read code.  that's
Russell> just the way it is, and if you don't apply a strong
Russell> discipline when writing Perl, you're going to be the proud
Russell> owner of a ton of [write]-only code.

> > Unreadable code is a function of undisciplined programmers.  Perl has
> > nothing to do with it, other than to say "Of the code generated by any
> > given programmer P, of discipline D, Perl's readability R will usually
> > be higher."
> 
> you state this as fact, with nothing to back it up.

Certainly I do.  The same things that "back-up" your contentions.  My
experience with Other Peoples Code, and Other Programmers.

> obviously, I disagree with this: 
> that Perl code's readability will be
> higher than other code in general (usually). 
 
Clearly.
 
> why?  partly because Perl relies heavily on $\$punctuation[@_] to convey
> meaning that other languages would leave to text.

Perl can rely on concise punctuation.  When one knows the language, they
are easily understood constructs.  Perl can also rely on verbose
punctuation, should the programmer so wish.

> partly because Perl
> is powerful in ways that are concise; I have sat down with a big regex
> and emulated a finite state machine in my head (and on paper) to attempt
> enlightenment about what some 40-char non-/x (a non-obfuscating yet
> still new feature) regex is trying to do.  or is actually doing, when it
> doesn't do what the comments say it is trying to do.  (haven't you?)

You will hear no arguments from me that regular expressions are not
obfuscatable, or obfuscated.  However, they are equally as obfuscated in
C, Java, JavaScript, sed, or any other language that supports them. 
This is not a perl problem.  It's a regex problem.

> partly because Perl is trying to DWIM on things, and it hides the fact
> that $_ is not available at a particular place in a loop,

$_'s behavior is well documented, and easily understood.  You're asking
the "Why don't the French understand Russian?" question.

> or that `while (0)' is the same as `while (1)',

Run this, and then clarify your statements, because you lost me here.

#!/usr/local/bin/perl
while(0){
        print qq{I'm in a 0 loop\n};
	die "Sick to death of while(0)\n";
}

#
# Does while(0) == while(1)?
#

while(1){
        print qq{I'm in a 1 loop\n};
}

> or that sin / 3 vs. print / 3 example Randal loves to supply when talking
> about syntax-highlighting editors.

I'm not familiar with the example, but I'd wager beer that it is easily
understood and documented.

> partly because I've worked with Perl code that is unintentionally
> obfuscated, from people I know who don't write hard-to-read code in
> other languages.

Here lies the rub.  I've worked with Perl code that is easily
understood, written by people that don't have a good grasp on all things
perly, but otherwise write good code in other languages.  Almost the
exact opposite of your experience.

So, Why the difference?

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


------------------------------

Date: Mon, 15 Mar 1999 13:52:36 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: mmartina@my-dejanews.com
Subject: Re: Finding end of line
Message-Id: <36ED56F4.79438C9B@giss.nasa.gov>

[courtesy copy of post sent to cited author]

mmartina@my-dejanews.com wrote:
> 
> I an trying to scan characters in one at a time using getc().  This is working
> but I an unable to determine when I hit the end of line character.  I am
> running perl5 on a HP Unix machine.  Any suggestions.

you must have "perldoc" on your system, neh?

$ perldoc -f getc

What do you mean by "end of line character"?
Is that the "end of file" or simply newline, "\n" ?

while (defined (my $char = getc(STDIN))) {
    print "newline\n" if $char eq "\n";
    # do stuff with $char
}
print "end of file\n";

	Jay Glascoe
--  
"Just say 'Poit!'"
  --Pinky


------------------------------

Date: Mon, 15 Mar 1999 20:09:04 GMT
From: edward@echarge.com
Subject: Help: Conditional use of packages in Perl
Message-Id: <7cjpcn$ds5$1@nnrp1.dejanews.com>

Hi all,

I've got a strange problem that I hope somebody can help me with.  I'm trying
to find some way to conditionally include particular packages in Perl.	I
tried something like the following but it didn't work.

if (condition is true)
  use package1;
else
  use package2;

It appears that Perl simply ignores the if statements and imports both
packages regardless.  Please let me know if anyone has a solution.  Thanks in
advance.

Edward.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 15 Mar 1999 13:30:54 -0700
From: "Martynas Grazulis" <teamfm@yyhome.com>
Subject: I want to run win32 program by running CGI under winNT
Message-Id: <7cjqhb$s4$1@news.xmission.com>

Please help me!!!

    I have created exe file (this is windows program not dos) to update
database and i want to run this program from my cgi perl script.
    I have tryed to run may script with system() function from ms-dos
prompt, it works fine, but it doesnot work throught cgi.
    Just show me how to run any win32 program on server side by using CGI.

    Thank you!

    Sorry for my english.






------------------------------

Date: Mon, 15 Mar 1999 19:19:07 GMT
From: swamichandra@my-dejanews.com
Subject: Re: IDE for Perl
Message-Id: <7cjmev$b5a$1@nnrp1.dejanews.com>

Thanks for the detailed reply Mr. Jim. I'm developiing applications in
Solaris environment. So I was looking out for solaris based IDE's. I'll keep
hunting !!

//Swami.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 15 Mar 1999 11:58:57 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: inv. cos
Message-Id: <36ED6681.8FFE1271@mail.cor.epa.gov>

Didn't I mention Math::Trig?  Hmm.. let's see what I said...
Nope.  Oops.  BTW, you might want to send a note to 
perlfaq-suggestions so they add it into the FAQ.  It's not in
there either (at least not in  my copy).

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 15 Mar 1999 22:19:36 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: inv. cos
Message-Id: <oeehfrmcxpj.fsf@alpha.hut.fi>


"David L. Cassell" <cassell@mail.cor.epa.gov> writes:

> Didn't I mention Math::Trig?  Hmm.. let's see what I said...
> Nope.  Oops.  BTW, you might want to send a note to 
> perlfaq-suggestions so they add it into the FAQ.  It's not in
> there either (at least not in  my copy).

Consider upgrading, it's in there, in my copy which is Perl 5.005_02.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


------------------------------

Date: 15 Mar 1999 19:43:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: loading code only if it is needed
Message-Id: <7cjntm$57t$1@client2.news.psi.net>

Kevin Howe (khowe@performance-net.com) wrote on MMXXI September MCMXCIII
in <URL:news:q7SG2.13205$134.128694@tor-nn1.netcom.ca>:
\\ 
\\ What I want is to ensure that ONLY THE CODE THAT IS NEEDED GETS LOADED.


Look into the Autoloader module.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


------------------------------

Date: 15 Mar 1999 19:44:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: localtime
Message-Id: <7cjnuc$57t$2@client2.news.psi.net>

Jennifer (webmaster@momsathome.on.ca) wrote on MMXXI September MCMXCIII
in <URL:news:7cfgsk$sq5$1@nnrp1.dejanews.com>:
{} Could someone tell me what the last element in localtime is?


The manual can.



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


------------------------------

Date: 15 Mar 1999 20:18:42 GMT
From: hjeeves@us.ibm.com (Helena Jeeves)
Subject: Re: Memory management & Perl to C extensions
Message-Id: <7cjpv2$p26$1@poknews.pok.ibm.com>

In article <Arved_37-1103990652200001@dyip-113.chebucto.ns.ca>, 
Arved_37@chebucto.ns.ca says...
>
>In article <7c7619$g9q$1@mathserv.mps.ohio-state.edu>,
>ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>
>> [A complimentary Cc of this posting was sent to Helena Jeeves
>> <hjeeves@us.ibm.com>],
>> who wrote in article <7c727a$pv6$1@poknews.pok.ibm.com>:
>> > I have been trying to model C structures using Perl
>> > Classes in the extensions. The memory management
>> > has been heinous so far, is there anyone who could
>> > give me tips as to how to better see what Perl
>> > is doing to manage memory, and perhaps get more
>> > control over it?
>> 
>> Perl is not going to manage memory for you.  You need to keep REFCNT
>> and count-of-mortality correct at all times you create or destroy
>> things.  Devel::Peek is you friend too.
>
>I could be wrong, but just to clarify, I think what the lady is saying is
>that she is *not* using C at all. She's trying to mimic C structures, but
>everything she's writing is pure, unadulterated 100% Perl.
>
>In which case, I'd assume that the C structures being modelled are just
>run-of-the-mill blessed hash refs.
>
>Arved

No, not necessarily run of the mill. Yes, is a blessed object.
I was following the examples from the CookBookA and B offerings
from the CPAN, trying to put a wrapper around a C structure.

Devel::Peek doesn't tell me anything about the contents of 
a blessed object. It tells me what KIND of blessed object I
have, but I haven't figured out how to get it to tell me
anything else. I have to use the 'get' methods I wrote for my
routine.

As a further to this problem, I have cleaned up the variable
usage considerable, I have ended up making all the extension
structures/blessed objects in question global (which goes 
against my morals, but it's the only thing that runs
consistently.) I found out early on that using any of these
variables in a 'my' context meant their memory space was
not repsected in the least, and that I lost more than half
the data returned from the call to the C program.

Ok, so after tidying, I have a program that runs.  If I
run it through the debugger using

env "PERLDB_OPTS=f=6 N" perl -d <routine call> 

then it dies on trying to access one of the extension structures.
If I use f=5, it runs. Anything larger than f=16 (ie, f=16)
dies on the same structure. Oh, unless I put a print statment
in just after the structure is accessed, then it will get
past that point.

Does anyone else have problems like this??

Thanks again

Helena



------------------------------

Date: Mon, 15 Mar 1999 13:17:07 -0600
From: "Jim" <jim@*nospam*network-2001.com>
Subject: Re: need better way to print external file withen perl file
Message-Id: <7cjmlb$tlp$1@news3.infoave.net>

Thanks much, but the
only problem with that is that I have multiple $blah's .. $blah1 $blah2
etc and I dont want to have to manually add each one into that. it
actually reads those from a separate "configuration" file, I need to be
able to change and add there.

I am just starting with perl, I cant find any good resources on the net
and I'm still waiting on my perl/cgi cookbook from amazon so I'm just
stumbling in the dark here, sorry to ask so easy/stupid questions.

Thanks for any help..
--
Jim
-)(-
Sami Rosenblad wrote in message ...
>In article <7cjcgq$etc$1@news3.infoave.net>, "Jim"
><jim@*nospam*network-2001.com> wrote:
>
>> I need a better way to print an external file within a perl file
please.
>>
>> here's what I have now:
>>
>> $blah="ttt" ;
>> print "Content-type: text/html\n\n" ;
>> print eval `cat "usr/path/of/file/nameoffile.txt"` ;
>>
>> that will output all the text withen the file "nameoffile.txt" and
>> replace's all
>> $blah's with ttt --- it works great, except the nameoftextfile.txt
has
>> to be treated
>> as perl (putting  \ in front of all @ signs and quotations).  also
the
>> file has to have
>> " at the beginning and " at the end.  Is there a better way to do
this
>> similar to this:
>>
>> print <<__END__ ;
>> contents of text file recognized like they are here
>> __END__
>
>I don't understand the use of eval() here... try this for size:
>
>#!/usr/bin/perl -w                      # always use -w !
>
>$blah = "ttt";
>print "Content-type: text/html\n\n";
>open FILE, "testfile" or die "$!";      # always check if open
succeeded
>while (<FILE>) {
>        s/\$blah\b/$blah/ge;            # \b prevents $blahschemy from
matching
>        print;
>}
>close FILE;
>
>--
>blade@leela.janton.fi




------------------------------

Date: Mon, 15 Mar 1999 18:51:55 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Newbish Prob - Output to File
Message-Id: <7cjks5$9rp$1@nnrp1.dejanews.com>

In article <7cdif9$t7b$1@news-1.news.gte.net>,
  "Timothy Cember" <timothy.cember@gte.net> wrote:

> Well, I'm trying to write program to run on a remote NT server that'll
> output to html/text files.  (I'd be done already if I was using C++)

why didn't you then?

> $save = </demosite/options.txt>;

Do you have any idea what this does? It returns a list of files that match the
file name pattern you specified. Luckily, you get the correct value saved into
$save, but you should've done the following:

$save = '/demosite/options.txt';

> open(SAVE, ">$save");

Always check to see whether open() succeeded or not:

open SAVE, ">$save" or die "Couldn't create '$save': $!\n";

> print SAVE "Content-type: text/html\n\n";
> print SAVE "Yadda yadda \printn";
>
> It compiles, no errors pop-up, you'd think everything was fine, but the data
> never makes it to the file.

If the open() succeeds, I see no reason for failure.

> Does it matter that I've got
> use Socket;
> instead of
> use Strict;
> at the top of the script?  Prog takes input from HTML form.

First of all, 'use Strict;' doesn't exist. It shouldn't even compile. Perl is
case sensitive. It is supposed to be 'use strict;' Second of all, strict and
Socket are two different things. You should have 'use strict;' always (for
now at least). 'use Socket;' is needed only if you need to use sockets .. do
you?

> Thanks...I hope to get good enough to help others in the future

Please revise your program, and let us know what happens.
HTH,

--Ala

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 15 Mar 1999 19:11:35 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: open port from behind firewall, with no proxy
Message-Id: <7cjm0t$auk$1@nnrp1.dejanews.com>

In article <36ECA499.87AB327A@spamtrap.dynamite.com.au>,
  Paulboldra <pbolda@spamtrap.dynamite.com.au> wrote:
> Hello,
> My TCP/IP grounding isn't too good, but I've put together a simple http
> client which I need to run on a solaris box.  Solaris on this box has
> been patched by 'ip filter' (
> http://coombs.anu.edu.au/ipfilter/ip-filter.html ) to only allow
> connections on specified ports.
>
> So now I can't run my http client, since the port replies are sent to is
> randomly allocated by the OS.  Can anyone suggest a way to get my http
> client to create sockets only on a pre-determined port number?  I have
> found ways to do this for a server, but how does it work if you're a
> client?

Unless that 'ip filter' thing is doing something VERY funky in the kenel, it's
unlikely that it's to blame for your script's failure.  Have you verified that
the script works on an unpatched Unix?

If a kernel hack (or a firewall) prevents the creation of dynamic source ports
for TCP connections, most IP software would die horribly.  Can you telnet from
that machine to another?  Try downloading lynx and seeing if that works.

Finally, post some code, (not too large ...) and describe its behavior in your
situation.  We may be able to see something you've missed.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 15 Mar 1999 20:22:32 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Output to file - Thanks - but it still don't work!
Message-Id: <7cjq5t$eos$1@nnrp1.dejanews.com>

In article <7cdm0u$od2$1@news-1.news.gte.net>,
  "Timothy Cember" <timothy.cember@gte.net> wrote:
>
>
> $save = "/demosite/options.txt";
> open(SAVE, ">$save");
> print SAVE "Content-type: text/html\n\n";
> print SAVE "Yadda yadda \n";
>
> I made the change you reccomended but it still doesn't work. (?)
> Could I be missing something elsewhere?

Probably, it also could be due to output buffering. Do you have permissions to
write to /demosite ??
Do you explicitly close() the filehandle? You should also check whether your
open() succeeded or not.
You can also add:

$| = 1;

at the top of your script to disable buffering. As a last resort, just
extract the above lines into a separate file, run it from the command line,
and let us know what happens.

--Ala

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Mon, 15 Mar 1999 19:37:42 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Keeps reading the A: drive
Message-Id: <36ed6099.619389@news.skynet.be>

gthia@rocketmail.com wrote:

>After creating a perl program and run it in
>Win95 (using Perl for Win32 Build 316),  my
>floppy drive keeps spinning first and then
>starts the normal execution of the perl program.

Has this always happened? If this is a recent change...

Did you recently run a program from the floppy, or is an Explorer window
open on the floppy? That could cause this to happen. In a way, it is as
if the floppy drive has been added to PATH. Not actually, but "as if".
Try closing the window on the floppy, or in similar ways, close
references to the floppy.

Also, I have once seen this effect because someone ran WINZIP from a
floopy. That did an "install" of the WinZIP executable on the floppy
drive, which ALWAYS caused this to happen, and not just the Perl
executable. A *proper* de-install did the trick.

   HTH,
   Bart.


------------------------------

Date: Mon, 15 Mar 99 19:05:11 GMT
From: postmaster@uu.net (ICG's opinionated tripe)
Subject: Re: Perl scripts written for UNIX. Will they work on NT?
Message-Id: <7cjpdp$ojn@world6.bellatlantic.net>

In article <920998806.27852.0.nnrp-11.c1ed40e5@news.demon.co.uk>, "Chris" <chris.ball@spsg.org> wrote:
>Can you help?  We are about to move our web site from a UNIX server to one
>running Windows NT 4.0.  Does anyone know if we will encounter any problems
>with our Perl scripts when we move them over? (these are currently used to
>accomplish tasks such as; Logging information, updating pages, and managing
>a chat room).
>
>also,
>
>If their is going to be a problem with compatibility, then will the perl
>scripts need significant alterations, or is as simple as changing the file
>names/references?
>
>I would really appreciate any help regarding this problem.

Not any help, but a lot of opinion.  We made this same shift two years ago.  
We run a win32 port of Perl, and I will not touch it.  The other sysops use 
it, but I insisted on keeping a Linux box on the network just so I could 
script in Perl's natural environment.  There are a few things that you 
couldn't do in the NT version of perl that I could knock out with a single 
system call in Linux's Perl.  I'm sure the newer versions of windows Perl have 
probably taken care of most of them.  Now, 2 years later, our most powerful 
scripts run under Linux Perl.  (Forms and Mailback routines, Port monitors, 
SNMP query and graphing, User status.  All using TCP/IP/SNMP calls to the 
different machines in the network, and no clunky NT port of cron needed!)  The 
only thing we have in the Win32 version is a page counter.  

Just my opinion. 


------------------------------

Date: 15 Mar 1999 19:49:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl v C
Message-Id: <7cjo7o$57t$3@client2.news.psi.net>

Clinton Gormley (cgormley@netcomuk.co.uk) wrote on MMXXII September
MCMXCIII in <URL:news:7cj92e$1ms$1@taliesin.netcom.net.uk>:
&& 
&& What I'm getting to is this : In developing applications, does the speed
&& limitation imposed on Perl because of the need to translate result in an
&& eventual switch to rewriting everything in C when the application becomes
&& too complex?
&& 
&& Or have i missed the point?


No. If you really have something that's very time critical, and you are
sure you cannot squeeze anything out of Perl, you can consider rewriting
in C. But you are wrong that you have to rewrite everything in C. 
Profile what you bottlenecks are, and rewrite only that part in C.

And if the startup/compile times of Perl are killing you, you're doing
something wrong.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


------------------------------

Date: 15 Mar 1999 20:28:37 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl v C
Message-Id: <921530000.449535@thrush.omix.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
	>snip<
: Depends. Number crunching etc. will be quite a bit slower in Perl.

	In pure Perl, yes.  But you'd be surprised what a little XS code
	will get you.  See PDL, the Perl Data Language: pdl.perl.org

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


------------------------------

Date: 15 Mar 1999 19:07:19 GMT
From: "Richard Heathfield" <binary@eton.powernet.co.uk>
Subject: Please can we stop this PIII thread RIGHT HERE? As it's off-topic for everybody!
Message-Id: <01be6f1a$1298f700$2a01a8c0@arc7>

Subject line says it all - we've been through this subject ad nauseam
already, after all.



------------------------------

Date: Mon, 15 Mar 1999 12:51:05 -0700
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: Please can we stop this PIII thread RIGHT HERE? As it's off-topic for everybody!
Message-Id: <MPG.11571293ba464bb998a99a@news.dimensional.com>

In article <01be6f1a$1298f700$2a01a8c0@arc7>, binary@eton.powernet.co.uk 
says...
> Subject line says it all - we've been through this subject ad nauseam
> already, after all.
> 
> 

you must be from the .c newsgroup.....

-- 
KAC Website Design
Custom Programming, Web Design, and Graphics
kenny@kacweb.com    -     http://www.kacweb.com


------------------------------

Date: 15 Mar 1999 19:19:45 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: RAD or WYSIWIG for Perl ???
Message-Id: <7cjmgh$fos$1@towncrier.cc.monash.edu.au>

In article <7cgn67$qkb$1@samsara0.mindspring.com>, "Steve Davis"
<stevo@steve.com> wrote:

> RAD or WYSIWIG for Perl ???
> 
> Does it exist??

LlamaCard is coming!

(contact awigley@cs.monash.edu.au if you're interested).

Damian


------------------------------

Date: 15 Mar 1999 19:50:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Segmentation Fault
Message-Id: <7cjoaa$57t$4@client2.news.psi.net>

Bill Moseley (moseley@best.com) wrote on MMXXI September MCMXCIII in
<URL:news:MPG.1155e8fabac20a339896db@206.184.139.132>:
!! I have a Perl CGI script that redirects STDERR to a log file.
!! 
!! I have 'Segmentation Fault' entered in my log file on a line by itself.  
!! No other helpful info was provided.  It doesn't show up very often.
!! 
!! Anyone know what I'm being told?  Is that a perl problem, and anything I 
!! can fix within my script?


How should we know? You don't give any information, except for a line
without context in soem log file.




Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


------------------------------

Date: Mon, 15 Mar 1999 15:43:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Sendmail and Cc: field
Message-Id: <comdog-ya02408000R1503991543430001@news.panix.com>

In article <7cj8k6$tlg$1@nnrp1.dejanews.com>, dragnovich@my-dejanews.com posted:

> Well I sugest you not to use SENDMAIL program for your rutine, is better to
> use perl rutines/modules for sendng mail. Something like this

define "better".  i've yet to see anything Perl-ish that i would use
for a robust MTA.  of course, people will have their own opinions
about sendmail, but it's a lot more than opening a port and sending
data.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


------------------------------

Date: 15 Mar 1999 19:51:00 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <7cjob4$57t$5@client2.news.psi.net>

lathropj@elite.net (lathropj@elite.net) wrote on MMXXI September MCMXCIII
in <URL:news:7chcq4$p64$1@berry.elite.net>:
\\ How can I set LD_LIBRARY_PATH inside perl script?


man perlvar



Abigail
-- 
perl -wlne '}print$.;{' file  # Count the number of lines.


------------------------------

Date: 15 Mar 1999 19:46:12 GMT
From: Mike West <westmj@esvax.dnet.dupont.com>
Subject: Re: Shopping Cart with Email Encryption?
Message-Id: <7cjo24$lu3@topgun.es.dupont.com>

In article <36e88e48.12933846@news.vnet.net> Brantley Smith, 
 mtbdude1999@yahoo.com writes:
 
>Does anyone know of a PERL Shopping Cart program that encrypts order
>data before sending to the merchant?

  As usual, it appears the free program "MiniVend" has it.

  http://www.minivend.com/iri/features.html

  "PGP support for secure off-site mailing of orders"

Regards from a satisfied user...  Mike West


------------------------------

Date: 15 Mar 1999 19:02:02 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: The need for speed
Message-Id: <7cjlfa$d3$1@news.NERO.NET>

Dave McIntyre <davem@nortak.com> wrote:
: Does operating in binary mode significantly slow
: down Perl?

Nope, it won't.

: I have a 600 MB file filled with various
: COBOL control chars. from which I must build an index file.

This will, though. (See below)

: The algorithm I've written is reasonably complex (for me)
: using six hashes of arrays which all must be sorted.
: It works, but it took 34 hours! M'gmt is not impressed.
: So I'm looking for ways to speed this up. Gone thru the
: efficiency tips in the Camel, but the big problem, I think,
: is operating in binmode.  Some specific questions:

: What are the file size limitations when doing:
: @records =<FILE>; (I'm using while (<FILE>)
: but wondering if I should switch).

This is what's gonna kill you, You're reading in 600M of data in one
slurp--that'll take up 600M + ~22bytes/line. This one statement alone will
probably eat around 765M, assuming 80 bytes/line, not counting anything
else you might be doing with the data. If you stick it all in hashes,
count on another 765M+ chunk. Odds are your performace hit's almost
entirely due to swapping.

With this much data, you really need a DBMS of some sort if you want
reasonable performance doing complex sort things. (or lots and lots of
RAM...)  You might want to consider going with one of 'em. Perl's
sorting's geared to the cases where you've got enough memory to hold
everything--once you start swapping, performance goes downhill. (There are
better ways to sort if you're guaranteed disk access anway)

					Dan



------------------------------

Date: 15 Mar 1999 19:53:19 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Two questions
Message-Id: <7cjoff$57t$6@client2.news.psi.net>

Jim (syt@email*@sp\am|@|spa/m@*.com) wrote on MMXXII September MCMXCIII
in <URL:news:7chtjv$e09$1@news3.infoave.net>:
|| #1 is there a way to make a perl script open a seperate file and see that
|| text as an actual part of the perl script? I'm sure it is, but how.

do

|| #2 is is better to use one perl script for everything on a site or to break
|| it up into smaller scripts that perform the seperate functions?


Define "better". Define "everything". Define "site".



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


------------------------------

Date: Mon, 15 Mar 1999 14:57:44 -0600
From: "Jim" <jim@*nospam*network-2001.com>
Subject: Re: Two questions
Message-Id: <7cjs82$rbh$1@news3.infoave.net>

Abigail wrote in message <7cjoff$57t$6@client2.news.psi.net>...
>Jim (syt@email*@sp\am|@|spa/m@*.com) wrote on MMXXII September MCMXCIII
>in <URL:news:7chtjv$e09$1@news3.infoave.net>:
>|| #1 is there a way to make a perl script open a seperate file and see
that
>|| text as an actual part of the perl script? I'm sure it is, but how.
>
>do
Thanks, already discovered that but cant find any site describing the
correct syntax, I can only get it to recognize one argument in the
external file... guess I'll have to sit and wait until amazon.com
delivers my books
>
>|| #2 is is better to use one perl script for everything on a site or
to break
>|| it up into smaller scripts that perform the seperate functions?
>
>
>Define "better". Define "everything". Define "site".
>
better=.. let me rephrase that, is it : faster or slower, higher or
lower server load, and more buggy or less buggy

everything=what you phisically can interact with on a website, from
dynamically generated html pages, to counters, to sql search engine
site=every accessable page at a url

>
>Abigail


--Jim

btw: <joking>nice graphics on your website, a little too bright
though</joking>




------------------------------

Date: 15 Mar 1999 20:22:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: unlink a filename with spaces
Message-Id: <7cjq5h$5e2$1@client2.news.psi.net>

aonghus.onia@ucg.ie (aonghus.onia@ucg.ie) wrote on MMXXII September
MCMXCIII in <URL:news:7cilgq$dm5$1@nnrp1.dejanews.com>:
\\ is it possible to unlink a file with a name ($file) that contains spaces


Did you try?



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


------------------------------

Date: Mon, 15 Mar 1999 14:41:30 -0500
From: JPAH-FLA <mymail@nospam.com>
Subject: Why are unresolved refs not reported?
Message-Id: <36ED626A.8EA9539@nospam.com>

Using "perl -w myprog" which also has "use strict;" embedded, I find
that perl doesn't report unresolved references to external package
calls. For example:

(main.pl)
use strict;
  .
  .
 externalpkg::subx();
exit 0;

-------------------------------------------------------
(external.pl)
package externalpkg;
  sub suby
  {
  }

1;

------------------------------------------------

produces no warnings or errors at all. It seems that it should warn that
subx is an unresolved reference. Instead, it seems to ignore the line
completely. Seems like an unexpected and undesirable behavior.

Any ideas on how to make perl warn for this case? Any idea of why it
wouldn't?

Cheers!
E



------------------------------

Date: Mon, 15 Mar 1999 15:48:09 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why are unresolved refs not reported?
Message-Id: <comdog-ya02408000R1503991548090001@news.panix.com>

In article <36ED626A.8EA9539@nospam.com>, JPAH-FLA <mymail@nospam.com> posted:

> use strict;

>  externalpkg::subx();

> package externalpkg;
>   sub suby
>   {
>   }

> produces no warnings or errors at all. It seems that it should warn that
> subx is an unresolved reference. Instead, it seems to ignore the line
> completely. Seems like an unexpected and undesirable behavior.

would you rather predeclare all of your subroutines?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5140
**************************************

home help back first fref pref prev next nref lref last post