[7640] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1266 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 3 16:17:50 1997

Date: Mon, 3 Nov 97 13:00:27 -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, 3 Nov 1997     Volume: 8 Number: 1266

Today's topics:
     Appending Problems <dale@horizonint.com>
     Re: Best way to comma seperate a number? (William R. Ward)
     btree .db file covert from Sun/Solaris to Linux?? How? (Shiloh Costa)
     Re: Creating a new file each day?? (Ronald L. Parker)
     DBM and Windows NT. <rbgreene@students.uiuc.edu>
     Did an open for append create the file? fred@no.spam.leeds.ac.uk
     Dynamically creating filenames <bobm@tiac.net>
     Re: Execution time in Perl <yanoff@alumni.cs.uwm.edu>
     Re: Inserting characters into a string. <nnyxcu@ny.ubs.com>
     Re: open() and pipes <rootbeer@teleport.com>
     Performance question <bob@textor.com>
     perl compiler sue@telepres.com
     Re: Perl debug <kevinl@ascend.com>
     PERL programmer wanted !   PERL Programmierer gesucht <info@cramermedia.com>
     Re: Perl Suffix (Was: Can perl be maken to Compiler ins (Bryan Miller)
     Perl, Sendmail, CGI (David Siebert)
     PROGRAMMER WANTED !!! <info@cramermedia.com>
     Q: Precise Timestamps in Perl? lbudney@fore.com
     Question on DB_file and tie function <atulm@sequent.com>
     Re: Reading a Binary file. (Will Morse)
     Re: Real Newbie Question (Anders Thelemyr)
     Re: Real Newbie Question (Tad McClellan)
     running remote shelll under suid perl script ? kimtan@lucent.com
     suid problem. <Bob.Jones@WKU.EDU>
     Taking notice of "Use of uninitialisaed value" warnings fred@no.spam.leeds.ac.uk
     Re: trouble with 'application/octet-stream' script <rootbeer@teleport.com>
     What's New? 6000+ links on Object-Orientation (in Engli <manfred.schneider@rhein-neckar.de>
     Win32::NetResource - Anyone? <vcuya@mindspring.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 03 Nov 1997 11:21:41 -0700
From: Dale Chavez <dale@horizonint.com>
Subject: Appending Problems
Message-Id: <345E1634.61C43139@horizonint.com>

I'm creating an ascii file with 8 fields, delimited by an exclamation
point (!).  When I write the fields to the file using the > file
operator, the fields are preceeded by the delimeter correctly.  However,
when I change the file operator to the >>, I get a string of exclamation
points at the top of the file.

Here's the Perl code:

require ("/perl5/bin/cgi-lib.pl");

print "content-type: text/html\n\n";
&ReadParse(*input);

open(BLATMAIL, ">>tslips.txt");
print BLATMAIL $input{'employee'},"!";
print BLATMAIL $input{SelectPrimary};
print BLATMAIL $input{SelectSecondary};
print BLATMAIL $input{SelectTertiary};
print BLATMAIL $input{'comments'};
print BLATMAIL $input{'hours'};
print BLATMAIL $input{'totalhours'};
print BLATMAIL $input{'weekending'}, "\n";
close BLATMAIL;


open (INF, "tslips.txt");
@indata=<INF>;
close(INF);

 print qq!
 <body bgcolor=ffffff>
 <table CELLPADDING = 3 CELLSPACING = 0 border=1>
 <tr>
  <th>Name</th>
  <th>Client</th>
  <th>Activity</th>
  <th>Task</th>
  <th>Comments</th>
  <th>Hours</th>
  <th>Week Ending</th>
 </tr>!;

foreach $i (@indata) {
 chop($i);
 (@tslip) = split(/!/, $i);
 ($employee,$client) = split(/\!/,$i);

 print qq!
 <tr>
 <td>$input{employee}</td>
 <td>$input{SelectPrimary}</td>
 <td>$input{SelectSecondary}</td>
 <td>$input{SelectTertiary}</td>
 <td>$input{comments}</td>
 <td>$input{hours} of $input{totalhours}</td>
 <td>$input{weekending}</td>
 </tr>
 </table>!;
 }

Any ideas as to what's wrong with the code?

Thanks in advance for any help!

Regards,
Dale



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

Date: 03 Nov 1997 12:34:35 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: Best way to comma seperate a number?
Message-Id: <waaoh4190o3.fsf@am.UCSC.EDU>


This sounds like a perfect candidate for a standard Perl module.  We
all have to format numbers sometimes... Number::Format perhaps?

--Bill.

-- 
William R Ward          Bay View Consulting   http://www.bayview.com/~hermit/
hermit@bayview.com     1803 Mission St. #339        voicemail +1 408/479-4072
hermit@cats.ucsc.edu  Santa Cruz CA 95060 USA           pager +1 408/458-8862


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

Date: Mon, 3 Nov 1997 18:12:52 GMT
From: ap296@torfree.net (Shiloh Costa)
Subject: btree .db file covert from Sun/Solaris to Linux?? How?
Message-Id: <EJ319H.IsB.0.bloor@torfree.net>

I've got a database file (btree .db) that was created on a SunOS 
5.5/Solaris 2.5 system.
 
I've moved to a Linux platform now, and while all of my Perl routines 
are compatible cross-platform, it appears that my database file is not.

The database is already full of data and I don't want to re-create an 
empty one on the linux system.  However, when I take a look at the 
original solaris database file, in the beginning I see things like:

Package Fcntl;
myarchname='sun4-solaris'
oldarchlib='/usr/local/lib/perl5/sun4-solaris'
 
and other stuff that points to stuff on my Solaris system.
 
I guess when I move this database to linux, and try and open the 
database, all of this stuff is pointing to non-existant paths and other 
stuff... :(
 
Question:
 
How can someone convert a database file (btree .db) that was originally 
created on a Sun/Solaris system, to a linux-compatible database file?
 
CC:'d e-mail responses are appreciated.
 
Anxiously Waiting.. :)
 
- Shiloh Costa



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

Date: Mon, 03 Nov 1997 20:47:35 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Creating a new file each day??
Message-Id: <345e375e.256934392@news.supernews.com>

On 03 Nov 1997 07:49:54 -0700, Randal Schwartz <merlyn@stonehenge.com>
wrote:

>Creede> $newlog = sprintf("%4.4d%2.2d%2.2d.log",$year, $month, $dom);
>
>No... I think you want:
>
>	$newlog = sprintf("%04d%02d%02d.log", $year, $month, $dom);
>
>The .4 doesn't do much good on decimal integers. :-)  But the leading
>"0" does.

Here's what the online help for my C compiler says about that...

Type   |
Char   | Effect of [.prec] (.n) on Conversion 
----------------------------------------------------------------------
diouxX | Specifies that at least n digits are printed. If input    
       | argument has less than n digits, output value is left-padded

       | with zeros. If input argument has more than n digits, the
       | output value is not truncated. 

I don't know if Perl inherits this behavior, but at least one runtime
library supports it.




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

Date: Mon, 03 Nov 1997 14:31:44 -0600
From: Rawley Greene <rbgreene@students.uiuc.edu>
Subject: DBM and Windows NT.
Message-Id: <345E34B0.787E856E@students.uiuc.edu>

Hi,

I'm porting a perl program from Unix that uses a lot of DBM database
handling and was wondering if all the DBM functionality was supported in
Perl for Windows NT.

Rawley
rbgreene@uiuc.edu




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

Date: Mon, 3 Nov 1997 20:28:28 +0000 (GMT)
From: fred@no.spam.leeds.ac.uk
Subject: Did an open for append create the file?
Message-Id: <345EA3F0.58E2@no.spam>

Is there an easy way to find out if the call to open() with a
filename starting ">>... actually created the target file.

Ben.


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

Date: Mon, 03 Nov 1997 13:57:14 -0500
From: Bob Maillet <bobm@tiac.net>
Subject: Dynamically creating filenames
Message-Id: <345E1E8A.464328A6@tiac.net>

On the script below I am trying to produce dynamically created filenames
from a database query.  I can get the output to print but am having
trouble looping the output to create filenames..It appears to output the
data as one lump sum as opposed to running each line through the loop of
executing the mirror command.  Could someone please give me some
feedback as to what may be going wrong?









use Win32::ODBC;
use LWP::Simple;

# Create dynamically produced filenames
# by running a db query for the id and mut associated with it..


#open a connection to your database with
$DSN ="cell05";
if (!($db = new Win32::ODBC($DSN))){
    print "Error connecting to $DSN\n";
     print "Error: " . Win32::ODBC::Error() . "\n";
 exit;
}

# This is a query which calls an access database for values which we are
going to use to create dynamic filenames.
$sql = "SELECT Test_Index.TestID,Test_Index.MUT,Test_Index.Test
FROM Test_Index;";
$dsn = "cell05";
$db = new Win32::ODBC($dsn);
$db->Sql($sql);
while ($db->FetchRow()) {

#this is the part which produces values from the query and turned into
perl variables
      ($TestID, $MUT, $Test) = $db->Data("TestID", "MUT", "Test");
# here the values are run through the loop to lookup and query the
filenames
# this is where the trouble is..It seems the filenames created from the
query are output as one big chunk and not looped # # through one at a
time to run the mirror command
       if ($Test EQ "ftptest"){
            $res = "$MUT.$TestID.txt";
            $url= 'http://128.125.101.202/tests/$res';
            $data= 'C:/Inetpub/Perl/$res';
            mirror($url, $data);
   }
 }
$db->Close();



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

Date: Mon, 03 Nov 1997 13:43:52 -0600
From: Scott Yanoff <yanoff@alumni.cs.uwm.edu>
Subject: Re: Execution time in Perl
Message-Id: <345E2978.7EEC@alumni.cs.uwm.edu>

chds652 wrote:
> 
> cjz wrote:
> 
> > Hello,
> > I am trying to find a way to time the execution of a script.  At this
> > time I have implemented something very simple that grabs the "time" in
> > seconds at the start of the scripts and grabs it again at the end,
> > compares them and prints out the time in seconds.
> >
> > I am looking for a way to measure the execution time more accurately,
> > say in 10ths, 100ths, 1000ths etc. of a second.  Please help.

I think one other way you can do this, if you are on a UNIX platform and
running the PERL script by hand, is to put the word "time" before the
perl script:

$ time some_script.pl

The man page should have more info.
-Scott


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

Date: Mon, 03 Nov 1997 12:50:39 -0500
From: Glen Culbertson <nnyxcu@ny.ubs.com>
Subject: Re: Inserting characters into a string.
Message-Id: <345E0EEF.307C@ny.ubs.com>

Andy Rutledge wrote:
> 
> Ok, how would I go about inserting a certain character after every fourth
> letter in a string?
> 

"X" after every 4th letter in $string:

$string =~ s/(....)/$1X/g;


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

Date: Mon, 3 Nov 1997 09:41:41 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Roy Culley <tgdcuro1@gd2.swissptt.ch>
Subject: Re: open() and pipes
Message-Id: <Pine.GSO.3.96.971103085954.10568Z-100000@usertest.teleport.com>

On 3 Nov 1997, Roy Culley wrote:

> Opening a pipe seems the only obvious way to do it but I
> would like to know if the open has failed. 

Well, if the open failed, you can pretty much count on getting no data
through the pipe. :-)  But here's something better.

    pipe(R,W) or die "Can't make pipe: $!";
    my $pid = open(PIPE, "-|");
    die "Couldn't fork: $!" unless defined $pid;
    unless ( $pid or exec qw{some process} ) {
	# If we get here, we're the child process
	# and the exec didn't work. :-(
	print W "Exec failed: $!";
	exit;
    }
    # Parent process here
    close W;	# Got to do this to avoid blocking
    my $message = join '', <R>;
    close R;	# Waits until either exec or exit
    die "Pipe problem: $message" if defined $message and $message;
    # At this point, the pipe is ready to go.
    print "Got: $_" while <PIPE>;

Does that technique do anything good for you? 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: Mon, 3 Nov 1997 17:56:31 -0000
From: "Bob Browning" <bob@textor.com>
Subject: Performance question
Message-Id: <63l2vb$n2r$1@plug.news.pipex.net>

I have a 2 meg database with about 30,000 records.  I will need to access
directly by key and also to search the database.

Question.

If I use the feature of the language that allows you to treat a file as an
associative array will the performance be OK for this sort of size.  It will
be running on a fairly ordinary PC with BSD Unix.

Any one with experience of this ???




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

Date: Mon, 03 Nov 1997 14:02:44 -0600
From: sue@telepres.com
Subject: perl compiler
Message-Id: <878586799.12431@dejanews.com>

I have been trying to compile a perl script (sub programme) to Bytecode
which will be called in a main perl script. Can anyone tell me what is
the command to call (or include) the compiled bytecode programme in perl
script?

many thanks.

 ....Sue...

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


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

Date: 03 Nov 1997 13:03:00 -0500
From: Kevin Lambright <kevinl@ascend.com>
Subject: Re: Perl debug
Message-Id: <yhfoh41dfe3.fsf@ascend.com>

Jack LaVigne <lavigne@houston.wireline.slb.com> writes:

> 
> When I read perl documentaiton it talks about debug
> support in emacs.
> 
> I have perl-mode.el in my emacs path. It appears to
> be related to writing perl code; similar to c-mode, etc.
> 
> Where can I get documentation that explains how to set up
> and run perl in debug controlled by emacs?

Having perl-mode.el is good, but it won't get you the debugger.  You 
also need perldb.el (or perldb+.el, which has cleaned up a few things).

Put this in your personal emacs lib path, or your site emacs lib path,
byte compile it, if you wish and add the following lines to your
 .emacs file:

(autoload 'perldb "perldb+" "Major mode for running the Perl debugger." t)
(add-hook 'gud-mode-hook '(lambda () (load "perldb+" t t)))

Note, I'm using perldb+.  If you are going to use the standard perldb,
substitute 'perldb' for 'perldb+' above.

Both perldb.el and perldb+.el can be obtained from CPAN.

Hope this helps,

Kevin
-- 
------------------------------------------------------------------------------
Kevin Lambright                                    email: kevinl@casc.com
Ascend Communications                              voice: 978-952-7407
1 Robbins Road                                     fax:   978-692-1510
Westford, MA 01886


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

Date: Mon, 03 Nov 1997 18:48:45 +0100
From: Oliver Cramer <info@cramermedia.com>
Subject: PERL programmer wanted !   PERL Programmierer gesucht
Message-Id: <345E0E7D.D75F8F37@cramermedia.com>

I am searching for a reliable PERL programmer for a small! programm.
Please message me, if you're interested.

Ich suche einen zuverldssigen PERL programmierer f|r ein kleines
Programm.
Email mir, wenn Du interessiert bist.

Oliver Cramer
oliver@cramermedia.com



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

Date: 3 Nov 1997 18:05:54 GMT
From: millerb@millerb.fc.hp.com (Bryan Miller)
Subject: Re: Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
Message-Id: <63l3q2$6pk@fcnews.fc.hp.com>

Abigail (abigail@fnx.com) wrote:
: Randal Schwartz (merlyn@stonehenge.com) wrote on 1520 September 1993 in
: <URL: news:8c3elkbsa3.fsf@gadget.cscaper.com>:
: ++ >>>>> "Andrew" == Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> writes:
: ++ 
: ++ Andrew> I generally use a .pl extension on my perl scripts so my editor 
: ++ Andrew> (which recognizes extensions) is in perl-mode when I open them.
: ++ 
: ++ If you're editor is Emacs, you can train it to notice the #! line as
: ++ well.  If your editor *isn't* Emacs, why not? :-)

: I hate using an editor to give me a directory listing.

Well then, don't.  I'm not a huge Emacs fan but cperl-mode is pretty
trick.  The electric braces and the color faces for reserved words
can make human perl parsing much easier.

I used to use .pl in Perl 4.xx days but I eschew it now.  As a
SysAdmin I avoid names that are not intuitive or are inordinately
long for the users sake.


Bryan
(An Emacs user who never uses Emacs to get directory listings)


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

Date: 3 Nov 1997 19:56:43 GMT
From: dsiebert@gate.net (David Siebert)
Subject: Perl, Sendmail, CGI
Message-Id: <63la9r$1070$1@news.gate.net>

Does anyone have some good sample code for using sendmail in a perl script?



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

Date: Mon, 03 Nov 1997 18:43:06 +0100
From: Oliver Cramer <info@cramermedia.com>
Subject: PROGRAMMER WANTED !!!
Message-Id: <345E0D2A.2107F7BB@cramermedia.com>

I am searching for a reliable perl programmer for a small! programm.
Please message me, if you're interested.

Oliver Cramer
oliver@cramermedia.com



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

Date: Mon, 03 Nov 1997 12:02:39 -0600
From: lbudney@fore.com
To: lbudney@fore.com
Subject: Q: Precise Timestamps in Perl?
Message-Id: <878578981.3598@dejanews.com>

Hi everyone,

Sorry if this is a FAQ--I've checked the FAQs and man pages without
result already.

I want to generate unique filenames using timestamps and PIDs, but
the time() function in Perl returns a 1-second timestamp.  That is
too granular in general.  Is there a way in Perl to generate a
millisecond or microsecond timestamp?

With gcc, I would simply access the member time_t.tm_usec to get a
microsecond timestamp.  Is there a Perl-ish analogue?

Thanks!
Len Budney
lbudney@fore.com

PS Please CC me, since my usenet access is unreliable lately.  Thanks!

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


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

Date: Mon, 03 Nov 1997 10:39:10 -0800
From: Atul Mohidekar <atulm@sequent.com>
Subject: Question on DB_file and tie function
Message-Id: <345E1A4E.2133@sequent.com>

Hi all,
	I am using tie(%somehash,DB_File, $filename, O_RDWR|O_CREAT|O_NONBLOCK,
0700, $DB_HASH)|| die "Could not open DBM file $database : $!\n"; 
 to open a dbm file if it exists or open a new dbm file $filename.dbm.
Here $filename = "XYZ";
What is happenning is that even if the file $filename.dbm exists in the
current directory the script gives a warning "Can't open XYZ.dbm:No such
file or directory"
and goes ahead and opens the existing XYZ.dbm and completes normal
processing.

Can anyone tell me How this ugly warning message can be suppressed?

BTW: I am using Perl 5.003 on Unix(DYNIX/ptx4.4).

Thanks in advance.

Ramesh chandra.
Sequent Computers Inc
USA


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

Date: 3 Nov 1997 11:57:43 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Reading a Binary file.
Message-Id: <63l3an$6og$1@Starbase.NeoSoft.COM>

How did you go about reading 59 bytes?  Did you get the bytes and then
not be able to interpret them, or did you not get the bytes?

Unpack is what you need.

od (Octal debugger) is a utility that might help you figure out the 
exact format of your file.

We really need more idea about what you are doing to provide any
real help.

Will

In article <63a2l4$t3h@news1.infinet.com>,
Chad Edwards <cedwards@infinet.com> wrote:
>I am trying to convert a program I wrote in C++ to Perl for Win NT. I 
>have a binary file which has X number of records each being the same 
>number of bytes long. (59 I believe). In C++, I opened the file as a 
>binary file and read the 59 bytes into a character buffer. Then I parsed 
>the buffer (some bytes are unsigned integers some are unsigned chars) to 
>print the results to a pure TEXT file.
>
>I know that I have to set binmode(filehande) when I open the file, but 
>I'm having some problems actually reading/converting the data. I tried 
>to read 59 bytes and then use the unpack, but I have yet to be successfull.
>
>Any suggestions?
>
>--
>
>
>______________________________________________________________________________
>http://www.infinet.com/~cedwards 
>
>Official home of RMBL! http://rmbl.ml.org
>E-mail dferry@flash.net to be put on the waiting list.
>Owner/GM/Manager of the Columbus Capitals
>_______________________________________________________________________________
>


-- 
# Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else/
 =========================================================================
      By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
      meets the definition of a telephone fax machine. By Sec.227(b)
      (1)(C), it is unlawful to send any unsolicited advertisement to
      such equipment, punishable by action to recover actual monetary
      loss, or $500, whichever is greater, for EACH violation.
 =========================================================================



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

Date: Mon, 03 Nov 1997 19:05:43 GMT
From: anderst@XISPX.se (Anders Thelemyr)
Subject: Re: Real Newbie Question
Message-Id: <34611e99.104747691@news.algonet.se>

tadmc@flash.net (Tad McClellan) said:
>The first thing you should know is that
>Perl != CGI

I knew that... But obviously I thought that for a newbie like me perl would
be the best start to write cgi-programs.

>In fact, most uses of Perl are for things OTHER than CGI programming,
>though Perl does seem to shine in that application area too.
>You can write CGI scripts in nearly any language.

>If you have a specific question about a module, ask it here (or in the
>comp.lang.perl.modules newsgroup).

Well... you see my problem is that I don't know:

1) What a perl module is
2) Why there is more than one of 'em
3) Why I might want to use one or more 

In my -imagination- (quite vivid, thank you very much!) i figure A Perl
Module is a bit of perl code that performs a certain task and that can be
"pasted" into a bigger program.  

>This is the Perl newsgroup. Perl does not have a "server".
>There are other newsgroups for discussing that, such as:
>   comp.infosystems.www.servers.ms-windows

Hmm... I was unclear, sorry for that. What I meant was that there seem to
be some kind of "plug-in" to Win95 that enables one to run perl programs
and my question was how that wurks.  

>=head2 My CGI script runs from the command line but not the browser.  
>       Can you help me fix it?
>
>Sure, but you probably can't afford our contracting rates :-)
>
>Seriously, if you can demonstrate that you've read the following FAQs
>and that your problem isn't something simple that can be easily
>answered, you'll probably receive a courteous and useful reply to your
>question if you post it on comp.infosystems.www.authoring.cgi (if it's
>something to do with HTTP, HTML, or the CGI protocols).  Questions that
>appear to be Perl questions but are really CGI ones that are posted to
>comp.lang.perl.misc may not be so well received.
>
>The useful FAQs are:
>
>    http://www.perl.com/perl/faq/idiots-guide.html
>    http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
>    http://www.perl.com/perl/faq/perl-cgi-faq.html
>    http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
>    http://www.boutell.com/faq/
>-------------------------------------

Thanks for the links.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A Message From Anders Thelemyr
* Change "XISPX" to "algonet" in my return address when emailing
** About BIK!: http://www.swehockey.se/boden/
*** Hockey Norrland: http://www.algonet.se/~anderst/hockeynorrland/


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

Date: Mon, 3 Nov 1997 14:29:10 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Real Newbie Question
Message-Id: <m6cl36.kdg.ln@localhost>

Anders Thelemyr (anderst@XISPX.se) wrote:
: tadmc@flash.net (Tad McClellan) said:
: >The first thing you should know is that
: >Perl != CGI

: I knew that... But obviously I thought that for a newbie like me perl would
: be the best start to write cgi-programs.


Good choice ;-)

I might suggest learning one thing at a time though.

Learning Perl and CGI at the same time is a long row to hoe.

Learn Perl first, then after you have it making OK looking HTML output,
then turn your attention to the myriad details specific to CGI rather
than to Perl programming.


: >In fact, most uses of Perl are for things OTHER than CGI programming,
: >though Perl does seem to shine in that application area too.
: >You can write CGI scripts in nearly any language.

: >If you have a specific question about a module, ask it here (or in the
: >comp.lang.perl.modules newsgroup).

: Well... you see my problem is that I don't know:

: 1) What a perl module is


"canned" routines, ready to use.


: 2) Why there is more than one of 'em


They are "logically" (it is hoped) grouped together.


: 3) Why I might want to use one or more 


Mainly because they have been proven to work  ;-)

Also to avoid re-inventing a wheel that is already working fine.


: In my -imagination- (quite vivid, thank you very much!) i figure A Perl
: Module is a bit of perl code that performs a certain task and that can be
: "pasted" into a bigger program.  


Kinda.

Routines can be _called_ from a bigger program, no cut/paste required. 


: >This is the Perl newsgroup. Perl does not have a "server".
: >There are other newsgroups for discussing that, such as:
: >   comp.infosystems.www.servers.ms-windows

: Hmm... I was unclear, sorry for that. What I meant was that there seem to
: be some kind of "plug-in" to Win95 that enables one to run perl programs
: and my question was how that wurks.  


Oh, well maybe you want this snippet from the Perl FAQ, part 2 then:

 ------------------------------
=head2 What machines support Perl?  Where do I get it?

The standard release of Perl (the one maintained by the perl
development team) is distributed only in source code form.  You can
find this at http://www.perl.com/CPAN/src/latest.tar.gz, which is a
gzipped archive in POSIX tar format.  This source builds with no
porting whatsoever on most Unix systems (Perl's native environment),
as well as Plan 9, VMS, QNX, OS/2, and the Amiga.

Although it's rumored that the (imminent) 5.004 release may build
on Windows NT, this is yet to be proven.  Binary distributions
for 32-bit Microsoft systems and for Apple systems can be found
http://www.perl.com/CPAN/ports/ directory.  Because these are not part of
the standard distribution, they may and in fact do differ from the base
Perl port in a variety of ways.  You'll have to check their respective
release notes to see just what the differences are.  These differences
can be either positive (e.g. extensions for the features of the particular
platform that are not supported in the source release of perl) or negative
(e.g. might be based upon a less current source release of perl).

A useful FAQ for Win32 Perl users is
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
 ------------------------------



: Thanks for the links.

You are welcome.


If you had all of the *.pod files that come with the perl distribution,
you would have hundreds and hundreds of lines info on how to program
with Perl.

(those are where I keep quoting all this stuff from...)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 03 Nov 1997 12:55:11 -0600
From: kimtan@lucent.com
Subject: running remote shelll under suid perl script ?
Message-Id: <878573468.30494@dejanews.com>

I have the follwing script :

ENV{'PATH'}='/usr/bin:/usr/local/bin';

$result = `remsh remotehost -l remoteuser './getresult';

it complain about unsafe ENV{PATH};

here getresult is another regular perl script on the remote machine.

I then tried this :

$result='remsh remotehost -l remoteuser 'export
PATH=/usr/bin;./getresult';

this won't work, I then tried to put the ENV{PATH} setting in the remote
perl script "getresult", this won't work also.

The script runs fine under Solaris, but not under HP where it is using
suidperl.

Any suggestion ?

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


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

Date: Mon, 03 Nov 1997 14:10:50 -0600
From: Bob Jones <Bob.Jones@WKU.EDU>
Subject: suid problem.
Message-Id: <345E2FCA.54B191D6@WKU.EDU>

Hello there.  I have a perl script that is running suid as root.  When
it tries to create a new file with the open command, I get an error
which says "insecure dependency in open while running setuid."  From
reading the persec faq, I understand that this is because such an action
is tainted.  I also read the following description on how to get around
this:

Perl provides a reasonably safe way to open a file or pipe from a setuid
or setgid program: just create a child process with reduced privilege
who does the dirty work for you. First, fork a child using the special
open syntax that connects the parent and child by a pipe. Now the child
resets its ID set and any other per-process attributes, like environment
variables, umasks, current working directories, back to the originals or
known safe values. Then the child process, which no longer has any
special permissions, does the open or other system call. Finally, the
child passes the data it managed to access back to the parent.  Because
the file or pipe was opened in the child while running under less
privilege than the parent, it's not apt to be tricked into doing
something it shouldn't. 

That is all fine and good, and I've tried my best to do this, but I
can't seem to get it to work.  Could someone be kind enough to e-mail me
(please use e-mail since I don't have time to read newsgroups often) a
snippet of code that would effectively create a new file for output,
bypassing the taint problem.  I would greatly appreciate it.

Thanks,
Bob Jones
Bob.Jones@WKU.EDU


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

Date: Mon, 3 Nov 1997 20:26:36 +0000 (GMT)
From: fred@no.spam.leeds.ac.uk
Subject: Taking notice of "Use of uninitialisaed value" warnings
Message-Id: <345EA37E.7C5E@no.spam>

On many occasions, such a warning is generated when one has not
realised how a particualar Perl construct works or has made an error
in the analysis of a problem. In such cases, the warning is helpful
to say the least.

However, I have found three situations when this warning appears
otiose:

1. When one has deliberately undef'd $/ to slurp a file whole;
2. When printing a complete Config;
3. When printing the results of dumpvar.

First, am I doing something wrong to get such warnings in any
of these situations, and second, is there a recognised way of
removing them when the undef'ness is known and potentially 
useful.

Ben.


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

Date: Mon, 3 Nov 1997 08:59:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Erik Symonds <eriks@haestad.com>
Subject: Re: trouble with 'application/octet-stream' script
Message-Id: <Pine.GSO.3.96.971103085821.10568Y-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Erik Symonds wrote:

> Is there a header, or other method, that I can use to send a 
> name to the browser to use upon bringing up the save dialog box?

If there is, it should be found in the docs and FAQs about HTTP or
browsers. If you can't find it there, check with a newsgroup about those
things. 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: Mon, 3 Nov 1997 20:41:37 +0100
From: "Manfred Schneider" <manfred.schneider@rhein-neckar.de>
Subject: What's New? 6000+ links on Object-Orientation (in English & French)
Message-Id: <63l971$4c4$1@trumpet.uni-mannheim.de>

From:           The Cetus Team
Subject:        Cetus Links -- 6000+ links on Object-Orientation
Newsgroups:     Some comp.* newsgroups related to OO
Summary:        News, editions, topics, URLs, team members
Posting-Freq.:  Monthly

Hello,

are you interested in a collection of more than 6000 links on
Object-Orientation - running on 14 servers in 12 countries ?

No ads, few graphics, fast and free access!

What4s new?
   o   New page 'Repositories'
   o   New structure for pages 'C++' and 'Visual C++'
   o   French pages 'Methods' and 'Tools' are now translated weekly
   o   Access counter exceeds 200,000 (100,000 hits since May '97)
   o   All URLs checked; broken and moved URLs adjusted manually

Available editions:
   o   English
   o   French

Main topics:
   o   General Information and Links about Object-Orientation

   o   Distributed Objects, Business Objects, Mobile Agents, Object
       Request Brokers, ActiveX/OLE, Corba, Java Beans/RMI, OpenDoc

   o   OOA/OOD Methods and Tools, Diagram Layout

   o   Languages, Ada, BETA, C++, CLOS, COBOL, Delphi, Dylan,
       Eiffel, Java, JavaScript, Modula-3, Oberon, Objective-C,
       Perl, Python, REXX, Sather, Self, Simula, Smalltalk,
       Tcl/Tk, VBScript, Visual Basic, Visual C++

   o   Databases, OO DBMS, OR DBMS, OR Mapping, Repositories

   o   Patterns, Libraries, Frameworks, Metrics, Reuse, Testing, Numerics

   o   Services and Companies

Web Sites:
   o   The main site runs at Heidelberg, Germany
   o   The French edition runs at Quebec, Canada
   o   URLs of all sites:

       Germany      http://www.rhein-neckar.de/~cetus/software.html

       Canada       http://www.csioo.com/cetusen/software.html
       USA/IL       http://www.objenv.com/cetus/software.html
       USA/VA       http://www.eidea.com/OO_site/cetus/software.html
       USA/WA       http://mini.net/cetus/software.html

       Australia    http://www.csse.swin.edu.au/manfred/software.html
       Japan        http://aries.ise.eng.osaka-u.ac.jp/cetus/software.html
       Singapore    http://sunsite.nus.sg/pub/cetus/software.html

       Austria      http://www.infosys.tuwien.ac.at/cetus/software.html
       Netherlands  http://www.objecthouse.nl/cetus/software.html
       Russia       http://oop.rosweb.ru/cetus/software.html
       Spain        http://www.uax.es/uax/oop/software.html
       Switzerland  http://www.sente.ch/cetus/software.html
       UK           http://www.parallax.co.uk/cetus/software.html

       French ed.   http://www.csioo.com/cetusfr/software.html

Cetus Team Members:
   o   Ralf Comtesse      (Databases, OO DBMS, OR DBMS, OR Mapping)
   o   Bernard Ctti       (Methods, Tools)
   o   Wolfgang Lugmayr   (Mobile Agents)
   o   Georg Odenthal     (Patterns)
   o   Eugene Siu         (Java)
   o   Elizabeth Veitch   (CORBA, Object Request Brokers)
   o   Rich Wellner       (Python; tool support)
   o   Manfred Schneider  (all other pages)

We hope you will find the Cetus Links useful.

Please feel free to send new or changed URLs, comments or suggestions.

Manfred





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

Date: Mon, 3 Nov 1997 13:57:58 -0500
From: "Victor A. Cuya" <vcuya@mindspring.com>
Subject: Win32::NetResource - Anyone?
Message-Id: <63l706$q2b@camel20.mindspring.com>

I have been trying to implement this extension package to no avail. The
documentation is kind of spotty. Has anyone got it working properly. If so,
would you mind sharing your code.

TIA

Victor A. Cuya
vcuya@mindspring.com
victor_cuya@ccmail.prusec.com




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

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 1266
**************************************

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