[7087] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 712 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 9 03:27:11 1997

Date: Wed, 9 Jul 97 00:00:40 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Jul 1997     Volume: 8 Number: 712

Today's topics:
     /x problem (Fan Ng)
     Re: 500 Server Error - Perl & Win 95 PWS (Michael Adams)
     Re: a2p subroutine not found <rootbeer@teleport.com>
     Re: Attention CGI/PERL/C++ Elite. Dream Job Offer. xewj@odin.sunquest.com
     Browser Variables <jsteven@sirris.com>
     Do i need perl 5.004 to use sysopen (P.M.Wong )
     Re: Help me to find my loose change !!! <sandler@501.yc.yu.edu>
     help using ~s/ / / please! (shane whinfrey)
     Re: help!? small and easy perl script accessing a music <rootbeer@teleport.com>
     How to constantly get contents of a Web page <gohhonge@iscs.nus.edu.sg>
     opening mail program in NT <ryan@erian.com>
     Re: opening mail program in NT (Nathan V. Patwardhan)
     Re: opening mail program in NT <bat@unifi.com>
     Re: owner of files created by my scripts is 'nobody'... (Tad McClellan)
     Re: Perl is 20 times slower on Cray J90 than SGI! <Brett.W.Denner@lmtas.lmco.com>
     Perl4.036 on Solaris 2.5.1 <jcicardo@swbell.net>
     Re: PGP or any-other crypt interface module for Perl? <keys@babylon5fan.corn.on.the.cob>
     Re: Please help troubleshoot this for me.... (Tung-chiang Yang)
     Re: print reverse (M.J.T. Guy)
     Re: resolving relative paths? <aas@bergen.sn.no>
     Re: Shellscript -> perl <rootbeer@teleport.com>
     Re: Shellscript -> perl <zenin@best.com>
     Re: stat of files on NFS filesystems in Solaris (Casper H.S. Dik - Network Security Engineer)
     Re: Statistic functions for PERL? (Colin Kuskie)
     Web Architect <recruiter@lds.com>
     Re: WIN32 Perl head aches! (Michael Adams)
     Re: Writing to a text file (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 09 Jul 1997 03:27:00 GMT
From: FANNGMAIL@prodigy.net (Fan Ng)
Subject: /x problem
Message-Id: <33c3fad6.961334@news.prodigy.net>

Hi all:

I looked a book where said The /x modifier can break up your regular expression
into (slightly) more readable parts. 
My qurestion is "How to break up"????
Thanks


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

Date: Wed, 9 Jul 1997 01:02:01 GMT
From: msadams@netcom.com (Michael Adams)
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <msadamsED11JD.5nM@netcom.com>

Fortunately, there were some very nice people who e-mailed me with 
suggestions, and the situation is solved.  I want to thank those who 
took the time to help.  Your effort is very much appreciated.

Michael Adams
-- 
                                             msadams@netcom.com


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

Date: Mon, 7 Jul 1997 16:20:18 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David Zeng <dizzy@soda.CSUA.Berkeley.EDU>
Subject: Re: a2p subroutine not found
Message-Id: <Pine.GSO.3.96.970707161614.10643S-100000@kelly.teleport.com>

On 7 Jul 1997, David Zeng wrote:

> I have a question regarding the a2p (awk to perl) function 

It's not a function; it's a separate program. You call it from the command
line.

> as well as a filehandle question. 

In general, it's best to post two separate questions as two separate
messages. That way, if I know the answer to only one question, I can
answer only one.

> I opened a file by calling:
> 	open(AFILE, $pathname> or die "Wrong file: $!\n";

You must have meant a right paren instead of a right angle bracket there.
(And I don't think that "Wrong file" is a good diagnostic. Maybe "Can't
open '$pathname' for input: $!" would be better.)

> If I want to do something with this "AFILE" now, such as putting each line
> terminated by \n into one cell of a multi-dimensional array for 
> temporary storage.  

Is this what you want? It's not multi-dimensional, but I needed only one
dimension! :-)

    @array = <AFILE>;

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/



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

Date: 6 Jul 1997 06:03:56 GMT
From: xewj@odin.sunquest.com
Subject: Re: Attention CGI/PERL/C++ Elite. Dream Job Offer.
Message-Id: <5pncgc$q1l$1@iggy.sunquest.com>

While I abhor advertisements, I thought this was a good point of discussion:

In article <5pkjpv$3tj$13@neptune.uniserve.com>,
 <psyboyvych@inter-nexus.com> wrote:
>To the CGI/PERL/C++ Elite:

Okay, you're looking for really good programmers.

>A private organization needs your help to finnish a highly specialized
                                           ^^^^^^^
>HTML project called the "Internexus".

Are we penalized for writing it in english instead?

>The first 75 programmers who submit their name will be interviewed for
>the job.

Ooo! 75 people limit! I'm sure we'll see that fill up fast... NOT!

>The people chosen will recieve shares in our Web Design company and an
>optional position as systems administrator and/or HTML author with the
>company.  Approx. $18k to start, part time.
>You will not need to relocate as the virtual office works great!

$18k, part time! from home! were you can work full time for someone else!

I have several complaints with this posting:
(1) It's really in the wrong newsgroup. it has nothing to do with programming
in perl and everything with advertising for people to work their hinies off
creating scripts for a website. Despite the "web"ization of this newsgroups,
it really shouldn't be posted here.
(2) The 75 person limit is a blatant push for people to get back to the poster
ASAP. I'm sure that if an "Elite" person who didn't know what a perl manpage
looked like responded, their resume would just clear the stack of "75"
selections and land in the circular file.
(3) Who the heck cares that the project is named "Internexus"??? It's not like
the name has been smeared across TV for the last week. This is yet another
blatant attempt to incure a knee-jerk reaction to respond without thinking out
it. The total lack of useful information as to the focus of the project is
truely annoying- if this "company" were really interested in hiring experienced,
"_elite_" programmers, they should be supplying a whole bunch of info as to
the area(s) of expertise they're looking for. but... nope!
(4) The last bit about "chosen people" really irks, too: if you're lucky enough,
you'll not only get to write scripts, but adm the site and create the pages for
the site too! Jeez...
(5) Final annoyance: $18k?? For parttime?? This is what you would pay somebody
right out of college, in most areas. Definitely not what a professional, "elite"
programmer would earn for his/her time on a project.

All in all, I found this post very insulting to the purpose of the newsgroup
and to the professionalism of perl developers in general. 
Maybe I'm just sick of seeing blatant hype.


Frankly, I would classify this along with those annoying posts from the
"Woodside Publishing Company" or whatever it is.

Hey... maybe they're putting up a website! [sick grin]



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

Date: Sat, 05 Jul 1997 13:00:22 +0000
From: "James Steven" <jsteven@sirris.com>
Subject: Browser Variables
Message-Id: <5pm9he$50l$1@brokaw.wa.com>

Quick Question:

I know it's possible to get the user's browser name as a variable:
$home_ref = "http://$ENV{'SERVER_NAME'}";
$agent = $ENV{'HTTP_USER_AGENT'};

Is it possible to get the user's location in a variable?
Location meaning: http://www.bob.com/whereever/tom.html

If you know, could you please let me know.

Thanks!

-JSteven


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

Date: 7 Jul 1997 07:32:43 GMT
From: s11976@ctsc.hkbc.hk (P.M.Wong )
Subject: Do i need perl 5.004 to use sysopen
Message-Id: <5pq62r$81a$1@power42t.hkbu.edu.hk>

I tried the sysopen command under our unix that has perl
version 5.001 installed
It always complaint :
Undefined subroutine &main::sysopen called at line n
I did put in the command
use Fcntl;
before the sysopen statment
Now could it be the version of perl is not high enough or what? 

--
        __
   / \_/  )             __   Pui Ming WONG (E-mail: pm@hkbu.edu.hk) 
  /      ( -------------  }  System Support Programmer, 
 (  =l=ll===============__}  Computing & Telecomm. Services Centre
  \   _  (                   Hong Kong Baptist University 
   \_/ \__)                  224 Waterloo Road, Hong Kong  


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

Date: Wed, 09 Jul 1997 00:21:19 -0500
From: Ben Sandler <sandler@501.yc.yu.edu>
To: Martin Williams <info@welnet.co.uk>
Subject: Re: Help me to find my loose change !!!
Message-Id: <33C31FCF.4AAA@501.yc.yu.edu>

Martin Williams wrote:
> 
> I have written a few scripts that procee financial transactions but thus
> far I have been unable to round my numbers up to 2 decimal places !!!
> 
> Please help me as I think I'm going crazy.
> 
> Martin Williams

Try this:

$num = 345.6789;
$num = $num*100;
print "$num\n";
if ($num =~ /\.[5-9]/) {$num =~ s/\..+//g; $num=$num/100;
$num=$num+.01;}
else {$num =~ s/\..+$//g; $num=$num/100;}                               
- Ben


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

Date: Mon, 07 Jul 1997 21:45:16 GMT
From: oa32@dial.pipex.com (shane whinfrey)
Subject: help using ~s/ / / please!
Message-Id: <33c161e1.14731203@news.dial.pipex.com>


hello!

i have a routine that replaces \r and \n with *!* and *!!* in a text
string :-

      $form_data{$field} =~s/\r/*!*/g;
      $form_data{$field} =~s/\n/*!!*/g;

which works great. but when i try to reverse the process and put \r
and \n back in place, like this:-

    $print_address =~s/*!*/\r/g;
    $print_address =~s/*!!*/\n/g;

i get the following error message:-

     /*!*/: ?+* follows nothing in regex

could someone tell me where i'm going wrong please?

shane whinfrey
<shane.whinfrey@dial.pipex.com>


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

Date: Tue, 8 Jul 1997 09:46:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Carola Boehm <carola@music.gla.ac.uk>
Subject: Re: help!? small and easy perl script accessing a music database
Message-Id: <Pine.GSO.3.96.970708094115.10418G-100000@kelly.teleport.com>

On Tue, 8 Jul 1997, Carola Boehm wrote:

> I may need some help from quick help from perl experts. I will have to
> write a small script in perl without having ever done so before. Before
> I get into reading all about perl, maybe you can give me some quick
> solutions. 

I'd do what I can for you, but there's no substitute for actually learning
Perl. I'm not trying to be mean here; the only way to get a script written
without learning is to get somebody else to write it for you! :-) 

I'm sure you can see that if I asked for some quick tips on playing the
piano, you couldn't do much more than tell me to learn to read music so
that I'd know which keys to press!

For learning Perl, a good place to start is with a book like the venerable
Llama book, mentioned in the perlbook manpage and available at your local
bookstore. 

> -   Write a script or program that accepts 2 command line arguments, 
>     a temp file name and query term. 

Getting command line arguments in Perl is done with @ARGV, documented in
perlvar. 

> -   In the script, I call and get results of a database query (I know
> this bit)
> 
> -  and then I write 
>     the results of your operation into the temp file I received on the
>     command line in a acertain format.

Probably using printf, documented in perlfunc.

Good luck with your project!

-- 
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/



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

Date: 9 Jul 1997 05:20:23 GMT
From: Out Of The Blue <gohhonge@iscs.nus.edu.sg>
Subject: How to constantly get contents of a Web page
Message-Id: <5pv72n$qd4@nuscc.nus.sg>

hi,

	I need to write a program that will keep getting
	the (changing) Web content for a URL, for my school 
	project :( Anyone can give any hints :) 



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

Date: 8 Jul 1997 00:48:36 GMT
From: "Ryan McGuigan" <ryan@erian.com>
Subject: opening mail program in NT
Message-Id: <01bc8b39$131262a0$96372299@ryan>

Please!  Please! help me.  I have no idea what the problem is.

I've tried

$mail_prog = "c:/winnt/system32/blat.exe - -t $recipient";
open (MAIL, "|$mail_prog") || die "cannot open program";
print MAIL $message;
close (MAIL);


that's basically it, except I've tried changing the " to ' and `
sometimes it runs the program but doesn't pass the arguments.....so it
doesn't work
sometimes it says it can't open the program......

this is very important.  The company I work for wants to get rid of their
Linux server, and it's my job to move everything over to NT.




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

Date: 8 Jul 1997 02:10:54 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: opening mail program in NT
Message-Id: <5ps7je$jo8@fridge-nf0.shore.net>

Ryan McGuigan (ryan@erian.com) wrote:

: $mail_prog = "c:/winnt/system32/blat.exe - -t $recipient";
: open (MAIL, "|$mail_prog") || die "cannot open program";

Why aren't you using $! like:

open(PROG, "|etc etc") or die("hey you: $!");

or even:

open(PROG, "|etc etc") or print("hey you: $!");

I recall someone slandering NT about broken pipes at one time, 
but you'll have to confirm this with an NT expert.  I recall having
success with the blat in question on Windows 95, but in your case I
see that it's gone *blat*! :-)  

Ahem.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Tue, 08 Jul 1997 13:58:06 -0400
From: Boris Tabenkin <bat@unifi.com>
To: "Nathan V. Patwardhan" <nvp@shore.net>
Subject: Re: opening mail program in NT
Message-Id: <33C27FAE.96C58034@unifi.com>

This is a multi-part message in MIME format.
--------------4C63B776ACE470BFD0B34A17
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

I used to use blat, I also have done direct socket connections to the
mail port on a remote machine. This way you get more control, although
you have to do your own DNS lookup's of the MX record for the
destination. The CPAN libraries Net:: DNS really helps. There is also a
SMTP package in there as well, Hope it helps.

Nathan V. Patwardhan wrote:

> Ryan McGuigan (ryan@erian.com) wrote:
>
> : $mail_prog = "c:/winnt/system32/blat.exe - -t $recipient";
> : open (MAIL, "|$mail_prog") || die "cannot open program";
>
> Why aren't you using $! like:
>
> open(PROG, "|etc etc") or die("hey you: $!");
>
> or even:
>
> open(PROG, "|etc etc") or print("hey you: $!");
>
> I recall someone slandering NT about broken pipes at one time,
> but you'll have to confirm this with an NT expert.  I recall having
> success with the blat in question on Windows 95, but in your case I
> see that it's gone *blat*! :-)
>
> Ahem.
>
> --
> Nathan V. Patwardhan
> nvp@shore.net



--------------4C63B776ACE470BFD0B34A17
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Boris Tabenkin
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Boris Tabenkin
n:              ;Boris Tabenkin
email;internet: bat@unifi.com
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard


--------------4C63B776ACE470BFD0B34A17--



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

Date: Sat, 5 Jul 1997 08:33:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: owner of files created by my scripts is 'nobody'... help
Message-Id: <nfilp5.8r.ln@localhost>

Francis Cebedo (francois@mtbr.com) wrote:
: I have a perl script that is executed from a web page. This script creates
: files successfully 


Then you don't have a Perl problem. Perl is doing the Right Thing.


: but the owner of the files is 'nobody'. 


That sounds like an Operating System/Server question or something...


: This is causing
: me a lot of pain.

: Is there a way I can modify my script to avoid this? I understand this can
: be fixed on the server but I cannot control that.

What is a server?

Perl does not have a server.


Perl != CGI


I think you are talking about an HTTP server, so you should ask in
one of the comp.infosystems.www.* newsgroups.


: thank you,

Uh huh.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Tue, 8 Jul 1997 13:00:56 -0500
From: "Brett W. Denner" <Brett.W.Denner@lmtas.lmco.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl is 20 times slower on Cray J90 than SGI!
Message-Id: <Pine.SGI.3.95.970708124959.5831A-100000@scourge>


On Tue, 8 Jul 1997, Tom Phoenix wrote:

>On Tue, 8 Jul 1997, Brett Denner wrote about a simple Perl script which
>takes 14 times longer to execute on a Cray than on an SGI machine. 
>
>Gosh, you give some people a Cray and they still complain that it's not
>fast enough!

I know:  whine, whine, whine!

>Well, it may be that your copy of Perl on the Cray is not so hot for one
>reason or another. Are you using 5.004 on both machines? 

I am using 5.004 on both machines.

>Could there be some reason that your Cray is (for whatever reason) slow at
>everything? For example, if you run a simple C program, does it exhibit a
>similar differential? 

No, a similar C program actually runs some 80 times faster on the Cray
than the SGI.  If my Perl program were to run 80 times faster on the Cray
also, instead of 14 times slower, that means my Perl script runs (let's
see, 80 / (1/14) is 1120) over a *thousand times slower* on the Cray than
one would expect.  Can you see why I'm bummed?

>There may also be some Perl configuration option which makes a big
>difference. I don't know which one it would be, though.

Yeah, that's what I figured as well, but I have no idea what to set. 

Thanks for your response,

Brett

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Brett W. Denner                                    Lockheed Martin TAS
 Brett.W.Denner@lmtas.lmco.com                      P.O. Box 748            
 (817) 935-1142 (voice)                             Fort Worth, TX 76101
 (817) 935-1212 (fax)                               MZ 9333             



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

Date: Mon, 07 Jul 1997 16:34:17 -0500
From: Joe Cicardo <jcicardo@swbell.net>
Subject: Perl4.036 on Solaris 2.5.1
Message-Id: <33C160D9.771C@swbell.net>

Due to a customer requirement, I need to install Perl4 on Solaris 2.5.1.
I specified gcc as the compiler and "solaris_2_1" as the environment and
pretty much took the defaults for all the other prompts during the run
of the "Configure" script.  Here is the result of the "make":

$ make
Expect 25 shift/reduce and 59 reduce/reduce conflicts
bison -y -d perly.y
conflicts:  25 shift/reduce, 59 reduce/reduce
sh  ./perly.fixer y.tab.c perly.c
mv y.tab.h perly.h
echo 'extern YYSTYPE yylval;' >>perly.h
`sh  cflags perly.o` perly.c
          CCCMD =  gcc -c -fpcc-struct-return -traditional
-Dvolatile=__volatile__ -I/usr/ucbinclude -O  
In file included from perly.y:41:
perl.h:556: conflicting types for `sprintf'
/usr/ucbinclude/stdio.h:267: previous declaration of `sprintf'
make: *** [perly.o] Error 1

Has anyone successfully installed Perl4.036 on Solaris 2.5.1?
What do I need to do?

Thanks.


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

Date: Sat, 05 Jul 1997 13:28:37 -0600
From: Keys <keys@babylon5fan.corn.on.the.cob>
Subject: Re: PGP or any-other crypt interface module for Perl?
Message-Id: <33BEA065.DC716EC6@babylon5fan.corn.on.the.cob>

Subbu Meiyappan wrote:
> 
> Folks:
>      Is there a PGP (Pretty Good Privacy) or any-other
> encryption interface to Perl, that is already available?
> 

http://www.perl.com/CPAN/modules/by-module/PGP/

-- 
Keys
Spam sucks.  To reply, please change "corn.on.the.cob" to "com" in my
return address...
For my PGP key, mail me with "send PGP key" in the subject...


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

Date: Wed, 9 Jul 1997 04:50:22 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Please help troubleshoot this for me....
Message-Id: <tcyangED1C3y.LFr@netcom.com>

I did not check your Perl CGI very carefully, but are you sure
you want to increment the upperbound in your FOR loop instead of the
counter variable $a?

==========================================
DBenson wrote after zapping the scum of the universe:

: (deleted)

: 	for($a = 0; $a <= $sizefile;
: 	$sizefile++) {

: (deleted)

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 5 Jul 1997 13:04:32 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: print reverse
Message-Id: <5plgp0$1s9@lyra.csx.cam.ac.uk>

Honza Pazdziora <adelton@fi.muni.cz> wrote:
>So you might want to try
>
>print scalar(reverse("12345"));

Or perhaps

 print +reverse "12345";

if you're more interested in obscurity than typing.


Mike Guy


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

Date: 09 Jul 1997 08:35:04 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: resolving relative paths?
Message-Id: <hafjwohrb.fsf@bergen.sn.no>

Todd Hoff <tmh@possibility.com> writes:

> Is there a trick to resolving relative paths? To me the following 
> code should produce an absolute path:
> --------------
> use URI::URL;
> 
> $path= "../image/red.gif";
> $base= "http://www.somewhere.com/nirvana";
> 
> $url = new URI::URL($path, $base);
> $link= $url->abs->as_string ;
> --------------
> 
> But it doesn't. Is there something else going on? I did
> a trace and the abs method in _generic.pm is being called
> but it is not making an absolute path.

What would you expect the absolute path to be?  RFC1808 says:

   Parsers must be careful in handling the case where there are more
   relative path ".." segments than there are hierarchical levels in the
   base URL's path.  Note that the ".." syntax cannot be used to change
   the <net_loc> of a URL.

      ../../../g    = <URL:http://a/../g>
      ../../../../g = <URL:http://a/../../g>


Perhaps you should have http://www.somewhere.com/nirvana/ as base?

-- 
Gisle Aas <aas@sn.no>


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

Date: Mon, 7 Jul 1997 16:26:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Christopher Shane Adams <adamsch1@cps.msu.edu>
Subject: Re: Shellscript -> perl
Message-Id: <Pine.GSO.3.96.970707162118.10643T-100000@kelly.teleport.com>

On 7 Jul 1997, Christopher Shane Adams wrote:

>   Is there a utility that will convert shellscripts to perl?

It sounds as if you want this entry from the FAQ entitled, "How can I
convert my shell script to perl?". Hope this helps!

    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq8/
          How_can_I_convert_my_shel_scrip.html

-- 
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/



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

Date: 8 Jul 1997 02:46:10 GMT
From: Zenin <zenin@best.com>
Subject: Re: Shellscript -> perl
Message-Id: <5ps9li$dka$2@nntp2.ba.best.com>

Boris Tabenkin <bat@unifi.com> wrote:
> Christopher Shane Adams wrote:
> >   Is there a utility that will convert shellscripts to perl?
> No,

	Actually, it's pretty simple:

	#!/usr/local/bin/perl -w
	system <<'EndOfShellScript';
		your shell script goes here
	EndOfShellScript


__END__

	<grin>

-- 
-Zenin
 zenin@best.com


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

Date: 7 Jul 1997 21:11:10 GMT
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: stat of files on NFS filesystems in Solaris
Message-Id: <casper.868309938@uk-usenet.uk.sun.com>

davidb@chelsea.net writes:

>Has the behavior of stat() under Solaris and PERL changed sometime in the
>last few months/years?  I recall that a stat of an NFS mounted file at one
>time returned a negative device number if it was NFS mounted.  Programming
>PERL bears me out.  Alas, this no longer appears to be the case.

That has always been a hack; the dev_t's in some NFS implementations returned
a negative value; see the perl manual page and note that it's 
implementation dependent; also see how find2perl botches the -fstype
call (negative is NFS, all else is positive).

Try "find2perl / -fstype foo -print | perl".


>Scan of docs returns no notes to the contrary, yet I am consistently
>getting positive device numbers for NFS mounted file systems.  I could
>always fork a "df -F ufs" in my script, but hey; that ain't right.

>Anybody know what's up?  I use PERL 5.003 and Solaris 2.5.1.


Perl unfortunately doesn't support the "fstype" field as returned by
many stat implementations.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

Date: 7 Jul 1997 09:34:24 -0700
From: colink@defiant.latticesemi.com (Colin Kuskie)
Subject: Re: Statistic functions for PERL?
Message-Id: <5pr5qg$3ku@defiant.latticesemi.com>

In article <ECws3I.C18@majestix.rhein-main.de>,
Christian Gau <Christian.Gau@asterix.majestix.rhein-main.de> wrote:
>Hello everybody,
>
>I am looking for implementations of statistic functions for PERL. What
>I need is calculation of Standard deviations, variance, covariance,
>correlations and some additional mathemtic functions like Matrix
>multiplication, inversion etc.
>Any ideas - except doing it on  my own?

Check CPAN:

Statistics::
::Descriptive  RdpO  Descriptive statistical methods              JKAST
::ChiSquare    Rdpf  Chi Square test - how random is your data?   JONO

Math::
::Matrix       adpO  Matrix data type (transpose, multiply etc)   ULPFR
::MatrixCplx   idpO  Matrix data type for Complex Numbers         STBEY
::MatrixReal   RdpO  Everything you ever wanted to do with Matr.  STBEY

CPAN is the Comprehensive Perl Archive Network containing the contributions
of 296 different authors.  Their work covers everything from the fantastic
to the mundane, i.e. Windoze interface, CGI programming, text processing,
mail and new handling.  Check out:
http://www.perl.com
and it will send you to a CPAN site near you.

Or check out one of the many sites in Deutschland:

        Germany
            ftp://ftp.gmd.de/packages/CPAN/
            ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/
            ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
            ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/ 
            ftp://ftp.uni-erlangen.de/pub/source/Perl/CPAN/
            ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/

Viel gluck!
Colin Kuskie


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

Date: Mon, 07 Jul 1997 14:38:30 -0400
From: recruiter <recruiter@lds.com>
Subject: Web Architect
Message-Id: <33C137A6.25DA@lds.com>

Logical Design Solutions, a leader in the design and development of
Interactive Business Communications has an immediate full-time opening
in their Morristown, NJ office for a Web Architect.

Job Description:
In this visible role, the ideal candidate will possess experience in
configuration of Internet technologies as part of a multi-tiered     
information technology architecture.  Keeping up-to-date with
current technology trends is essential, as is the ability to evaluate
appropriate technology components for development and delivery
environments.  This individual must also have the ability to integrate
application support technologies with preexisting client IT 
infrastructure.  Experience with C/C++, Perl, HTML, Java, CGI and
knowledge of Internet protocols and standards is required.  
Knowledge of Active X a plus.

Contact:

Technical Recruiter
Logical Design Solutions
Phone: (201) 971-0100
Fax:   (201) 971-0103
email: recruiter@lds.com

For further info:   http://www.lds.com


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

Date: Wed, 9 Jul 1997 01:04:25 GMT
From: msadams@netcom.com (Michael Adams)
Subject: Re: WIN32 Perl head aches!
Message-Id: <msadamsED11nD.68q@netcom.com>

I think if you follow these instructions you can get it working:

1)  Download Build 306 of Perl (not Perlscript or ISAPI) from the 
ActiveWare site.

2)  Run the installation.

3)  Follow the instructions for the Microsoft Knowledge Base article 
Q150629, which is located at the support.microsoft.com, or at the 
ActiveWare site in their FAQ section.

4)   Be sure to accurately enter the pathname for the registry entry 
which you will be doing in step 3 above, as that fouled me up for a long 
time (C:\Perl\bin\perl.exe %s %s).  Also put the helloworld.pl script in 
a directory which can be read by PWS.  I put it in the \Webshare\Scripts 
directory.  To create the helloworld.pl script, I just cut and pasted it 
from the Knowledge Base article into Notepad, and then saved the file as 
helloworld.pl.

5)  If you have cgi scripts, you will also want to add a registry entry 
for those, too, as outlined in step 3.

6)  Make sure you restart the Personal Web Server.  This can be done 
manually, or done by restarting your computer.

7)  To run the script, I loaded Internet Explorer, and typed in 
http://default/Scripts/helloworld.pl? for the address.  Keep in mind that 
I did not change my server name when I installed PWS, so it is just 
"default".

Hope this helps,

Michael Adams
-- 
                                             msadams@netcom.com


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

Date: Sat, 5 Jul 1997 08:28:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Writing to a text file
Message-Id: <66ilp5.8r.ln@localhost>

[
   I see that you also posted this identical question separately
   to the CGI newsgroup. This is the classic definition of SPAM.

   Please do not be a spammer.

   If you have a question that applies to more than one newsgroup,
   (which you didn't anyway, this time) then please just
   crosspost it instead. Then the thousands of computers around
   the entire Earth that store news can just keep one copy on disk
   instead of the two copies that you caused to happen by spamming.
]


Gregory Reddin (ranger@onramp.net) wrote:
: Hello All:
: The following is a snipplet of code from my perl script. I would like
: to know if it's possible to write/create the "hits" file to a
: different directory 

Yes.

open(OTHER, ">/path/to/dir/that/you/have/permissions/to/write/to/hits") ||
   die "could not open 'hits' in that other place  [$!]";


: on a different server. 

Not likely. I wouldn't want just anybody writing files to MY server.

Would you?

You could do it (with cooperation from the sysadmin of the other server), 
but I expect it is more work than you really need.



: As it stands now, the file
: "hits" just gets created in the same directory as my cgi file is
: located in.

: I tried open (HITS_WR, ">http://www..../hits"), but that didn't work.


Of course that didn't work.

When you looked up "open()" in the perlfunc man page, you do doubt saw
this part?

----------------------
=item open FILEHANDLE,EXPR

=item open FILEHANDLE

Opens the file whose filename is given by EXPR, and associates it with
FILEHANDLE.  If FILEHANDLE is an expression, its value is used as the name
of the real filehandle wanted.  If EXPR is omitted, the scalar variable of
the same name as the FILEHANDLE contains the filename.  If the filename
 ...
----------------------


So, that second argument to open() must be a filename. You have not
given it a file name, so it does not work. I don't find that too
surprising...

-----



Looks to me like you have given it one of those URL thingies from the
HyperText Transfer Protocol (HTTP).

Perl is a general purpose programming language. If it had knowledge
of a particular Protocol, then it would be a specific purpose
programming language ;-)

Perl has some modules that understand HTTP and CGI though. See:

   http://www.perl.com/CPAN/


: Can anyone help me out?

You are much more likely to get answers to CGI questions in a newsgroup
that has some connection with CGI programming.



Perl != CGI



More that half of all Perl programming has nothing to do with the
World Wide Web and CGI programming.

Those type of questions are off-topic for comp.lang.perl.misc.

In the future, please post CGI questions to the CGI newsgroup:

   comp.infosystems.www.authoring.cgi



: Thanks

Uh huh.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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