[8522] in Perl-Users-Digest
Perl-Users Digest, Issue: 2139 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 19 18:07:43 1998
Date: Thu, 19 Mar 98 15:00:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 19 Mar 1998 Volume: 8 Number: 2139
Today's topics:
Re: [Q] MacPerl - How to use libraries? dermod@no.spam.leeds.ac.uk
Re: Appropriate or not ? <ebohlman@netcom.com>
Re: Are There Any Snazzy Perl Editors for Windows? <gordm@iname.com>
Arrays & hashes <infinity@gamersinn.com>
Re: Arrays & hashes <ebohlman@netcom.com>
Re: Arrays & hashes <jdf@pobox.com>
Re: Assign lines of a text file into an array <ebohlman@netcom.com>
Re: Backreference problem <jkry3025@comenius.ms.mff.cuni.cz>
Re: Backreference problem <dboorstein@shopcfn.com>
Re: Backreference problem <dboorstein@shopcfn.com>
Bar-B-Q -chef
Help please??! <ste.d@virgin.net>
Help with Formats (Samuel G. Williams)
Re: Help with Formats <ebohlman@netcom.com>
Re: How do you create a directory? Please enlighten!? (Kevin B Cohen)
How to.. <oostveen@synnetry.nl>
Newbie question: using split() while ignoring regexps <nbouton@unixg.ubc.ca>
Re: Newbie question: using split() while ignoring regex <ebohlman@netcom.com>
Re: Newbie question: using split() while ignoring regex <jdf@pobox.com>
Re: Newbie question: using split() while ignoring regex <quentin@jihad.amd.com>
Re: oraperl ref books?? (John D Groenveld)
Re: Perl for DOS/Windows 3.x (gaj)
perl script won't work as cgi <brian.charles@orst.edu>
Re: perl script won't work as cgi <fozz@mail.xmission.com>
Re: Perl5 compile error (Jeff Henry)
Re: please help ... sending attachments via pop3 and pe <jkry3025@comenius.ms.mff.cuni.cz>
Problem opening very large file with Perl 5.004 on Sola (Ronan Cremin)
Re: Problem with "goto" in Perl <Rosie@dozyrosy.demon.co.uk>
Selling Perl applications effectively <fozz@mail.xmission.com>
Re: Splitting Arrays/Variables (Jeff Henry)
uncompressing libwww-perl (Kevin B Cohen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Mar 1998 21:33:18 +0000 (GMT)
From: dermod@no.spam.leeds.ac.uk
Subject: Re: [Q] MacPerl - How to use libraries?
Message-Id: <3511FF28.3EBA@no.spam>
> Is the folder ":MacPerl :lib:" one of the entries? If not, discard
> your MacPerl preferences and start over.
Without wishing to speak to disprove what Paul Schinder wrote, another
useful step is to check the Lib paths in the Preferences Menu item.
Ben.
------------------------------
Date: Thu, 19 Mar 1998 20:24:51 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Appropriate or not ?
Message-Id: <ebohlmanEq321F.Gzq@netcom.com>
Birgitt Funk <birgitt@order.booktraders.com> wrote:
: Is it appropriate for a beginner who has written his first Perl
: programs,
: he needs to use for his own business purposes (meaning they absolutely
: need to work safely and correctly), to ask experts to test the programs
: and eventually make suggestions how to systematically debug them and
: make them safer ?
Yes. A big part of wisdom is realizing that you're not infallible and
being willing to ask for help *after you've done all you're capable of
doing*.
: How is this done among professionals ? Is the request for something like
: thing of a magnitude that a one time work contract is appropriate or
: does this fall under "peanuts" for experts and is not worth to be looked
: at ?
Impossible to answer without more information. Generally, though,
testing is one of the more time-intensive parts of program development,
and to most developers it's a lot less fun than requirements analysis,
design or coding. If someone is going to do a truly thorough test (and
if your business depends on the software, half-assed testing is worse
than none at all because it will give you a false sense of security),
they're going to have to commit a non-trivial amount of time. There may
be some people willing to do this as a labor of love if the type of
problem the software solves is something that strongly interests them.
: If a request like this would be posted here, would it be considered
: "getting a lunch for free" (I am not asking for writing a program,
: just for testing one, which is written by an inexperienced beginner)
: and punished with flames, or is it acceptable.
If you post the request *once* and make it clear that you know that you're
basically begging, you probably won't get too many hostile responses.
You'll probably get a number of calm, rational responses suggesting that
you're in over your head. You might find one or two people who are
interested. If you hook up with someone, take it private rather than
using the newsgroup for further communications.
: I have a lot of Perl programs on my server written by an expert, whose
: code is left under the GNU Public License and which I will use to learn
: Perl.
: I am scared to add my own first code snippets and scripts for some
: little customized applications I need on basis of his huge program.
: What is the appropriate way to get it tested for safety ?
: (I know of course that I could ask the expert to do it and pay him,
: but the question is asked here under the assumption that my bank
: account doesn't allow this option or that this work is not a desirable
: work for an expert to deal with.)
You might be able to work out a trade arrangement. Or you might contact
the CS department at your local college or university and see if you
could work out an arrangement where an advanced student makes an
independent-study project out of the testing.
Before doing anything else, though, figure out how much money you could
lose if your program didn't work. If it's more than you could afford to
pay to an expert, you're better off doing without the progam.
------------------------------
Date: Thu, 19 Mar 1998 20:21:49 GMT
From: Gordon McDorman <gordm@iname.com>
To: "Alexander Petrosyan (PAF)" <paf@design.ru>
Subject: Re: Are There Any Snazzy Perl Editors for Windows?
Message-Id: <uvhtaig82.fsf@iname.com>
>>>>> "AP" == Alexander Petrosyan (PAF) <paf@design.ru> writes:
AP> - But I've leard that under UNIX emac and vi editors can be
AP> configured so that one could step through the code right in
AP> debugger, so we get so-called IDE, but I never heard of such under
AP> windows.
This is possible with the Windows NT/95 version of Emacs. It
rocks.
See
http://www.cs.washington.edu/homes/voelker/ntemacs.html
for more information.
--
--------------------------------------------------------------
The opinions expressed above are my own.
gordm@iname.com
------------------------------
Date: Thu, 19 Mar 1998 15:27:36 -0500
From: Matt Burgoon <infinity@gamersinn.com>
Subject: Arrays & hashes
Message-Id: <35117FB8.383A80AA@gamersinn.com>
I have an array and hash set up like:
$accounts[0]{amount}=200;
$accounts[3]{paid_till}=890338928;
obviously each member of the array will have the same keys for it's
hash, since it's all just pulled from a database. I can pull these
values fine by looping through them and getting the data
$accounts[$_]{thiskey} but I've been trying to set a pointer to that
particular hash so I don't have to use that entire thing, ex:
*thishash=\%{ $accounts[$_] };
So I can simply pull up $thishash{amount} instead of
$accounts[$_]{amount}.
But that assignment isn't working I'm sorry to say. What is the correct
syntax for doing this? Any help/enlightenment/constructive slamming of
my missing the obvious/etc would be much appreciated.
Thanks,
Matt
------------------------------
Date: Thu, 19 Mar 1998 20:50:29 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Arrays & hashes
Message-Id: <ebohlmanEq3385.K0I@netcom.com>
Matt Burgoon <infinity@gamersinn.com> wrote:
: I have an array and hash set up like:
: $accounts[0]{amount}=200;
: $accounts[3]{paid_till}=890338928;
I.E. each element of your array is a reference to an anonymous hash/
: obviously each member of the array will have the same keys for it's
: hash, since it's all just pulled from a database. I can pull these
: values fine by looping through them and getting the data
: $accounts[$_]{thiskey} but I've been trying to set a pointer to that
: particular hash so I don't have to use that entire thing, ex:
: *thishash=\%{ $accounts[$_] };
: So I can simply pull up $thishash{amount} instead of
: $accounts[$_]{amount}.
You don't want to use a typeglob here. The key thing to remember is that
$accounts[$_] is a reference to a hash. A reference to anythingy is a
scalar. So "$thishash=$accounts[$_]" makes "$thishash" a reference to
the hash you're trying to work with. "$$thishash" is the actual hash, so
"$$thishash{amount}" is the value corresponding the the "amount" key in
the current hash (remember that dereferencing is done before
subscripting, so it's equivalent to "${$thishash}{amount}").
I'd suggest that you read perldata, perlref, perllol and perldsc to get a
better handle on how to work with complex data structures.
------------------------------
Date: 19 Mar 1998 16:18:38 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Arrays & hashes
Message-Id: <7m5qs7kh.fsf@news.concentric.net>
Matt Burgoon <infinity@gamersinn.com> writes:
> *thishash=\%{ $accounts[$_] };
Close:
%current_account = %{ $accounts[$_] };
A thorough read of perldata and perlref will get you there.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Thu, 19 Mar 1998 20:03:01 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Assign lines of a text file into an array
Message-Id: <ebohlmanEq3112.Er8@netcom.com>
James Ludlow <ludlow@us.ibm.com> wrote:
: Are you sure that this actually works? It seems that after sucking
: <FILE> into the array used as map's input, the value of "$." would be
: fixed at the value of the last line number in the file. So, wouldn't
: you end up assigning each line to the same key, which would leave you
: with a hash consisting of one value (the last line in the file)?
: Correct me if I'm wrong, please.
You're right and I was wrong. That'll teach me not to propose
cutesy-tricky solutions.
------------------------------
Date: Thu, 19 Mar 1998 20:59:52 -0800
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
To: frederic@xilinx.com
Subject: Re: Backreference problem
Message-Id: <3511F7C8.BFA@comenius.ms.mff.cuni.cz>
Frederic RIVOALLON wrote:
>
> Hello all,
>
> I would like to insert the string '01' before an underscore in a
> string so I wrote:
>
> $StringToBeChanged =~ s/(.*)_/$101_/;
There is no reason for the (.*). Try
$StringToBeChanged =~ s/_/01_/;
Also, you probably want to prepend all underscores not only the first.
If so use the /g switch :
$StringToBeChanged =~ s/_/01_/g;
> But this does not work perl must be looking for $101 instead of $1 and
> then 01.
>
>
> If you know the answer please email to frederic@xilinx.com
>
> Thanks
HTH, Jenda
------------------------------
Date: Thu, 19 Mar 1998 16:12:41 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
To: frederic@xilinx.com
Subject: Re: Backreference problem
Message-Id: <35118A49.AFC34BDF@shopcfn.com>
Frederic RIVOALLON wrote:
>
> Hello all,
>
> I would like to insert the string '01' before an underscore in a
> string so I wrote:
>
> $StringToBeChanged =~ s/(.*)_/$101_/;
>
> But this does not work perl must be looking for $101 instead of $1 and
> then 01.
> Is there a way to make this work without using a separate variable like
> this
indeed, there are several:
$StringToBeChanged =~ s/(.*)_/${1}01_/;
$StringToBeChanged =~ s/(.*)_/$1\Q01_/;
$StringToBeChanged =~ s/(.*)_/$1.'01_'/e;
i suggest a read of the perlre man page for explanations of these
methods.
hope this helps,
--
# dan boorstein <dboorstein@shopcfn.com>
seek DATA,0,0;print scalar<DATA>,__END__
Just another Perl hacker,
------------------------------
Date: Thu, 19 Mar 1998 16:24:48 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Backreference problem
Message-Id: <35118D20.2612101D@shopcfn.com>
Craig Berry wrote:
>
> Frederic RIVOALLON (frederic@xilinx.com) wrote:
> : I would like to insert the string '01' before an underscore in a
> : string so I wrote:
> :
> : $StringToBeChanged =~ s/(.*)_/$101_/;
> :
> : But this does not work perl must be looking for $101 instead of $1 and
> : then 01.
>
> Yes.
i think it is actually looking for '$101_'.
>
> Still better (in my view) is
>
> $StringToBeChanged =~ s/_/01_/;
>
> which removes the need for the match variable entirely.
perhaps it does, but it also changes the meaning of the regex. consider:
$StringToBeChanged = 'double_trouble_test';
--
# dan boorstein <dboorstein@shopcfn.com>
seek DATA,0,0;print scalar<DATA>,__END__
Just another Perl hacker,
------------------------------
Date: 19 Mar 1998 12:22:23 -0800
From: -chef
Subject: Bar-B-Q
Message-Id: <6erupv$e2k@drn.newsguy.com>
I was wondering if you all could come over for a Bar-B-Q?
-chef
------------------------------
Date: Thu, 19 Mar 1998 21:00:50 +0000
From: Steve Daniels <ste.d@virgin.net>
Subject: Help please??!
Message-Id: <35118781.D5ED4E5A@virgin.net>
I am trying to write a perl script to register users and to allow access
to a password protected HTML script. The HTML script sends data from a
form to a CGI script on a remote server. For the posting from the HTML
script, it requires a password - which should not be shown to other
users. Although, even after entering their own password, people cannot
download the HTML page showing the secret password, they can view it
through "show source" on their browser. Is there any way to stop this?
Please reply via email
Thank you in advance
Steve
------------------------------
Date: 19 Mar 1998 20:21:32 GMT
From: samw@wwa.com (Samuel G. Williams)
Subject: Help with Formats
Message-Id: <6eruoc$23h$1@hirame.wwa.com>
I am currently having a problem using formats. Well actually not formats per se,
but instead the way in which their results are ultimately displayed in proportional
spaced fonts under windows. I have a program that produces a security report in
tabular form using formats. Unfortunately all the whitespace gets compressed for
windows users working with proportional spaced fonts. Is there any way to clean
this up? For instance, is there a way that a format statement could be made to pad
the fields with periods or underscore characters instead of whitespace?
OR if there are other potential solutions please let me know. Perhaps I am being a
little shortsighted in this issue.
Thanks in advance !!
--
Sam Williams wb5yni samw@wwa.com
IS Staff Specialist samw@sinnfree.org
---------------------------------------------------------------------------
simplicity is the ultimate form of sophistication....
Leonardo Da Vinci
------------------------------
Date: Thu, 19 Mar 1998 20:41:56 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help with Formats
Message-Id: <ebohlmanEq32tw.J3K@netcom.com>
Samuel G. Williams <samw@wwa.com> wrote:
: I am currently having a problem using formats. Well actually not formats per se,
: but instead the way in which their results are ultimately displayed in proportional
: spaced fonts under windows. I have a program that produces a security report in
: tabular form using formats. Unfortunately all the whitespace gets compressed for
: windows users working with proportional spaced fonts. Is there any way to clean
: this up? For instance, is there a way that a format statement could be made to pad
: the fields with periods or underscore characters instead of whitespace?
That won't do you any good. The problem is that with a proportional
font, your *non-filler* sections have variable widths, so you have no way
of knowing how many filler characters to put between them.
Exactly how is the report being displayed by your users? Are they copying
the file directly to a printer? Loading it into a word processor?
Viewing it on a Web browser?
------------------------------
Date: 19 Mar 1998 15:15:33 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: Re: How do you create a directory? Please enlighten!?
Message-Id: <6erud5$8n@julius.ling.ohio-state.edu>
In article <6erdss$qhe$1@viper.america.net>, Mark Polakow <mark@imp.net> wrote:
>management program and I have it doing everything but i don't know the code
>or method for creating directories? I know about unlink and rmdir can
hi, mark--
i suspect that your problem might be that since you seem to be on a
non-unix platform, you're omitting the unix mode (read and write
permissions) when you open the directory. the deal is, even on a ms
system (at least, on my nt system) if you wanna make a directory, you
gotta say something like
mkdir("$my_directory", 0770);
where the 0770 is meaningless for your purposes, but nevertheless must
be there.
i would suggest expanding the above to
mkdir("$my_directory", 0770) || warn "couldn't open $my_directory:
$!\n";
this might give you other clues about why your code isn't working.
kevin
------------------------------
Date: 19 Mar 1998 21:05:32 GMT
From: "Rob van Oostveen" <oostveen@synnetry.nl>
Subject: How to..
Message-Id: <01bd537a$bddaf1c0$010a10ac@rob-home>
..extract a NT account full name ? I need to extract a full name when a
user logs in to the NT domain. The client is NT 4. A perl script is ran
during
the login script for other purposes as well and I'd like to add some more
functionality. In order to do this I need the accounts full name.
Thanks in advance.
--
Rob van Oostveen
Work : oostveen@synnetry.nl
Private : oostveen@euronet.nl
------------------------------
Date: Thu, 19 Mar 1998 11:58:19 -0800
From: Nick Bouton <nbouton@unixg.ubc.ca>
Subject: Newbie question: using split() while ignoring regexps
Message-Id: <351178DB.7132@unixg.ubc.ca>
Hi there:
Before I get flamed for posting a newbie question (as most newbies in
here seem to have happen), I'd just like to point out that I've
consulted the Camel book, as well as about 3 other Perl books on this
subject, but either I've missed something or there just isn't a more
efficient way to do this.
Okay, my question/quandary.
Let's say I have a text data file with a collection of lines resembling
the following:
15,"Legion of the Dead","Death","0","4","0","0","3","0","Summons eight
undead warriors. One is H:4,L:2, the other seven are
H:1,L:1","3","X",0,"Legion of the Dead"
(ignore the wrap, consider that one line)
As you can see, every field except the first is quoted, fields are
comma-delimited, and the strings themselves sometimes contain commas as
well.
Now, without reformatting the entire document with a different delimiter
char (ie: "::" or something), what would be the most efficient way to
split() an entry into its various fields while ignoring everything
inside the individual strings? (you see my problem - if I use split(
",", $line ) where $line is an entry from the data file, it will run
into the commas inside the strings, which should be ignored).
The way I'm currently doing it is, imho, pretty lame.. (see below) ..
there's got to be some other way to do it.
while( defined( $line = <spells> ) ) {
( $idx, $name, ... ) = split( /,"/, $line );
$name =~ s/"//;
$house =~ s/"//;
...
}
Is there some way to ignore all text between pairs of "'s?
If you know of a FAQ that could help me out instead of posting this
here, please let me know..
Thanks,
-Nick
------------------------------
Date: Thu, 19 Mar 1998 20:33:34 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Newbie question: using split() while ignoring regexps
Message-Id: <ebohlmanEq32Fy.HzJ@netcom.com>
Nick Bouton <nbouton@unixg.ubc.ca> wrote:
: Let's say I have a text data file with a collection of lines resembling
: the following:
: 15,"Legion of the Dead","Death","0","4","0","0","3","0","Summons eight
: undead warriors. One is H:4,L:2, the other seven are
: H:1,L:1","3","X",0,"Legion of the Dead"
: (ignore the wrap, consider that one line)
: As you can see, every field except the first is quoted, fields are
: comma-delimited, and the strings themselves sometimes contain commas as
: well.
No, your fields are comma-*separated*, not "delimited." Delimited means
there's a character that you use to mark both the start and end of each
field. You've got what's called a "comma-separated-variable" (CSV) file.
: Now, without reformatting the entire document with a different delimiter
: char (ie: "::" or something), what would be the most efficient way to
: split() an entry into its various fields while ignoring everything
: inside the individual strings? (you see my problem - if I use split(
: ",", $line ) where $line is an entry from the data file, it will run
: into the commas inside the strings, which should be ignored).
Yes, it's well-known that such a naive use of split() won't work. It's
so well known that there's a section in the Perl FAQ about dealing with
CSV files. It's such a frequently-encountered problem that, sometime
after the FAQ entry was written, someone wrote a Text::CSV module and put
it up on CPAN. Therefore, you have many more options open to you than
re-inventing the wheel; take advantage of them.
------------------------------
Date: 19 Mar 1998 16:03:00 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Newbie question: using split() while ignoring regexps
Message-Id: <90q6s8aj.fsf@news.concentric.net>
Nick Bouton <nbouton@unixg.ubc.ca> writes:
> every field except the first is quoted, fields are comma-delimited,
> and the strings themselves sometimes contain commas as well.
This is a standard ASCII format called "CSV" (which stands for -- are
you ready -- Comma Separated Values). You'll find a module at CPAN
that reads CSV and spits out Perl data structires.
http://www.perl.com/CPAN-local/modules/by-module/Text/ALANCITT/Text-CSV-0.01.tar.gz
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 19 Mar 1998 16:00:51 -0600
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: Newbie question: using split() while ignoring regexps
Message-Id: <xim3egebass.fsf@jihad.amd.com>
>>>>> "Nick" == Nick Bouton <nbouton@unixg.ubc.ca> writes:
[...]
Nick> Now, without reformatting the entire document with a
Nick> different delimiter char (ie: "::" or something), what would
Nick> be the most efficient way to split() an entry into its
Nick> various fields while ignoring everything inside the
Check out Text::ParseWords.
NAME
Text::ParseWords - parse text into an array of tokens
SYNOPSIS
use Text::ParseWords;
@words = "ewords($delim, $keep, @lines);
@words = &shellwords(@lines);
@words = &old_shellwords(@lines);
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: 19 Mar 1998 15:35:43 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: oraperl ref books??
Message-Id: <6erviv$1t4$1@tholian.cse.psu.edu>
In article <6erbpt$bl4$1@nnrp1.dejanews.com>,
<bpszenny@baynetworks.com> wrote:
>Does anyone know of a good referance book on oraperl?
perldoc DBI, perldoc DBD::Oracle, perldoc Oraperl. Rumor has it that
Tim Bunce and company are working on a book. I'm sure if you join the
dbi-users list (see http://www.perl.org/CPAN/modules/00modlist.long.html)
they'll give you some details and an ETA.
John
groenveld@acm.org
------------------------------
Date: Thu, 19 Mar 1998 21:11:53 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: Perl for DOS/Windows 3.x
Message-Id: <3511881e.1111911401@news.spacestar.net>
On 16 Mar 1998 19:11:43 GMT, Flavio Pereira <flavio@sem.spam> wrote:
<sigh> Well, I tried to answer this via email as is fitting for a
FAQ-like question, but you munged your address. Do you want help or
not?!
>Hi !
> Does anybody knows where I can find Perl package for DOS/Windows 3.x ?
Yes.
>I know nothing about this language but I really need it now.
This is a FAQ. Please seek out the FAQ and read it if you intend to
join the Perl community. Praps the easies places to find it are
www.perl.org and www.perl.com, or at the locations mentioned in the
mini-FAQ you likely recieved by now. Just a thought, but you would
also benefit from reading news.announce.newusers, as you seem to think
that USENET is a help desk. A quick translation of this line of your
message would read "I know nothing about this language, and am
unwilling to even make a cursory search for information. Please do my
research for me and drop it in my lap. And make it snappy!
> Some documentation is also important.
Yes, that is why it is included in every standard distribution and
available on CPAN and at 'www.perl.com'. There are several books
available from O'Reilly & Associates on Perl and regular expressions.
Reading the FAQ is also *very* important.
> Thanks for any help.
Well, actually so far I've only pointed you to the FAQ (which counts
as help, I suppose) and been a rite bastard. <sigh> Go on over to
CPAN. Everything Perlish is there, more or less. Easiest way is pry
thru 'www.perl.com'. Check out that site for sure. Exact URL of what
you are looking for is: 'http://www.perl.com/CPAN-local/ports/msdos/',
via the web.There is also an older version of Perl 5 that is in the
'old' dir.I've used that one successfully. In fact, I still am at
work. It isn't thelatest version tho, so I'd recommend the dist in
the 'lmolnar' dir.I've heard that one works well and is kept pretty up
to date.
------------------------------
Date: Thu, 19 Mar 1998 12:15:32 -0800
From: Brian Charles <brian.charles@orst.edu>
Subject: perl script won't work as cgi
Message-Id: <35117CE4.531DADD6@orst.edu>
Why won't this PERL script work as a CGI script. It runs fine at the
command prompt but not over the web.
Any suggestions?
(PS cgi newsgroups has some problems, that's why I post here)
Thanks
#!/usr/bin/perl
open DB,"file1" or die "Cannot open myfile: $!";
while(<DB>) {
chomp;
($firstname,$lastname,$email,$code) = split /\|/;
$hash{$firstname} = {lastname => $lastname, email => $email, code
=>$code};
}
for $firstname ( sort by_fullname keys %hash ) {
print "$firstname $hash{$firstname}{lastname} $hash{$firstname}{email}
",
"$hash{$firstname}{code}\n";
}
sub by_fullname {
$hash{$a}{lastname} cmp $hash{$b}{lastname}
}
------------------------------
Date: Thu, 19 Mar 1998 14:51:11 -0700
From: "Doran L. Barton" <fozz@mail.xmission.com>
To: Brian Charles <brian.charles@orst.edu>
Subject: Re: perl script won't work as cgi
Message-Id: <3511934F.4DEEF0E4@mail.xmission.com>
I don't see the required MIME headers anywhere in your code. Add this at the
top of your script:
print "Content-type: text/html\n\n";
-Fozz
Brian Charles wrote:
> Why won't this PERL script work as a CGI script. It runs fine at the
> command prompt but not over the web.
> Any suggestions?
> (PS cgi newsgroups has some problems, that's why I post here)
> Thanks
>
> #!/usr/bin/perl
>
> open DB,"file1" or die "Cannot open myfile: $!";
>
> while(<DB>) {
> chomp;
> ($firstname,$lastname,$email,$code) = split /\|/;
> $hash{$firstname} = {lastname => $lastname, email => $email, code
> =>$code};
> }
>
> for $firstname ( sort by_fullname keys %hash ) {
> print "$firstname $hash{$firstname}{lastname} $hash{$firstname}{email}
> ",
> "$hash{$firstname}{code}\n";
> }
>
> sub by_fullname {
> $hash{$a}{lastname} cmp $hash{$b}{lastname}
>
> }
--
========================================================================
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"You're spending too much time online when you start referring to going
to the bathroom as downloading."
------------------------------
Date: Thu, 19 Mar 1998 21:29:18 GMT
From: jbhenry.nospam@nospam.livingonline.com (Jeff Henry)
Subject: Re: Perl5 compile error
Message-Id: <6es2hn$ohd$2@adonis.tdi.net>
ByrneJB@Harte-Lyne.ca wrote:
>I am trying (vainly) to get perl5.004_04 to build on HP-UX 11.00 using gcc
>2.8.1. I am getting this error towards the end of the make file.
>AutoSplitting perl library
>AutoSplitting Text::ParseWords (lib/auto/Text/ParseWords)
>sh: 151 Memory fault(coredump)
>*** Error exit code 139
When I tried to build perl on HP-UX, I had a simmiliar problem (Memory
fault). This would happen when I tried to 'make' anything, even stuff
other than perl. I ended up getting and installing GNU Make, and then
Perl built with no problems. I assume that HP's Make is broke.
Hope this helps.
Jeff Henry.
------------------------------
Date: Thu, 19 Mar 1998 20:51:03 -0800
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: please help ... sending attachments via pop3 and perl
Message-Id: <3511F5B7.7F44@comenius.ms.mff.cuni.cz>
CMT wrote:
>
> Hi,
>
> I need help sending a attachment(s) via perl, I know how to send mail via perl
> but not how to attach a file, could someone please explain.
>
> Thank you much!
>
> -CMT
Mail::Sender at http://www.chipnet.cz/depot/perl.htm
Jenda
BTW: You cannot send mails by POP3. You send them by SMTP.
POP3 is for retrieving mails from mailboxes.
------------------------------
Date: Thu, 19 Mar 1998 20:29:37 GMT
From: ronan.cremin@isocor.com (Ronan Cremin)
Subject: Problem opening very large file with Perl 5.004 on Solaris
Message-Id: <35117f1c.6836750@news.isocor.com>
Hi,
I'm trying to open a very large (14Gb) file for reading using Perl
5.004 on Solaris 2.6
The error message returned is
Can't find file /file.txt: Value too large for defined data type
Is there a limit on the size of file that Perl can open?
Any suggestions would be appreciated.
rc
------------------------------
Date: Mon, 16 Mar 1998 22:49:14 +0000
From: Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk>
Subject: Re: Problem with "goto" in Perl
Message-Id: <hJlP6EAqxaD1Ewxn@dozyrosy.demon.co.uk>
In article <6e7gna$fim@news-central.tiac.net>, Mike Stok
<mike@stok.co.uk> writes
>In article <889660225.816059@thrush.omix.com>, Zenin <zenin@best.com> wrote:
>>Uri Guttman <uri@sysarch.com> wrote:
>>: because goto was invented by uncle bill, lord of the evil empire :-)
>> >snip<
>>
>> Goto is pretty much an ASM JMP (in use, not implementation). Bill
>> didn't invent it. Intel "invented" it, if anyone did. Bill has
>> never invented anything that I can remember, DOS included (it was
>> bought from another company).
>
>goto is very old - in modern computing terms - Dijkstra's famous paper in
>the Communications of the ACM was published in early 1968.
>
>Intel was founded in 1968 and Microsoft in 1975 (I think) so it's inlikely
>that the notorious goto was invented by either of them, some form of
>absolute jump is a fairly common low level instruction in real
>processors...
>
>Mike
Gotos were in use before the early/mid 1960s, which when I first tried
my hand at programming.
Rosemary
showing her age :-((
-------------------------------------------------------------------
| Rosemary I.H.Powell EMail: Home: rosemary@dozyrosy.demon.co.uk |
| Work: r.i.h.powell@rl.ac.uk |
| http://www.netlink.co.uk/users/dozyrosy/ |
| http://www.dozyrosy.demon.co.uk/ |
-------------------------------------------------------------------
------------------------------
Date: Thu, 19 Mar 1998 14:53:51 -0700
From: "Doran L. Barton" <fozz@mail.xmission.com>
Subject: Selling Perl applications effectively
Message-Id: <351193EF.82AFE56@mail.xmission.com>
I would like to know if anyone has come up with a way to sell
applications written in Perl without the risk of the buyer plagerizing
your code. My company would like to sell our perl applications and want
to do so without risking theft of our code.
I know we can convert the Perl to C and then go from there, but then you
lose your platform independence- something we really don't want to do.
Thanks in advance.
-Fozz
--
========================================================================
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"You're spending too much time online when you start referring to going
to the bathroom as downloading."
------------------------------
Date: Thu, 19 Mar 1998 21:29:10 GMT
From: jbhenry.nospam@nospam.livingonline.com (Jeff Henry)
Subject: Re: Splitting Arrays/Variables
Message-Id: <6es2hf$ohd$1@adonis.tdi.net>
Jesse Rosenberger <jesse@savalas.com> wrote:
>Question #1: I have a array named @arr, that has 4 numbers in
>it...numbers differ every time with a number 1-4...but the array
>contents look like "4 3 2 1", how can I split this array into 4 seperate
>variables... Example: I have an array: @arr = "3 4 2 1", I want $anum to
>equal 3, $bnum to equal 4, $cnum to equal 2, and $dnum to equal 1. I
>know it's pretty easy and I used to know how to do it but I seem to have
>forgotten after not doing it for a while.
This will do it:
@arr = (3, 4, 2, 1);
($anum, $bnum, $cnum, $dnum) = @arr;
You can simply assign the array to a list of variables. This is
covered in more detail in the PERLDATA manpage, under "List Value
Constructors".
>Question #2: How can you take a variable that contains a word....that
>may contain spaces...and break each letter into a seperate
>variable...the word may be any length, but will probably not contain any
>characters besides letters, and spaces (let's assume it won't) how could
>I go about doing this?
$str = "Hello There";
@chars = split(//,$str);
Now each letter in $str will go into a separate element of @chars. For
more cool stuff to do with split, see the PERLFUNC manpage. Also,
check out "join" if you want to stick those letters back together into
one string.
>Thanx in advance,
>Jesse Rosenberger
Hope I've helped.
Jeff Henry
------------------------------
Date: 19 Mar 1998 15:29:12 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: uncompressing libwww-perl
Message-Id: <6erv6o$fo@julius.ling.ohio-state.edu>
okay, this is only marginally perl-related, but it's driving me nuts,
so i beg for help.
i'm trying to download and uncompress libwww-perl or the Robot module.
my problem is that i can't uncompress them. i've tried winzip and
pkunzip, and everything craps out.
i'm on windows NT. any suggestions?
kevin
------------------------------
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 2139
**************************************