[9425] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3016 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 30 14:07:36 1998

Date: Tue, 30 Jun 98 10:49:46 -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           Tue, 30 Jun 1998     Volume: 8 Number: 3016

Today's topics:
        Perl CGI Stuff ppith@my-dejanews.com
    Re: Perl CGI Stuff (Matt Knecht)
    Re: Perl CGI Stuff <quednauf@nortel.co.uk>
    Re: Perl CGI Stuff <tchrist@mox.perl.com>
    Re: Perl CGI Stuff (Abigail)
        PERL code in browser instead of page (Scott Cherkofsky)
    Re: PERL code in browser instead of page <featheredfrog@geocities.com>
    Re: Perl DB question version upgrade from 5.002  to 5.0 <qdtcall@esb.ericsson.se>
        Perl Editor for Windows NT ? (Uwe Hauck)
    Re: Perl Editor for Windows NT ? (Michael Rubenstein)
    Re: Perl Editor for Windows NT ? <jdf@pobox.com>
    Re: Perl Editor for Windows NT ? (Ivica Vucak)
    Re: Perl Editor for Windows NT ? (Patrick Timmins)
    Re: Perl Editor for Windows NT ? <k.hofer@nortel.com>
    Re: Perl Editor for Windows NT ? <mgenti@evansville.net>
    Re: Perl Editor for Windows NT ? <cwinters@intes.net>
    Re: Perl Editor for Windows NT ? <mgenti@evansville.net>
    Re: Perl Editor for Windows NT ? (Bob Trieger)
    Re: Perl Editor for Windows NT ? <chris.wareham@blackwell.co.uk>
    Re: Perl for Win-32 (Tye McQueen)
    Re: Perl for Win32 and background process (Blair Zajac)
        Perl Hash -> SQL revisited <swood@TheWild.Com>
    Re: PERL is spitting out rubbish <barnett@houston.Geco-Prakla.slb.com>
        perl newbie Q: Any ideas why this doesn't work? (Jeffrey Kaplan)
    Re: perl newbie Q: Any ideas why this doesn't work? <quednauf@nortel.co.uk>
    Re: perl newbie Q: Any ideas why this doesn't work? (John Moreno)
        Perl Script as a NT Service scythale@my-dejanews.com
        Perl script only accepts 80 characters <bn600@city.ac.uk>
    Re: Perl script only accepts 80 characters <quednauf@nortel.co.uk>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 29 Jun 1998 16:20:08 GMT
From: ppith@my-dejanews.com
Subject: Perl CGI Stuff
Message-Id: <6n8ern$d4m$1@nnrp1.dejanews.com>

Hello.  I have looked in the FAQ and "blue camel book" for a
solution to this problem.  I'm making a web page with a form
where I want a text area to contain only 80 characters.  Is there
a way to limit character input with Perl?  Also, I'm using
WRAP=VIRTUAL in my HTML code to get auto word wrapping.  Is there
a way to make it insert a newline character after a word wrap?

Your help is appreciated.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 29 Jun 1998 17:01:38 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Perl CGI Stuff
Message-Id: <SLPl1.265$44.1800163@news2.voicenet.com>

ppith@my-dejanews.com <ppith@my-dejanews.com> wrote:
>Hello.  I have looked in the FAQ and "blue camel book" for a
>solution to this problem.  I'm making a web page with a form
>where I want a text area to contain only 80 characters.  Is there
>a way to limit character input with Perl?

First read 'perldoc -f sysread'.  You can say something like:

$num = sysread(STDIN, $buf, 80);

And you will only read at most 80 bytes.  Having said that, you don't
want to do it this way (For a number of reasons). :)

Best to 'use CGI;', and use substr, or unpack to get those first 80
bytes from a variable (And just throw the rest away).

>Also, I'm using
>WRAP=VIRTUAL in my HTML code to get auto word wrapping.  Is there
>a way to make it insert a newline character after a word wrap?

Text::Wrap should do quite nicely for this.  You can see the docs for it
by typing 'perldoc Text::Wrap'.  It's part of the standard distribution.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Mon, 29 Jun 1998 17:53:14 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Perl CGI Stuff
Message-Id: <3597C67A.21E6609D@nortel.co.uk>

ppith@my-dejanews.com wrote:
> 
> ...  I'm making a web page with a form
> where I want a text area to contain only 80 characters...

This is a html problem. Please check the relevant documentation, eg
http://www.htmlcompendium.org/

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 29 Jun 1998 17:13:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl CGI Stuff
Message-Id: <6n8i0n$5bu$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    ppith@my-dejanews.com writes:
:Hello.  I have looked in the FAQ and "blue camel book" for a
:solution to this problem.  I'm making a web page with a form
:where I want a text area to contain only 80 characters.  Is there
:a way to limit character input with Perl?  Also, I'm using
:WRAP=VIRTUAL in my HTML code to get auto word wrapping.  Is there
:a way to make it insert a newline character after a word wrap?

Try WRAP=HARD.  You'll still get some screwups, but fewer.

--tom
-- 
"The reasonable man conforms himself to his environment. The
unreasonable man conforms his environment to himself. Therefore
all change depends on the unreasonable man."


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

Date: 29 Jun 1998 21:03:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl CGI Stuff
Message-Id: <6n8vf5$n9s$1@client3.news.psi.net>

ppith@my-dejanews.com (ppith@my-dejanews.com) wrote on MDCCLXIII
September MCMXCIII in <URL: news:6n8ern$d4m$1@nnrp1.dejanews.com>:
++ Hello.  I have looked in the FAQ and "blue camel book" for a
++ solution to this problem.  I'm making a web page with a form
++ where I want a text area to contain only 80 characters.  Is there
++ a way to limit character input with Perl?

Well, the answer to the latter question would be to use sysread ().
However, I don't see any connection to what you want to do and Perl.

If you want a textarea to contain 80 characters, use:
<textarea>
123456789012345678901234567890123456789012345678901234567890123456789012345678
</textarea>

(That's 78 numbers and 2 newlines)

But somehow I think this isn't what you want.

++                                            Also, I'm using
++ WRAP=VIRTUAL in my HTML code to get auto word wrapping.  Is there
++ a way to make it insert a newline character after a word wrap?

No, not in HTML. If you want newlines, then *don't* use virtual
wrapping.


Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'


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

Date: 29 Jun 1998 14:51:34 -0400
From: crusader@bilbo.ShireNet.com (Scott Cherkofsky)
Subject: PERL code in browser instead of page
Message-Id: <6n8nnm$dae@bilbo.ShireNet.com>


I've got a PERL script which is called when a user submits a login form on their Browser.  The 
Script checks the login information and tells the user they were either rejected or logged in.

This works fine in explorer and although the code works fine under Netscape 4.0, the page that comes 
back is not interpreted as a HTML document and so the HTML code is printed in the browser window:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>
<HEAD>
        <TITLE>Scenario Selection Form</TITLE>
        <LINK REL="STYLESHEET" TYPE="text/css" HREF="http://172.27.164.134/narimwww/NARIM.css">
</HEAD>
<BODY background="http://172.27.164.134/narimwww/images/bodybk2.jpg">
<FORM ACTION="" METHOD="POST" TARGET="">
<B>Success:</B> Welcome NARIM Admin.<BR> <BR>
                
<CENTER><INPUT TYPE="Button" NAME="Setup" VALUE="Setup Analysis" TABINDEX="0" 
onclick="parent.location = '/narimwww/analysis/'"></CENTER>
</FORM>
</BODY>
</HTML>

that's what is sent back.  Explorer 4.0 reads that and shows the HTML page, but Netscpae 4.0 just 
shows the text without interpretting the HTML code.

Why is this happening?

Scott

-- 
____________________________________________________________________________
  Scott   |   scottc1033 aol com  | Need Interenet access in Virginia?
Cherkofsky|crusader shirenet com  |  Try Shirenet <mailto:info@shirenet.com>
'Crusader'|HomePage:    http://www.shirenet.com/~crusader/html/Home.html


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

Date: Mon, 29 Jun 1998 15:53:46 -0400
From: "Michael D. Hofer" <featheredfrog@geocities.com>
Subject: Re: PERL code in browser instead of page
Message-Id: <3597F0C9.5ACD@geocities.com>

Scott Cherkofsky wrote:
> 
> I've got a PERL script which is called when a user submits a login form on their Browser.  The
> Script checks the login information and tells the user they were either rejected or logged in.
> 
> This works fine in explorer and although the code works fine under Netscape 4.0, the page that comes
> back is not interpreted as a HTML document and so the HTML code is printed in the browser window:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

> that's what is sent back.  Explorer 4.0 reads that and shows the HTML page, but Netscpae 4.0 just
> shows the text without interpretting the HTML code.
> 
> Why is this happening?
> 
> Scott

 ...Are you remembering to send the MIME header

Content-type: text/html
<blank line>

as the first thing emitted?

-- 
Cian ua'Lochan /mka/ Michael D. Hofer
No Unsolicited Commercial Email: $500.00/Item for proofreading!
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/


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

Date: 30 Jun 1998 16:55:30 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Perl DB question version upgrade from 5.002  to 5.004_4
Message-Id: <islnqfey71.fsf@godzilla.kiere.ericsson.se>

Marvin Malkowski Jr. writes:

> We are expericening a problem when we upgrade our server from perl
> 5.002 to version 5.004_04 when using db files. They seem to have
> switch from .db format to .dir and .pag format. 

You didn't provide anywhere near enough hints to give a good answer
(what OS are you running? how is your Perl configured? what does you
code look like?), but I'll give you a wild guess: When you compiled
the new Perl version, you didn't configure it the same way the old one 
was configured. 
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: 29 Jun 1998 10:09:17 GMT
From: PBUhauck@t-online.de (Uwe Hauck)
Subject: Perl Editor for Windows NT ?
Message-Id: <6n7p4d$ga8$1@news02.btx.dtag.de>

Hello !
Does anyone know of any Editor (best would be freeware)
for Windows NT that understands Perl Syntax ?
I want something that will highlight my Perl code according
to perl standards an best would be if it would do some sort 
of syntax check too..

Uwe

Please send mail to PBUHauck@t-online.de too as I am not in here
to often..


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

Date: Mon, 29 Jun 1998 12:03:38 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <35977fb1.4826990@nntp.ix.netcom.com>

[mailed and posted]

On 29 Jun 1998 10:09:17 GMT, PBUhauck@t-online.de (Uwe Hauck) wrote:

>Hello !
>Does anyone know of any Editor (best would be freeware)
>for Windows NT that understands Perl Syntax ?
>I want something that will highlight my Perl code according
>to perl standards an best would be if it would do some sort 
>of syntax check too..
>
>Uwe
>
>Please send mail to PBUHauck@t-online.de too as I am not in here
>to often..

My preference is GNU emacs.  emacs can be run either as a text or gui
application and syntax highlighting works only when run as a gui.

Vim, an extended version of vi, is also very good.  Syntax
highlighting is available in version 5 which is (I believe) still
considered a beta, but seems very stable.  There are two versions,
character mode and gui, and syntax highlighing is available in both,
but I find it difficult to read when highlighting in the character
mode version.

A good commercial editor with syntax highlighting is Codewright which
runs only as a gui.

Note that perl syntax is extremely complex and all of these will color
incorrectly at times.

Emacs and vim are free and are also available under other operating
systems.
--
Michael M Rubenstein


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

Date: 29 Jun 1998 07:59:45 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: PBUhauck@t-online.de (Uwe Hauck)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <pvfstlby.fsf@mailhost.panix.com>

PBUhauck@t-online.de (Uwe Hauck) writes:

> Does anyone know of any Editor (best would be freeware) for Windows
> NT that understands Perl Syntax ?

  http://www.cs.washington.edu/homes/voelker/ntemacs.html

But before you go there, you should take a moment to use DejaNews to
search for the inmnumerable times this question has been asked and
answered in this newsgroup.  You'll get plenty of information that
way.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Mon, 29 Jun 1998 13:40:30 GMT
From: vucak@teco.edu (Ivica Vucak)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <359798a4.23325120@kilbeggan.xlink.net>

On 29 Jun 1998 10:09:17 GMT, PBUhauck@t-online.de (Uwe Hauck) wrote:

>Hello !
>Does anyone know of any Editor (best would be freeware)
>for Windows NT that understands Perl Syntax ?
>I want something that will highlight my Perl code according
>to perl standards an best would be if it would do some sort 
>of syntax check too..
>

Try EditPlus:  http://soback.kornet.nm.kr/~escomp/
It's Shareware (20$).



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

Date: Mon, 29 Jun 1998 14:10:35 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <6n878r$3a3$1@nnrp1.dejanews.com>

In article <6n7p4d$ga8$1@news02.btx.dtag.de>,
  PBUhauck@t-online.de (Uwe Hauck) wrote:
>
> Hello !
> Does anyone know of any Editor (best would be freeware)
> for Windows NT that understands Perl Syntax ?
> I want something that will highlight my Perl code according
> to perl standards an best would be if it would do some sort
> of syntax check too..

Try vim (vi improved) at http://www.vim.org/

>
> Uwe
>
> Please send mail to PBUHauck@t-online.de too as I am not in here
> to often..
>

Nee! Nee!

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 29 Jun 1998 15:38:17 +0100
From: k hofer <k.hofer@nortel.com>
To: Uwe Hauck <PBUhauck@t-online.de>
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <3597A6D9.4CF00BDB@nortel.com>

Uwe Hauck wrote:
> 
> Hello !
> Does anyone know of any Editor (best would be freeware)
> for Windows NT that understands Perl Syntax ?
> I want something that will highlight my Perl code according
> to perl standards an best would be if it would do some sort
> of syntax check too..

I use Lemmy; vi for the Win95/WinNT platform.

For more see:

www.softwareonline.org


konrad


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

Date: Mon, 29 Jun 1998 12:02:37 -0500
From: "Mark Guagenti" <mgenti@evansville.net>
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <6n8hl0$els$1@supernews.com>

Uwe Hauck wrote:
Does anyone know of any Editor (best would be freeware)
>for Windows NT that understands Perl Syntax ?
>I want something that will highlight my Perl code according
>to perl standards an best would be if it would do some sort
>of syntax check too..


You might want to check out a program called Perl Builder.  I personaly have
never used it but it might helpful.  Looks interesting to me.

Mark




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

Date: Mon, 29 Jun 1998 12:58:30 -0400
From: Chris Winters <cwinters@intes.net>
To: Uwe Hauck <PBUhauck@t-online.de>
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <3597C7B6.D96EDB8B@intes.net>

Uwe Hauck wrote:
> 
> Hello !
> Does anyone know of any Editor (best would be freeware)
> for Windows NT that understands Perl Syntax ?
> I want something that will highlight my Perl code according
> to perl standards an best would be if it would do some sort
> of syntax check too..

I don't use it anymore (I kicked NT to the curb) but ED
(www.getsoft.com) is pretty nifty. The syntax highlighting is pretty
on and it's extremely flexible.
-- 
Chris Winters
Internet Developer    INTES Networking
cwinters@intes.net    http://www.intes.net/
Integrated hardware/software solutions to make the Internet work for
you.


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

Date: Mon, 29 Jun 1998 12:56:37 -0500
From: "Mark Guagenti" <mgenti@evansville.net>
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <6n8k8c$bg$1@supernews.com>

I forgot to include the link to the site that has it. It is
http://www.solutionsoft.com/perl.htm




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

Date: Mon, 29 Jun 1998 18:02:12 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <6n8kut$jm7$1@strato.ultra.net>

[ posted and mailed ]

"Mark Guagenti" <mgenti@evansville.net> wrote:
-> I forgot to include the link to the site that has it. It is
-> http://www.solutionsoft.com/perl.htm

Forgot to include the huge price tag too!

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Tue, 30 Jun 1998 10:34:16 GMT
From: Chris Wareham <chris.wareham@blackwell.co.uk>
Subject: Re: Perl Editor for Windows NT ?
Message-Id: <3598BFBC.E4D9175C@blackwell.co.uk>

Uwe Hauck wrote:
> 
> Hello !
> Does anyone know of any Editor (best would be freeware)
> for Windows NT that understands Perl Syntax ?

I use an editor called UltraEdit whenever I'm on an NT
machine. It has user configurable syntax highlighting
that's far easier to set up than Vim or Emacs. It can
also record macros, run command line apps like the Perl
interpreter and capture their output to a window, etc.

I find it a lot more convenient than Emacs (and a lot
smaller). It's shareware, and can be had from:

  http://www.idmcomp.com/

The registered version (no annoying splash screen) costs
$30.00.

Chris
-- 
chris.wareham@blackwell.co.uk
+44 (0)1865 792792 ext. 3381


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

Date: 28 Jun 1998 14:10:29 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Perl for Win-32
Message-Id: <6n64f5$eed@fohnix.metronet.com>

Fred Donovan <fdonovan@media.mit.edu> writes:
) I've installed the Oreilly UserAdmin module for
) Perl on NT ( http:\\www.vne.com\ora\useradmn). Seems to
) have installed ok, and my test program compiles, but
) when calling the function Win32::UserAdmin::UserGetAttributes
) ($server, $username, $level, \%userinfo) I get the error:

You should really include the code, not just a description
of it.

) 	The system could not find the environment option
) that was entered.

This is the ubiquitous Win32 Perl error which
Win32::GetLastError() will almost always return.  Perhaps your
call is succeeding but your code doesn't know how to check for
success and just complains even though it shouldn't.  I can't say
based on what you've posted.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 29 Jun 1998 21:51:00 GMT
From: blair@gobi.gps.caltech.edu (Blair Zajac)
Subject: Re: Perl for Win32 and background process
Message-Id: <6n9284$2ar@gap.cco.caltech.edu>

Francois Dagorn (dagorn@irisa.fr) wrote:
> Hello all,
> 
> I wonder if there is a way to spawn background process when
> using Perl for Win32 on W95. I've tried the following :
> 
>    - fork exec (fork unimplemented !)
>    - system ("mycmd &");  (& not understood)
> 
> Any help would be appreciated.
> 
> Frangois Dagorn
> Universiti de Rennes 1
> France

You need to either use the Win32::Process module from
CPAN/authors/id/GSAR/libwin32-x.x.zip or my Proc::Background module from
ftp://ftp.gps.caltech.edu/pub/blair/Perl/Proc-Background-0.02.tar.gz.

Blair Zajac

--
Dr. Blair Zajac			Division of Geological and Planetary Sciences
blair@gps.caltech.edu		California Institute of Technology
(626) 583-6729, FAX: 583-7827	252-21, Pasadena, CA 91125


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

Date: Mon, 29 Jun 1998 11:01:29 -0400
From: Scott Webster Wood <swood@TheWild.Com>
Subject: Perl Hash -> SQL revisited
Message-Id: <Pine.LNX.3.96.980629105903.2375A-100000@tre.thewild.com>

Some time ago, I asked if there were any tools or packages available for
Perl to make converting perl objects/hashes over to a matching object
database structure in SQL (specifically postgre).  Someone at that time
replied with something about a mailing list that had posting something of
this type but that the web page archive for this list did not include the
months of May yet.  I book marked it but then had a hard-drive crash and
lost the bookmark.

If anyone knows where I might be able to get something to make converting
perl objects to SQL objects, it would be appreciated...

Scott




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

Date: Mon, 29 Jun 1998 16:00:43 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: David Hamilton <ozslot@alphalink.com.au>
Subject: Re: PERL is spitting out rubbish
Message-Id: <3598007B.38088F8B@houston.Geco-Prakla.slb.com>

David Hamilton wrote:
<snip>

> 24-                  If ($semail =~ /@/) {
Note:  If (capital I, lower-case f) means nothing to perl.  Perhaps you
mean "if" (lowercase i & f)?

I think that should help tremendously.  Don't forget lines 29, 30 & 33
also.


> 25-                 srand(time ^ $$);
> 26-                 $a = int(rand(15));
> 27-                 $b = int(rand(15));
> 28-                 $c = int(rand(15));
> 29-                 If ($a==$b) {
> 30-                 If ($b==$c) {
> 31-                 $d=int(rand(12));
> 32-                 If ($d > 1) {
> 33-                 &TryAgain;
> 34-                 }
> 35-                 }
> 36-                 }
> 
> Thanks.

Cheers,
Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Tue, 30 Jun 1998 08:24:02 GMT
From: jkapllan@world.std.com (Jeffrey Kaplan)
Subject: perl newbie Q: Any ideas why this doesn't work?
Message-Id: <35a19bfb.13736624@news-f.std.com>

I'm just starting out learning perl, so if I've missed something
obvious (to you) please point me in the right direction.

I'm reading the O'Reilly book "Learning Perl (2nd Edition)," and these
are right out of the book.  This one works:

#!/usr/bin/perl5 -w
print "Hello, world!\n";

This one does not:

#!/usr/bin/perl5 -w
$pi = 3.141592654;
$result = 2 * $pi * 12.5;
print "radius 12.5 is circumference $result\n";

It gives no error messages at all.  I just get my system prompt back
with no indication that the script ran at all.  Permissions/modes for
both scripts are 700, ownership is limited to myself.  They are in
$HOME/bin, and that is my current working directory.  $HOME/bin and .
are both in my path.

Just to see what would happen, I tried this (from a thread in a humor
group, to write or print out the word "it" 100 times):

#!/usr/bin/perl5 -w
$i=0
if $i<100
	{print "it, ";
	$i++}
else print "\n";

While I probably mangled the syntax of that one, It didn't generate any
errors either.  Permissions/mode/ownership settings are identical to
the previous two scripts.

The system is an SGI Challenge XL running Irix 5.4, my shell is tcsh.

-- 
Jeffrey Kaplan           <*>    I'm set up for PGP.  Are you?
jkapllan@world.std.com   <*>   There's only one "l" in my name.
There is no need to copy to me via email a newsgroup follow-up.
   The World does not necessarily agree with my opinions.

"It's happening again.  I don't listen, I turn my back for two
minutes, and somebody else pays the price."  (Marcus Cole, B5
"Ceremonies of Light And Dark")


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

Date: Tue, 30 Jun 1998 10:31:40 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: perl newbie Q: Any ideas why this doesn't work?
Message-Id: <3598B07B.78D96A23@nortel.co.uk>

Jeffrey Kaplan wrote:

> 
> #!/usr/bin/perl5 -w
> $pi = 3.141592654;
> $result = 2 * $pi * 12.5;
> print "radius 12.5 is circumference $result\n";
> 
That script works on my machine...


> #!/usr/bin/perl5 -w
> $i=0
> if $i<100
>         {print "it, ";
>         $i++}
> else print "\n";

This script will never work like that.

print "it" x 100; would work

perl -v

This is perl, version 5.003 with EMBED
        built under hpux at Nov 21 1996 13:03:00
        + suidperl security patch

Copyright 1987-1996, Larry Wall


-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Tue, 30 Jun 1998 13:39:40 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: perl newbie Q: Any ideas why this doesn't work?
Message-Id: <1dbfjqh.qtwjs51bgrehjN@roxboro0-059.dyn.interpath.net>

Jeffrey Kaplan <jkapllan@world.std.com> wrote:

> I'm just starting out learning perl, so if I've missed something
> obvious (to you) please point me in the right direction.
> 
> I'm reading the O'Reilly book "Learning Perl (2nd Edition)," and these
> are right out of the book.  This one works:
> 
> #!/usr/bin/perl5 -w
> print "Hello, world!\n";
> 
> This one does not:
> 
> #!/usr/bin/perl5 -w
> $pi = 3.141592654;
> $result = 2 * $pi * 12.5;
> print "radius 12.5 is circumference $result\n";

This works just fine for me.

> It gives no error messages at all.  I just get my system prompt back
> with no indication that the script ran at all.  Permissions/modes for
> both scripts are 700, ownership is limited to myself.  They are in
> $HOME/bin, and that is my current working directory.  $HOME/bin and .
> are both in my path.
> 
> Just to see what would happen, I tried this (from a thread in a humor
> group, to write or print out the word "it" 100 times):
> 
> #!/usr/bin/perl5 -w
> $i=0
> if $i<100
>       {print "it, ";
>       $i++}
> else print "\n";
> 
> While I probably mangled the syntax of that one, It didn't generate any
> errors either.  Permissions/mode/ownership settings are identical to
> the previous two scripts.

I'm not sure why it didn't generate any errors (I'm not even convinced
that that is true), but this doesn't have a chance in hell of doing what
you want - no loop or anything else.  But it can be done in one line of
perl code - print "it, " x 100;  (put $\="\n"; before it if you want a
newline at the end).

-- 
John Moreno


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

Date: Mon, 29 Jun 1998 19:36:33 GMT
From: scythale@my-dejanews.com
Subject: Perl Script as a NT Service
Message-Id: <6n8qc1$r7h$1@nnrp1.dejanews.com>

Hi,

	I've worked hard on a Perl script that chech directories, as well as network
mapped.

	As a DOS shell or an explorer execution it goes well.

	As soon as I install it as a NT Service to launch it every 10 mn, I have an
erratical behaviour:

		- impossible to access mapped drives

		- impossible to send emails

	As far as I know, the service is launches as the account system, that doesn't
really exist.

this problem is URGENT, if you know about join me at
louis.devichi@fr.nestle.com

Thanks in advance (if you want the script to install a program as a service,
no problem, just ask me !)

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 30 Jun 1998 15:42:24 +0100
From: Tony Cross <bn600@city.ac.uk>
Subject: Perl script only accepts 80 characters
Message-Id: <3598F94F.30968B30@city.ac.uk>


--------------5D8194DFD668F42F6F1FC4E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I'm trying to convert a text file to HTML with a Perl Macro. However,
only the first line of the text file is being processed, with the
remainder not being transferred to the OUTFILE.

Can someone tell me how to stop this happening?

Thanks

--
Tony Cross
Masters in Electronic Publishing Student
City University, London, England
Tel. +44 (0) 973 284 749



--------------5D8194DFD668F42F6F1FC4E0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I'm trying to convert a text file to HTML&nbsp;with a Perl Macro. However,
only the first line of the text file is being processed, with the remainder
not being transferred to the OUTFILE.

<P>Can someone tell me how to stop this happening?

<P>Thanks
<PRE>--&nbsp;
Tony Cross
Masters in Electronic Publishing Student
City University, London, England
Tel. +44 (0) 973 284 749</PRE>
&nbsp;</HTML>

--------------5D8194DFD668F42F6F1FC4E0--



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

Date: Tue, 30 Jun 1998 15:51:45 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Perl script only accepts 80 characters
Message-Id: <3598FB81.A95135D4@nortel.co.uk>

Tony Cross wrote:
> 
> I'm trying to convert a text file to HTML with a Perl Macro. However, only the
> first line of the text file is being processed, with the remainder not being
> transferred to the OUTFILE.

Well, without ANY code it is difficult to say what is going on, my only guess
could be that you somehow assign the infile Handle to a scalar variable instead
of an array. But this is just a wild guess, and as they happen to be defined as
such, it can be wrong.

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

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

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