[8010] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1635 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 14 05:07:27 1998

Date: Wed, 14 Jan 98 02:00:34 -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           Wed, 14 Jan 1998     Volume: 8 Number: 1635

Today's topics:
     ANNOUNCE: FREE LINKS LIST -- FREE!! iguana@one.net
     Re: Can Perl talk smtp protocol under NT4? <adowad@nospam.uniserve.com>
     Create file <mart@Descartes.tdl.ee>
     Re: Create file <xxTony.Curtis@vcpc.univie.ac.at>
     Re: define variable names at run time? <NOSPAM_mike808@mvp.net>
     Re: Displaying GIFs <dformosa@st.nepean.uws.edu.au>
     Re: finding member of a list <rootbeer@teleport.com>
     Fork in a CGI <ruben@wynn.com>
     HEEELP! Two questions <mart@Descartes.tdl.ee>
     How can I set enviroment variables on Win32? <nweibx@abs.ascom.ch>
     Re: Learning Perl (Michael Ng)
     Re: Learning Perl (Honza Pazdziora)
     Looking for online auction script <darny@it-tradesources.com>
     mkdir syntax... (Anders Lindgren)
     Re: mkdir syntax... <xxTony.Curtis@vcpc.univie.ac.at>
     Re: mkdir syntax... (Honza Pazdziora)
     Re: Newbie: how to get file permissions? <rootbeer@teleport.com>
     Re: OO in a big progect!? <joseph@5sigma.com>
     Problem: interpreter says getservbyname undefined <adowad@nospam.uniserve.com>
     Re: Problem: interpreter says getservbyname undefined (Honza Pazdziora)
     Re: Problems installing perl5.004_01 on HPUX10.20 <NOSPAM_mike808@mvp.net>
     Q: multidimensional array <mikihasa@worldnet.att.net>
     Re: Q: multidimensional array (Honza Pazdziora)
     Re: recomended Perl books ? (Simulated Snow)
     Re: simple Perl question (Bart Lateur)
     Re: simple perl script to add directory to PATH if not  (Justin Vallon)
     Re: Socket Help <joseph@5sigma.com>
     Re: source into binary code (Honza Pazdziora)
     Re: source into binary code <wschow@Comp.HKBU.Edu.HK>
     Re: Storing Data In Perl <rootbeer@teleport.com>
     Re: use File::Find;  ! on MacPerl  ? (Justin Vallon)
     Re: Write to data file <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 14 Jan 1998 02:02:40 -0600
From: iguana@one.net
To: iguana@one.net
Subject: ANNOUNCE: FREE LINKS LIST -- FREE!!
Message-Id: <884751137.717160449@dejanews.com>

All,

  Be sure to check out Iguana's link list...  I tend to think that it is
one of the most stable and configurable perl links lists out there.  It
can be downloaded for free at:

http://w3.one.net/~iguana/Dynamic_Link_List/Download/Download.html

Please forward all questions or comments directly to iguana@one.net.

  Thanks,
     Ray.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 14 Jan 1998 00:39:35 GMT
From: "Alex Dowad" <adowad@nospam.uniserve.com>
Subject: Re: Can Perl talk smtp protocol under NT4?
Message-Id: <01bd2084$d8ae10a0$45a3f4cc@alex-s-pc>


> Not a script, but a module.
> 
> It's called Net::SMTP, and you can get it from CPAN
> (http://www.perl.com/CPAN/). Read the documentation that comes with
> it.

I thought that Net::SMTP only worked on UNIX. Was I wrong? And if so, how
do you get it working on Windows?

To reply to this message, remove the "nospam." bit from the reply address.

Alex


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

Date: Tue, 13 Jan 1998 16:55:55 +0200
From: Kitse / Phoenix Bird Coders <mart@Descartes.tdl.ee>
Subject: Create file
Message-Id: <Pine.BSF.3.91.980113165259.2600A-100000@Descartes.tdl.ee>

Hiya,

I didn't find out, how could one create file in perl.
Ok, one way is open(SomeHandle,">SomeFile"); --- that's not working (and 
man says that) when filename is in some variable, say,
open(SomeHandle,">$FileNameVariable"); # <- not OK

So, how could i create file?

----------------------------------------------------------------------------
             Ma"rt Laur  a.k.a.  Kitse / Phoenix Bird Coders
 mailto: mart@tdl.ee                           URL: http://www.tdl.ee/~mart
----------------------------------------------------------------------------



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

Date: 14 Jan 1998 10:15:11 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: mart@Descartes.tdl.ee
Subject: Re: Create file
Message-Id: <7xhg77ct7k.fsf@vcpc.univie.ac.at>

Re: Create file, Kitse <mart@Descartes.tdl.ee> said:

Kitse> Hiya, I didn't find out, how could one create file in
Kitse> perl.  Ok, one way is open(SomeHandle,">SomeFile");
Kitse> --- that's not working (and man says that) when
Kitse> filename is in some variable, say,
Kitse> open(SomeHandle,">$FileNameVariable"); # <- not OK

Kitse> So, how could i create file?

Hmmm, let me guess, this is in a CGI script?  (maybe :-)

Don't forget that to create a file you have to have the
appropriate permissions in the directory where the file is
to be.

In the case of CGI, take a look at

    http://www.boutell.com/openfaq/cgi/

or your nearest mirror thereof.

hth,
tony


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

Date: Tue, 13 Jan 1998 22:21:38 -0600
From: "Michael King" <NOSPAM_mike808@mvp.net>
Subject: Re: define variable names at run time?
Message-Id: <69hed3$kj6$1@twain.mvp.net>

Michael R. Harper wrote in message <69fg7q$miv@mtinsc02.worldnet.att.net>...
>Does Perl have the capability to define variable names at runtime?  For
>instance, let's say I have a three-character code (stored in an array
>named @CODE) that I want to use as the name of an associative array, but
>the code characters are not defined until after the script starts
>running.  How can I specify the name on the LHS of an assignment
>statement for the variable?
>
>Will this:
>    $CODE[0].$CODE[1].$CODE[2]{"apple"} = "red";
>work?


Uh, did you try:

    eval join("",@CODE) . "{'apple'} = 'red'";

Michael King (remove the NOSPAM_)
NOSPAM_mike808@mo.net
http://walden.mo.net/~mike808
Internet Specialist,
Net Effects
St. Louis, MO USA




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

Date: 14 Jan 1998 08:50:19 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Displaying GIFs
Message-Id: <884767799.106510@cabal>

In <69h81o$1cb$1@comdyn.comdyn.com.au> mgjv@comdyn.com.au (Martien Verbruggen) writes:

>In article <884737521.464702@cabal>,
>	? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> writes:

>> I think its more that he hasn't opened the file for output '<' nor has he

>'<' is for input, and that is default if no specifier is given. He
>doesn't need to open any output, because he's printing to STDOUT.

Sorry braino, I meant "I think he hasn't open the file for input".  The
confistion arrised because the file is outputting into the perl program
that is inputting the file into itself.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Wed, 14 Jan 1998 01:49:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ritchard Shadian <rshadian@hawaii.edu>
Subject: Re: finding member of a list
Message-Id: <Pine.GSO.3.96.980114014642.22337o-100000@user2.teleport.com>

On Tue, 13 Jan 1998, Ritchard Shadian wrote:

> Is there a Perl function for checking whether a particular scalar value
> is contained within a list/array (kind of like LISP's "member"
> function)?  I don't want to loop through the whole list checking each
> value one by one.

Is the entry in section four of the FAQ what you're looking for? Hope this
helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 14 Jan 1998 02:53:53 +0000
From: Ruben <ruben@wynn.com>
Subject: Fork in a CGI
Message-Id: <34BC28C1.F730B7F1@wynn.com>

HELLO - I'm have some strange behavior with a PERL CGI I'm writing.
 It's a shopping cart and after confirming the order, I want to
fork a second process and then email a written invoivce out.  The
invoice was to be cancatentated from a single string.  The code runs
fine
without the fork.  But with the fork, I get a repetition of the headers
and some of the code, almost as if the program is starting over
suddenly.
I thought perhaps I needed to make sure the file at $homeplate was
closed

I beleive it is.

This is a sample of the code with the fork commented out.

Anyone have any ideas why I'm getting this  behavior?



 sub send_invoice{
   1099     unless( open( CART, "+>$homeplate")){
   1100         die("CANT open Shopping Cart at $homeplate $!");
   1101     }
   1102
   1103     for( $i = 0 ; $i < @columns; $i++ ){
1104         print CART
"$columns[$i]","::","$data_array{$columns[$i]}::";
   1105     }
   1106     @orderlist = grep(/itemno/, keys(%data_array));
   1107     for( $i = 0 ; $i < @orderlist; $i++){
   1108         $pos = index($orderlist[$i],"_");
   1109         $number = substr($orderlist[$i],0,($pos));
   1110         for( $j = 0; $j < @details; $j++){
   1111             $entry = join(".",("$number","$details[$j]"));
   1112             print CART "$entry","::";
   1113             $entry =~ s/\./_/g;
   1114             print CART "$data_array{$entry}","::";
   1115         }
   1116         $linesub = join( ".",("$number","subtotal"));
   1117         print CART "$linesub","::";
   1118         $linesub =~ s/\./_/g;
   1119         print CART "$data_array{$linesub}","::";
   1120     }
   1121     $data_array{subtotal} = $data_array{taxes} +
$data_array{notaxes};
   1122     $data_array{bigbopper} = $data_array{subtotal} +
$data_array{taxcost} + $data_array{shippingcost}; 1123
   1124     print CART "subtotal::","$data_array{subtotal}","::";
   1125     print CART "taxtotal::","$data_array{taxcost}","::";

   print CART "taxtotal::","$data_array{taxcost}","::";
   1126     print CART  "shippingcost::",
"$data_array{shippingcost}","::";
   1127     print CART  "bigbopper::","$data_array{bigbopper}","::";
   1128     close (CART);
   1129
   1130
###################################################################
   1131 # Now that the invoice database is completed we need to mail
off  #
   1132 #  Copies of it to the customer and
client                        #
   1133 #  Since I am piping the output to the mail, this is not as
easy  #
   1134 # As it sounds as it has to be done with ONE write
statment.      #
   1135 # Otherwise we get several small incompreshessable little
email   #
   1136 # messages being sent
out                                         #
   1137
#                                                                 #
   1138 # We also need a loop in the printing
-                           #
   1139
#                                                                 #
   1140 #  To solve this contradiction - we are going to build the
invoice#
   1141 #  as a single formated string        What
fun!!                  #
   1142
##################################################################
   1143 1145     #if ($pidno == 0){
   1146         &mailinvoice;
   1147   #     exit;
   1148    # }
   1149 }
   1150
 sub mailinvoice{
   1152     local($input, @invoice, %database, $build );
   1153     unless( open( CART, "$homeplate")){
   1154         die( "cant open $homeplate $!");
   1155     }
   1156
   1157     $input = <CART>;
   1158     @invoice = split(/::/,$input);
   1159     %database = @invoice;
   1160     $build = "\n\n INVOICE NUMBER $database{invoiceno}          
DATE $database{date} ";
   1161     $build .= "\n\n $database{first} $database{last} \n";
   1162     $database{address} =~ s/_/ /g;
   1163     $build .= "$database{address} \n";
   1164     $database{city} =~ s/_/ /g;
   1165     $build .= "$database{city} ";

 1166     $database{state} =~ s/_/ /g;
   1167     $build .= "$database{state} ";
   1168     $build .= "$database{zip} \n\n ";
   1169     $build .= "CARD: $database{methodpay}    Shipping Method
$database{methodship} \n";
   1170     $build .= "   
__________________________________________________________________________________\n";
   1171     $build .= "                   $data_array{DBA} \n";
   1172     $build .= "   
__________________________________________________________________________________\n\n\n";
   1173     $build .= "     Item No\.   Description
     Price    QTY   Total
 \n";

   $build .= "   
__________________________________________________________________________________\n\n\n";
   1176
   1177
   1178    close( CART );
   1179
   1180 }
   1181
  1181


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

Date: Wed, 14 Jan 1998 10:05:13 +0200
From: Kitse / Phoenix Bird Coders <mart@Descartes.tdl.ee>
Subject: HEEELP! Two questions
Message-Id: <Pine.BSF.3.91.980114095338.18415A-100000@Descartes.tdl.ee>

Please help me, folks!

I have two serious problems with CGI-scripts written in Perl. Both (look 
below) work very well when executed from FreeBSD command-line, but 
doesn't work when executed from within WWW homepage.

The first: when i want to open non-existing file (create it) and use
open(MyHandle,">$filename"); # create new file
then it works when executed from 
command-line but NOT when executed from WWW homepage. Why? I read all the 
Perl manuals, looked to www.perl.com and so on and so on but nothing came 
up that could help me :-( 

The second: when I use FreeBSD 'mail' program from within my 
CGI-script,say, 
system("mail -s\"Important subject!\" mart@tdl.ee<empty.txt"); 
(mart@tdl.ee is my mail address and empty.txt is empty text file because 
I do not need message body) then browser displays "Server Error" 
ALTHOUGHT IT SENDS THE MAIL CORRECTLY ... ?!? What's the problem? 
Why can't I send message with only subject without that server error?

PLEASE HELP, I'M SO DESPERATED!

Sincerely,
----------------------------------------------------------------------------
             Ma"rt Laur  a.k.a.  Kitse / Phoenix Bird Coders
 mailto: mart@tdl.ee                           URL: http://www.tdl.ee/~mart
----------------------------------------------------------------------------



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

Date: 14 Jan 1998 09:19:16 GMT
From: "Xaver Weibel" <nweibx@abs.ascom.ch>
Subject: How can I set enviroment variables on Win32?
Message-Id: <01bd20cd$7c030880$d19f4f8b@berp37.abs.ascom.ch>

How can I set enviroment variables on Win32?

nweibx@abs.ascom.ch


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

Date: 14 Jan 1998 08:20:15 GMT
From: syng@garlic.engr.ucdavis.edu (Michael Ng)
To: Mike (mike@interways.com)
Subject: Re: Learning Perl
Message-Id: <69hsfv$b45$2@mark.ucdavis.edu>

Posted+Emailed

Hi! I try to speak from my experience.
1.. I started from reading Perl books (Programming Perl, Adv. perl 
    Programming..)
2.. I learned by writing my own Perl Programs ( to manage my system, CGI, 
    etc.) 
3.. I learned by reading FAQs, USENET and other online sources (other 
    people's Perl pages).. Yup.. Must go www.perl.com and www.perl.org

Among all these, I benefit more from #2

Just my opinions

Mike (mike@interways.com) wrote:
::> Hi,

::> Since I had it with JavaScript (caused by the missing support
::> of writing to files), I try to start learning Perl. My question is:
::> how can I tackle this? Download online FAQs? Study sources?
::> Buy some book? What is the best way to learn this wonderful
::> language.

::> Thanks in advance,
::> Mike - Interways Internet Services
::> http://www.interways.com

--
Michael 
+------------------------------------------------+
| mikeng@geocities.com                           |
| http://www.geocities.com/ResearchTriangle/8116 |
+------------------------------------------------+


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

Date: Wed, 14 Jan 1998 08:38:45 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Learning Perl
Message-Id: <adelton.884767125@aisa.fi.muni.cz>

"Mike" <mike@interways.com> writes:

> Hi,
> 
> Since I had it with JavaScript (caused by the missing support
> of writing to files), I try to start learning Perl. My question is:
> how can I tackle this? Download online FAQs? Study sources?
> Buy some book? What is the best way to learn this wonderful
> language.

Start at http://www.perl.com/, Perl Home Page, it gives answers to
all of your questions above (and many many more ;-).

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Wed, 14 Jan 1998 17:53:39 +0800
From: Dar Ny <darny@it-tradesources.com>
Subject: Looking for online auction script
Message-Id: <34BC8B21.E3809EC0@it-tradesources.com>

Hi

I'm looking over the internet for good auction script. but no luck.
anyone has the script??

requirement:
1.   can be customized with lots of graphics (= nice layout/design)
2.   have catergories/sub-catergories
3.   individual biding page for each auction item
3.1.   able to see item's front, sides, back, & maybe top views (items are
mainly artifacts & antiques)
3.2.   detail informations on item
4.   looks like the real auction!! ie. who has bid at what price & when,
min bid increment, open & close time, etc....
5.   for serious bidders only!! (valid email add)

dats bout all. thanks a lot!!


darny



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

Date: 14 Jan 1998 08:31:19 GMT
From: andlin-7@jota.sm.luth.se (Anders Lindgren)
Subject: mkdir syntax...
Message-Id: <69ht4n$jnt$1@news.luth.se>


Hello...

I've been trying to use the mkdir function in a script...
It's syntax is mkdir DIRNAME, MODE
the problem is I just can't figure out in what format the mode should be.
I've tried with letters(like u+rwx) and or'ing together the numerical
values like I could do with chmod(755) 
The problem is that all directories I can create have no rights set to
anyone...
I know I can fix this by doing a exec 'chmod DIRNAME MODE' but it would
be better to set the mode right away...
Well... ne1 know how to do?
TIA
/Anders



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

Date: 14 Jan 1998 10:30:21 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: andlin-7@jota.sm.luth.se
Subject: Re: mkdir syntax...
Message-Id: <7xen2bcsia.fsf@vcpc.univie.ac.at>

Re: mkdir syntax..., Anders <andlin-7@jota.sm.luth.se> said:

Anders> I've been trying to use the mkdir function in a
Anders> script...  It's syntax is mkdir DIRNAME, MODE the
Anders> problem is I just can't figure out in what format
Anders> the mode should be.  I've tried with letters(like

perldoc -f mkdir

    =item mkdir FILENAME,MODE

    Creates the directory specified by FILENAME, with permissions specified
    by MODE (as modified by umask).  [snip]
            ^^^^^^^^^^^^^^^^^^^^^^
e.g.

    umask 077;                           # user permission only
    mkdir "foobar", 0777;

    ~077 & 0777 = 0700 (= rwx------ + directory bit 01000)

    $ ls -ld foobar
    drwx------  user group 512 Jan 14 10:22 foobar


Anders> anyone...  I know I can fix this by doing a
Anders> exec 'chmod DIRNAME MODE'

chmod is a built-in.

hth,
tony


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

Date: Wed, 14 Jan 1998 09:37:59 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: mkdir syntax...
Message-Id: <adelton.884770679@aisa.fi.muni.cz>

andlin-7@jota.sm.luth.se (Anders Lindgren) writes:


[...]

> I've been trying to use the mkdir function in a script...
> It's syntax is mkdir DIRNAME, MODE
> the problem is I just can't figure out in what format the mode should be.
> I've tried with letters(like u+rwx) and or'ing together the numerical
> values like I could do with chmod(755) 

If you check the perlfunc man page for mkdir, it will direct you to
umask for more information and will show that the problem is that you
are confusing octal and decimal notation of a number. Use 0755 instead
of 755 and you will be fine.

Hope this helps,

[P.S. for FAQ maintainers: this is a FAQ, could we five it separate
paragraph in perlfaq?]

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Wed, 14 Jan 1998 00:42:30 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Andrew W. Robinson" <awrobinson@amoco.com>
Subject: Re: Newbie: how to get file permissions?
Message-Id: <Pine.GSO.3.96.980114004112.22337i-100000@user2.teleport.com>

On Tue, 13 Jan 1998, Andrew W. Robinson wrote:

> How do I get the permission of a file, especially in a format 
> suitable to use with the chmod() function? 
> 
> The mode field of the stat() function looks close. The perlfunc 
> page defines mode as "type and permissions", but I don't know how 
> to separate the two. Is there a simple octal formula to do so?

Yes; use 0777 as a mask, if you wish only the rwx permission bits. (If you
need any others, check the manpage for chmod on your system.) 

    $rwx = 0777 & $full_mode;	# Mask off extra bits

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 14 Jan 1998 01:57:21 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: OO in a big progect!?
Message-Id: <34BC7DDC.E0EBDFE9@5sigma.com>

OO is not any slower than any other style of Perl.  Big Perl
programs are a little slower than small Perl programs.  Of course,
badly written Perl programs can be *much* slower than well
written Perl programs.

There are methods for writing modules that make them load and
run faster.  Depending on whether you're planning on writing
modules yourself, you might want to investigate the AutoLoader
module.

	-joseph
	 http://www.effectiveperl.com

Ying Hu wrote:
> 
> [...] But
> the speed was slower than the perl scripts that I wrote. If using
> OO method, the speed will be slow in the big project?


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

Date: 14 Jan 1998 00:36:14 GMT
From: "Alex Dowad" <adowad@nospam.uniserve.com>
Subject: Problem: interpreter says getservbyname undefined
Message-Id: <01bd2084$612f3ea0$45a3f4cc@alex-s-pc>

Hi,

When I try to run the following line of code, the interpreter says that
&main::getservbyname is undefined.

@smtp_info = &getservbyname('smtp', 'tcp');

I looked in the perl docs and they say that getservbyname is a built-in
function. 
I'm using build 313 of ActiveState's Win95 Perl port.

To respond to this message, remove the "nospam." bit from the reply
address.

Thanks,
Alex




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

Date: Wed, 14 Jan 1998 08:56:55 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Problem: interpreter says getservbyname undefined
Message-Id: <adelton.884768215@aisa.fi.muni.cz>

"Alex Dowad" <adowad@nospam.uniserve.com> writes:

> Hi,
> 
> When I try to run the following line of code, the interpreter says that
> &main::getservbyname is undefined.
> 
> @smtp_info = &getservbyname('smtp', 'tcp');
	      ^^^
For builtin functions, remove ampersand when calling them.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 13 Jan 1998 22:28:54 -0600
From: "Michael King" <NOSPAM_mike808@mvp.net>
Subject: Re: Problems installing perl5.004_01 on HPUX10.20
Message-Id: <69heqn$ks3$1@twain.mvp.net>


Michael P Chandler wrote in message
<34BBCDD0.FB8DAF0B@mema.mail.fedex.com>...
>Anu Manne contractor for Carl Kiger wrote:
>> I Couldnot install perl on HPUX10.20, got following warning messages
>> while Making perl(5.004_01) and terminated after failing test 0:
>i've always used GNU_GCC to install and have had fewer problems...i can't
>answer specific compile options....
>i have similar environ


Me 2. The bundled c compiler WILL NOT BUILD shared library (i.e. dynamically
linked) versions of Perl.

I've used the GNU GCC and didn't have a lick of trouble.

Michael King
NOSPAM_mike808@mo.net
remove the NOSPAM to email me




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

Date: Wed, 14 Jan 1998 03:37:53 -0500
From: "Michael R. Harper" <mikihasa@worldnet.att.net>
Subject: Q: multidimensional array
Message-Id: <69ht6c$f3h@bgtnsc01.worldnet.att.net>

If I have an array defined such that I can store information in it like
this:

$OCCU{$code}{$occuFields[1]}[$i] = "Abstractor";

What would be the notation to tell me how many [$i] values are stored in
the %OCCU array?  I know for a simple @type array I can use the
following for() statement to loop through:

for($i=0;$i<@type-1;$i++) {}

What do I put in the place of @type for the more complicated version?

Michael R. Harper
mikihasa@worldnet.att.net



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

Date: Wed, 14 Jan 1998 08:52:44 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Q: multidimensional array
Message-Id: <adelton.884767964@aisa.fi.muni.cz>

"Michael R. Harper" <mikihasa@worldnet.att.net> writes:

> If I have an array defined such that I can store information in it like
> this:
> 
> $OCCU{$code}{$occuFields[1]}[$i] = "Abstractor";
> 
> What would be the notation to tell me how many [$i] values are stored in
> the %OCCU array?  I know for a simple @type array I can use the
> following for() statement to loop through:
> 
> for($i=0;$i<@type-1;$i++) {}

You are definitelly better off using

	$i = @type

(btw. you used that thing in your for expression ;-)

> What do I put in the place of @type for the more complicated version?

To learn, how many elemants there are in array

	@{$OCCU{$code}{$occuFields[1]}},

just use this in scalar context.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 13 Jan 1998 23:27:41 -0800
From: SnowSim@halcyon.com (Simulated Snow)
Subject: Re: recomended Perl books ?
Message-Id: <SnowSim-1301982327410001@blv-lx102-ip16.nwnexus.net>

In article <34bbc850.158006256@nntp.usit.net>, jnorman2@usit.net wrote:

> syng@garlic.engr.ucdavis.edu (Michael Ng) wrote:
> 
> >Programming Perl and Adv. Perl Programming.
> >
> >Tiago Stock (tiagosdelete@gdn.net) wrote:
> >::> Please follow this thread in recommending your favorite Perl
reference book.

PERL The Programmers Companion - Nigel Chapman, John Wiley & Sons, 1997

not a lot of code but good narritive coverage of perl by topic areas
(chapters) such as Flow of Control, Lists and Hashes, References and Data
Structures, Objects, Perl and the World Wide Web

while written by someone I understand is a computer scientist, it is
remarkably readable; deep & clear

author writes :

"This may seem like heresy to some experts, but I hope you will agree
after reading this book that if you strip out all the Unix dependencies
from Perl, you are left with a powerful and useful language, and one that
can be used to advantage under any operating system." - from the Preface

he assumes you understand what "programming" is "about"

a book I think will be come very popular

my $opinion = (US$0.02)

-- 
"I know of no safe depository of the ultimate powers of the society but the
people themselves; and if we think them not enlightened enough to exercise their
control with a wholesome discretion, the remedy is not to take it from them but
to inform their discretion." - Thomas Jefferson


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

Date: Wed, 14 Jan 1998 08:59:41 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: simple Perl question
Message-Id: <34c0748a.2826385@news.tornado.be>

"Adam" <black@cia.com.au> wrote:

>When I try to run the program - listed below - I get the error message:
>htmlend.pl did not return a true value at hellowww.pl at line 5

Add this line to the htmlend.pl file:

	1;

That allows "require" to check that the library file has been loaded
successfully (you can make it fail, if you want to).

HTH,
Bart.


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

Date: Wed, 14 Jan 1998 02:54:54 -0500
From: vallon@mindspring.com (Justin Vallon)
Subject: Re: simple perl script to add directory to PATH if not there already
Message-Id: <19980114025454441469@user-38lcf46.dialup.mindspring.com>

Randy Bey <randolph.a.bey@norwest.com> wrote:

> #! /usr/local/bin/perl
#!/usr/local/bin/perl5 -w

> # add_to_path.pl
> # Usage: eval $(add_to_path.pl /new/dir /another/new/dir)
> $ This means we need to output a PATH
> $gotone = false ;

# 1) Use my.
# 2) I don't think false is a real constant.  Use False, 'false', 
#    the C-style 0, or the perl-style undef.

# my $gotone = False;
my $gotone = 'false';
# my $gotone = 0;
# my $gotone; # undef => nope.


> # Scarf the existing PATH from the environment
> $path = $ENV{PATH};
my $path = $ENV{PATH};

> # Split it up into a bunch of directories
> @patharray = split( /:/, $path );
my @patharray = split /:/, $path;

> # Run through the command line arguments and add them to the end of
> @path
> # if they are not there already.

my $j = 0;
> while ( $ARGV[$j] ) {
while ($j < @ARGV) {

> # We track if any directories are matched with this var
>  $notthere = true ;
my $notthere = 'true';

>  # Run through the path directories in search of a match

my $i = 0;

>  while ( $patharray[$i] ) {
while ( $i < @patharray ) {
>   if ( $patharray[i] eq $ARGV[j] ) {
>    $notthere = false ; 
     $notthere = 'false';
>   }
>   # Next!
>   $i++
>  }
>  if ( $notthere eq true ) {
   if ( $notthere eq 'true' ) {
>   # It's not there, so add it to the end
>   $path=$path . ":" . $ARGV[j] ;
>   $gotone = true ;
    $gotone = 'true';
>  }
>  $j++ ;
> }
}

> if ( $gotone eq true ) {
  if ( $gotone eq 'true') {
>  print "PATH=$path\n";
> }
> 

Or:

#!/usr/local/bin/perl5 -w

my $gotone;

my @path = split /:/, $ENV{PATH};

# Add only new components to @path, and output only changes.

arg: for $new (@ARGV) {
        for $old (@path) {
                # Is $new old?
                next arg if $new eq $old;
        }

        # Append new component
        push @path, $new;

        # @path changed.
        $gotone = 1;
}

print "PATH=" . join(":", @path) if $gotone;


-- 
-Justin
vallon@mindspring.com


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

Date: Wed, 14 Jan 1998 02:00:23 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Socket Help
Message-Id: <34BC7E92.F63B5C5E@5sigma.com>

The LWP::Simple module makes this about a two line program.

Anyone who tells you to "use a socket connection" is about
two years behind the times.

	-joseph
	 http://www.effectiveperl.com

John Kotwicki wrote:
> 
> I am looking for code examples that will help me out with the
> following problem:  I want to be able to retreive a file from a Web
> site and save it to a local directory.
> 
> Everyone tells me that it is really easy, all I have to do is use a
> socket connection, yet I have never actually seen this done.


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

Date: Wed, 14 Jan 1998 08:37:46 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: source into binary code
Message-Id: <adelton.884767066@aisa.fi.muni.cz>

"Mr. Chow Wing Siu" <wschow@Comp.HKBU.Edu.HK> writes:

> Hi, I would like to know how to turn the perl source code 
> into binary/executable code due to security.

Read the INSTALL file in the distribution.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 14 Jan 1998 08:34:43 GMT
From: "Mr. Chow Wing Siu" <wschow@Comp.HKBU.Edu.HK>
Subject: Re: source into binary code
Message-Id: <69htb3$3soi$1@power42t.hkbu.edu.hk>



Oops... I mean *.pl to Sun binary... not making the compiler.

e.g., hello.pl  (already executable)
#!/usr/local/bin/perl
print "hello world\n"

How to make the above code into Sun binary executable?

- -- 
PGP PUBLIC KEY: https://www.comp.hkbu.edu.hk/~wschow/pgp.html
Key fingerprint = 15 C4 36 D6 EC CF 1D A4  7F D8 F9 EF 2E D7 32 A6


Version: 2.6.3i
Charset: noconv

iQCVAwUBNLx9GL3ixeOqBhAdAQHLMgQAjF9rnSNQrGtldd3MgMVTO6r0rmKCB4RH
Q4g4S6KvvMqbHIYrCMz4QRGH0sblGepYHw7al1Y427dXuVqINWTLxr9f5gcX1wyJ
N7stcIulfnwoDPRF0ZDVoZ9Ix5kQ6d0dicgzZqF0iYUBCUK848DTUa7FBxYmiMLD
48ykZv0CjmE=
=u7lg
-----END PGP SIGNATURE-----


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

Date: Wed, 14 Jan 1998 01:12:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ho Seng Yip <cybercom@pacific.net.sg>
Subject: Re: Storing Data In Perl
Message-Id: <Pine.GSO.3.96.980114011006.22337k-100000@user2.teleport.com>

On Wed, 14 Jan 1998, Ho Seng Yip wrote:

> I was just wondering how can one store data inputed from a html form to
> say a text file and also how to retrieve the correct data in the later
> stage when the user wants a specific data. 

There are some modules which can help you to write a program to do this.
Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 14 Jan 1998 02:54:55 -0500
From: vallon@mindspring.com (Justin Vallon)
Subject: Re: use File::Find;  ! on MacPerl  ?
Message-Id: <19980114025455441547@user-38lcf46.dialup.mindspring.com>

Don <defike@ilstu.edu..spam.not> wrote:

> #!perl -w
> use File::Find;
> find (&Wanted, 'Macintosh HD:Desktop Folder:vicki")
      (\&                                          ');
> sub Wanted
>  {
>   print "$File::Find::name\n";
>  }

#!perl -w
use File::Find;
find (\&Wanted, 'Green:Desktop Folder:Red');
sub Wanted
 {
  print "$File::Find::name\n";
 }


Did you mean that?  That runs for me (Perl 5.1.3r2).

-- 
-Justin
vallon@mindspring.com


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

Date: Wed, 14 Jan 1998 00:34:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Patience <feng@haas.berkeley.edu>
Subject: Re: Write to data file
Message-Id: <Pine.GSO.3.96.980114003100.22337f-100000@user2.teleport.com>

On Tue, 13 Jan 1998, Patience wrote:

> how do I save the info into the same line without disturbing other lines
> in the same file? 

Section 5 of the FAQ has some information about doing this. Hope this
helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 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 1635
**************************************

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