[7484] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1110 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 1 14:17:13 1997

Date: Wed, 1 Oct 97 11:00:39 -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, 1 Oct 1997     Volume: 8 Number: 1110

Today's topics:
     a2p and redirection <franzen@pmel.noaa.gov>
     Re: accessing permissions (rwx) (Mick Farmer)
     Re: Can't debug a perl script. <selden@NOSPAM.instinet.com>
     Control headers for NNTP (Donovan Janus)
     Re: Control headers for NNTP (Jeremy D. Zawodny)
     Re: Dial-Up Networking with Perl ? <moore@pmpro.com>
     Re: Generating bit patterns "00000000" .. "11111111" <Jan.Krynicky@st.mff.cuni.cz>
     Re: help! <selden@NOSPAM.instinet.com>
     Help: reformat variable (Peter Losin)
     Re: Help: reformat variable <eike.grote@theo.phy.uni-bayreuth.de>
     Re: How do I build a fast updating frame? <selden@NOSPAM.instinet.com>
     Re: Newbie ques: How to concatenate two strings? <gabor@vinyl.quickweb.com>
     Re: Newbie ques: How to concatenate two strings? (Abigail)
     operator expected. <Benarson.Behajaina@swh.sk>
     Re: operator expected. (Matthew Cravit)
     Re: operator expected. (brian d foy)
     Re: Perl Questions (brian d foy)
     Re: Pine --> Eudora Converter (Ken Williams)
     Re: Pine --> Eudora Converter (Jeremy D. Zawodny)
     Re: Please help me with this?! (Jeremy D. Zawodny)
     Re: Please help me with this?! <rootbeer@teleport.com>
     Problems with installing backend compiler <joku@uni-bayreuth.de>
     Reading Excel dsstevens@ingrDOT.com
     Re: Script can't find module! (Rand Simberg)
     Re: Week of the Year [Was: Re: Calculating the week num (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
     Win32ODBC-perl INSERT statement <kerry@lumber.com>
     Re: Win32ODBC-perl INSERT statement (Jeremy D. Zawodny)
     Re: Win32ODBC-perl INSERT statement (Jared Evans)
     Re: XS: sv_2mortal (when is it necessary?) <sriram@weblogic.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 01 Oct 1997 08:59:39 -0700
From: Nathan Franzen <franzen@pmel.noaa.gov>
Subject: a2p and redirection
Message-Id: <3432736B.2F57B786@pmel.noaa.gov>

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

I'm hoping that there's maybe a more final word than that
of the awk FAQ and so I am posting this message.

I've been gearing up to learn Perl by running some of my awk scripts
through a2p, and it's been at first very helpful.  However, I have
one script that reads in a big data file and extracts the pieces that
belong in separate places and puts them into separate files.  I tried
a2p on this and ... well ... no go.

After some experimentation I tried a2p on a very simple line,
specifically:

{print $0 > newfile}

and this did not work.  Sure enough, when I tracked down the FAQ,
it says:

" 6.8 a2p
    translator to Perl
    comes with Perl
    doesn't handle multiple concatenations:  e.g., var="x" "y" "z"
      -> must be in pairs:  e.g.,  var=( "x" "y" ) "z"
    doesn't handle redirection:  e.g., { print("foo") > "bar" }
      -> no known workaround"

Now, perl is perfectly capable of opening and closing files
and doing all sorts of good stuff.  More capable than awk,
even, I believe.   I'd really like to get a head start on
converting my awk script into perl by using a2p - and
not have to do the whole thing by hand.

My awk script only writes to three files.  I've been
very impressed with a2p, but am surprised that it can't handle
this.  Any comments or suggestions?

Thanks,

Nathan Franzen

--------------56726F5660E6747763FBAAE1
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Return-path: <>
Received: from DIRECTORY-DAEMON by ZETA.PMEL.NOAA.GOV (PMDF V5.1-8 #19145)
 id <01IO9FKEQCHC99LHMB@ZETA.PMEL.NOAA.GOV> for franzen@ZETA.PMEL.NOAA.GOV;
 Tue, 30 Sep 1997 17:25:47 PDT
Received: from DIRECTORY-DAEMON by ZETA.PMEL.NOAA.GOV (PMDF V5.1-8 #19145)
 id <01IO9FKD06TS99MBN5@ZETA.PMEL.NOAA.GOV> for franzen@pmel.noaa.gov; Tue,
 30 Sep 1997 17:25:45 -0700 (PDT)
Received: from ZETA.PMEL.NOAA.GOV (PMDF V5.1-8 #19145)
 id <01IO9FKBIC5W99MAGG@ZETA.PMEL.NOAA.GOV>; Tue,
 30 Sep 1997 17:25:43 -0700 (PDT)
Date: Tue, 30 Sep 1997 17:25:43 -0700 (PDT)
From: PMDF e-Mail Interconnect <postmaster@pmel.noaa.gov>
Subject: Delivery Notification: Delivery has failed
To: franzen@pmel.noaa.gov
Message-id: <01IO9FKBKHBU99MAGG@ZETA.PMEL.NOAA.GOV>
MIME-version: 1.0
Content-type: MULTIPART/REPORT; BOUNDARY="Boundary_(ID_qglWxiwQMJvEti8mBhmP7Q)"


--Boundary_(ID_qglWxiwQMJvEti8mBhmP7Q)
Content-type: text/plain

This report relates to a message you sent with the following header fields:

  Message-id: <34319883.31769009@pmel.noaa.gov>
  Date: Tue, 30 Sep 1997 17:25:39 -0700
  From: Nathan Franzen <franzen@pmel.noaa.gov>
  To: comp.lang.awk@pmel.noaa.gov, comp.lang.perl.misc@pmel.noaa.gov
  Subject: a2p and redirection

Your message cannot be delivered to the following recipients:

  Recipient address: comp.lang.awk@pmel.noaa.gov
  Reason: translated to illegal address:   comp.lang.awk@ZETA.PMEL.NOAA.GOV
  Reason translated address failed: unknown or illegal user
  Recipient address: comp.lang.perl.misc@pmel.noaa.gov
  Reason: translated to illegal address:   comp.lang.perl.misc@ZETA.PMEL.NOAA.GOV
  Reason translated address failed: unknown or illegal user


--Boundary_(ID_qglWxiwQMJvEti8mBhmP7Q)
Content-type: message/DELIVERY-STATUS

Original-envelope-id: 01IO9FKA6BDE95PKVW@ZETA.PMEL.NOAA.GOV
Reporting-MTA: dns; ZETA.PMEL.NOAA.GOV

Action: failed
Status: 5.1.1
 (translated to illegal address:   comp.lang.awk@ZETA.PMEL.NOAA.GOV   Reason
 translated address failed: unknown or illegal user)
Original-recipient: rfc822;comp.lang.awk@pmel.noaa.gov
Final-recipient: rfc822;comp.lang.awk@pmel.noaa.gov

Action: failed
Status: 5.1.1
 (translated to illegal address:   comp.lang.perl.misc@ZETA.PMEL.NOAA.GOV
 Reason translated address failed: unknown or illegal user)
Original-recipient: rfc822;comp.lang.perl.misc@pmel.noaa.gov
Final-recipient: rfc822;comp.lang.perl.misc@pmel.noaa.gov

--Boundary_(ID_qglWxiwQMJvEti8mBhmP7Q)
Content-type: MESSAGE/RFC822

Return-path: franzen@pmel.noaa.gov
Received: from DIRECTORY-DAEMON by ZETA.PMEL.NOAA.GOV (PMDF V5.1-8 #19145)
 id <01IO9FKBIC5W99MAGG@ZETA.PMEL.NOAA.GOV>
 (original mail from franzen@pmel.noaa.gov); Tue, 30 Sep 1997 17:25:42 PDT
Received: from pmel.noaa.gov (corona.pmel.noaa.gov)
 by ZETA.PMEL.NOAA.GOV (PMDF V5.1-8 #19145)
 with ESMTP id <01IO9FKA58R495PKVW@ZETA.PMEL.NOAA.GOV>; Tue,
 30 Sep 1997 17:25:41 PDT
Date: Tue, 30 Sep 1997 17:25:39 -0700
From: Nathan Franzen <franzen@pmel.noaa.gov>
Subject: a2p and redirection
Sender: franzen@PMEL.NOAA.GOV
To: comp.lang.awk@pmel.noaa.gov, comp.lang.perl.misc@pmel.noaa.gov
Message-id: <34319883.31769009@pmel.noaa.gov>
Organization: PMEL
MIME-version: 1.0
X-Mailer: Mozilla 4.03 [en] (X11; I; SunOS 5.5 sun4d)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit

I'm hoping that there's maybe a more final word than that of the awk FAQ

and so I am posting this message

I've been gearing up to learn Perl by running some of my awk scripts
through a2p, and it's been at first very helpful.  However, I have
one script that reads in a big data file and extracts the pieces that
belong in separate places and puts them into separate files.  I tried
a2p on this and ... well ... no go.

After some experimentation I tried a2p on a very simple line,
specifically:

{print $0 > newfile}

and this did not work.  Sure enough, when I tracked down the FAQ,
it says:

" 6.8 a2p
    translator to Perl
    comes with Perl
    doesn't handle multiple concatenations:  e.g., var="x" "y" "z"
      -> must be in pairs:  e.g.,  var=( "x" "y" ) "z"
    doesn't handle redirection:  e.g., { print("foo") > "bar" }
      -> no known workaround"

Now, perl is perfectly capable of opening and closing files and doing
all sorts
of good stuff.  More capable than awk, even, I believe.   I'd really
like to get
a head start on converting my awk script into perl by using a2p - and
not
have to do the whole thing by hand.

My awk script only writes to three files.  I've been very impressed with
a2p, but
am surprised that it can't handle this.  Any comments or suggestions?

Thanks,

Nathan Franzen



--Boundary_(ID_qglWxiwQMJvEti8mBhmP7Q)--

--------------56726F5660E6747763FBAAE1--



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

Date: Wed, 1 Oct 1997 15:15:37 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: accessing permissions (rwx)
Message-Id: <EHDp21.8CK@mail2.ccs.bbk.ac.uk>

Dear Dhiraj,

Use the file test operators, e.g.

	-r $file	readable
	-w $file	writable
	-x $file	executable

They can be applied to either file names or filehandles.

Regards,

Mick


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

Date: Wed, 01 Oct 1997 13:14:27 -0400
From: Michael Shael O'Neill Selden <selden@NOSPAM.instinet.com>
Subject: Re: Can't debug a perl script.
Message-Id: <343284F3.4312@NOSPAM.instinet.com>

Pierre BERGDOLT wrote:
> 
> But if I run:
> 
> "perl -d cc_upvw"
> 
> I get the following message:
> 
>         Got SEGV!
>         Signal SEGV: No such file or directory
>         Resources lost
> 

Pierre,
	Did you specifically compile Perl with Debug support enabled?  
If not, do so and your problem will go away.  If you are not in a 
position to recompile Perl, or you did not compile it yourself in the 
first place, you can check to see whether or not Debug support is
available by executing `perl -v` and looking at the output.
	BTW, in the future it might be helpful to post information
regarding your platform, Perl version, compilation options, etc. so
as to assist newsgroup readers in assisting you.


Michael.
-- 
Michael Shael O'Neill Selden, DBA, JAPH, DADDY
Remove "NOSPAM." From Address To Return Mail
Computing <-> Sculpting | Two Lobes, One Mind


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

Date: Wed, 01 Oct 1997 16:42:49 GMT
From: donovan@zaak.nl (Donovan Janus)
Subject: Control headers for NNTP
Message-Id: <34327d4d.71164609@news.xs4all.nl>

Does anyone has a list of control headers for in NNTP?

I only have cancel but I would like to know the others.

Thanks in advance,

Donovan Janus		


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

Date: Wed, 01 Oct 1997 16:26:05 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Control headers for NNTP
Message-Id: <3433797a.2738147@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 01 Oct 1997 16:42:49 GMT, donovan@zaak.nl (Donovan Janus)
wrote:

>Does anyone has a list of control headers for in NNTP?
>
>I only have cancel but I would like to know the others.

The NNTP RFC is the authoritative source for that info. Anyone who may
answer this is likely to have found the info in the RFC.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Wed, 1 Oct 1997 19:13:47 GMT
From: Jim Moore <moore@pmpro.com>
Subject: Re: Dial-Up Networking with Perl ?
Message-Id: <3432A0EB.1515@pmpro.com>

batman wrote:
> 
> I would like to use Win95's Dial-Up Networking (DUN) to make a connection
> to my ISP.  Or if the connection is already up, then tell Perl to use
> that connection.
> 
> Does anyone have an idea on how to start doing this with Perl for Windows
> 95/NT and PerlWin32 ?  Any suggestions or info are appreciated.  Thanks!

I'm using DUN in an application now (Tk though, cause I can't
get Perl to exit gracefully under win95 reboot).

DUN has an autodial feature at the network level.  Therefore,
if you access the net, it will autodial for you if required.

I'm also using a little program called Dunce to make running
the Win95 box headless possible.  DUN pops up some dialog 
boxes on line busy or a dropped connection.  Dunce presses the ok
buttons in these dialog so DUN can continue to reconnect, etc.
You can find Dunce at www.windows95.com.

There is also a command line DUN tool at www.windows95.com, but
I've not used it.

Good luck.

Jim


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

Date: Wed, 01 Oct 1997 19:22:39 -0700
From: Jan Krynicky <Jan.Krynicky@st.mff.cuni.cz>
To: Ricky Roque <ricky.roque@bigfoot.com>
Subject: Re: Generating bit patterns "00000000" .. "11111111"
Message-Id: <3433056F.3521@st.mff.cuni.cz>

Ricky Roque wrote:
> 
> I'm trying to generate pattern like the following
>   "00000000"
>   "00000001"
>   "00000010"
>         :
>         :
>  "11111110"
>  "11111111"
> 
> Any other method of doing the task?
> Thanks.

What about:


for($i=0;$i<=255;$i++){
 print unpack('B8',pack('C1',$i)),"\n";
}


If you want fewer places you have to strip the first (n-1) characters
not changing 'B8' to 'Bn' !


If you want more use :

for($i=0;$i<=10;$i++){
 print unpack('B32',pack('N',$i)),"\n";
}

for up to 16 places

or  ...pack('N',...
up to 32 places.

HTH, Jenda


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

Date: Wed, 01 Oct 1997 12:52:23 -0400
From: Michael Shael O'Neill Selden <selden@NOSPAM.instinet.com>
Subject: Re: help!
Message-Id: <34327FC7.3D9F@NOSPAM.instinet.com>

Anooshiravan Merat wrote:
> 
> Salaam,
> someone please tell me where can i find a guide about perl on the net. i
> know some C and some BASIC programming and i want to start on perl. (no
> books please, tell me about guides that are available on the net)
> 
> regards,
> Anooshiravan Merat,
> http://www.sums.ac.ir/~merata

Anooshiravan,
	Try these...

The Perl Language Home Page (FAQ and Manual available here)
  - http://www.perl.com/
The Perl Institute
  - http://www.perl.org/
The Perl Journal
  - http://orwant.www.media.mit.edu/the_perl_journal/
The FMTEYEWTK (Far More Than Everything You've Ever Wanted to Know) Page
  - ftp://ftp.funet.fi/pub/languages/perl/CPAN/doc/FMTEYEWTK/index.html
The Perl5 Module LIst
  - ftp://ftp.rge.com/pub/languages/perl/modules/00modlist.long.html


Michael.
-- 
Michael Shael O'Neill Selden, DBA, JAPH, DADDY
Remove "NOSPAM." From Address To Return Mail
Computing <-> Sculpting | Two Lobes, One Mind


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

Date: 1 Oct 1997 15:25:20 GMT
From: losinp@wam.umd.edu (Peter Losin)
Subject: Help: reformat variable
Message-Id: <60tq10$aij@dailyplanet.wam.umd.edu>

There must be an easy way to do this, but I haven't been able to get it to
work.  I need to take the input from an HTML <TEXTAREA>, which may be
hundreds of characters including \n, etc., and pass it through some
routine that will format it so it's no more than (say) 50 characters wide.
(I'm brand new to NT; what I need is something that works like fmt in
Unix.)

So I might begin like this:

$in = $form{textarea};
$out = Format($in);

My question: what does "Format" need to do?

Thanks in advance,

--
Peter Losin   losinp@wam.umd.edu   http://www.wam.umd.edu/~losinp/


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

Date: Wed, 01 Oct 1997 17:53:06 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Help: reformat variable
Message-Id: <343271E2.794B@theo.phy.uni-bayreuth.de>

Hi,

Peter Losin wrote:
> 
> There must be an easy way to do this, but I haven't been able to get it to
> work.  I need to take the input from an HTML <TEXTAREA>, which may be
> hundreds of characters including \n, etc., and pass it through some
> routine that will format it so it's no more than (say) 50 characters wide.
> (I'm brand new to NT; what I need is something that works like fmt in
> Unix.)
> 
> So I might begin like this:

No ... you might begin like this:    ;-)

1) 'man perlfaq'
2) 'man perlfaq4'
3) search for "How do I reformat a paragraph?"
4) try it out
5) ask again if it doesn't work

> $in = $form{textarea};
> $out = Format($in);


Bye, Eike
-- 
======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: Wed, 01 Oct 1997 13:24:58 -0400
From: Michael Shael O'Neill Selden <selden@NOSPAM.instinet.com>
Subject: Re: How do I build a fast updating frame?
Message-Id: <3432876A.6454@NOSPAM.instinet.com>

Matthias Hellmund wrote:
> 
> I am trying to program a small chat system. Now I need a fast way to update
> the message-window. There should be a separate message-window for every
> chat-participant to allow private messages.
> I've thought about a message-file that contains all messages, and every
> reader-script checks the file if it has been modified (open, read first
> message, check if it's a new one, then update frame), but this would cause
> a very intensive file-access and probably conflicts when a script writes
> and another reads the same time.
> Isn't there another way to solve my problem?
> Example-script-codes and e-mail-replies appreciated
> 
> CU
>   Matthias

Matthias,
	I suggest that you post this to the
comp.infosystems.www.authoring.* newsgroup
hierarchy.  That is where you will find netizens
willing to engage in what will essentially be
a dialogue regarding WWW application design.
The comp.lang.perl.* hierarchy is devoted to 
(wacky, I know) the Perl language.  Also, I
suspect that you will receive more help from
experienced readers in the _appropriate_ newsgroup
if you attempt to solve the problem yourself
first instead of engaging in the on-line equivalent
of panhandling.


Michael.
-- 
Michael Shael O'Neill Selden, DBA, JAPH, DADDY
Remove "NOSPAM." From Address To Return Mail
Computing <-> Sculpting | Two Lobes, One Mind


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

Date: 1 Oct 1997 15:55:22 GMT
From: Gabor Egressy <gabor@vinyl.quickweb.com>
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <60trpa$j9j$1@flint.sentex.net>

Joseph <jglosz@san.rr.com> wrote:
: Gee, Abigail, thanks a lot.

: On 29 Sep 1997 01:34:15 GMT, abigail@fnx.com (Abigail) wrote:

: >Perhaps you shouldn't modify a program in any language if you
: >don't know the language. 

: That wasn't the advice I asked, Abigail, but thanks anyway.

: >"Hey Doc, this has GOT to be the ultimate newbie question, but I don't
: > know medication, and I need to fix the lung I'm dealing with while
: > operating on my kid."

: I'm sorry, Abs, I didn't know you owned this newsgroup.

She was trying to be humorous for God's sake.  And I believe her name
is Abigail and not Abs.  You can't even get that right!

: >Yeah, something simple as that. And you find the answer by doing something
: >simple as:
: >
: >$ man perlop | grep concatenate
: >

: You bring narrow minded twitness to a new high. What makes you think
: I'm on a unix machine? I left the command line world behind a long
: time ago.

Yup, and you left your brain behind with it as well.

: In the future, please keep your thoughts to yourself. Thanks.



gabor.
--
    Chip Salzenberg sent me a complete patch to add System V IPC (msg, sem and
    shm calls), so I added them.  If that bothers you, you can always undefine
    them in config.sh.  :-)
        -- Larry Wall in <9384@jpl-devvax.JPL.NASA.GOV>












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

Date: 1 Oct 1997 16:14:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <slrn634tqk.565.abigail@betelgeuse.rel.fnx.com>

Tom Phoenix (rootbeer@teleport.com) wrote on 1492 September 1993 in
<URL: news:Pine.GSO.3.96.971001065602.20846G-100000@usertest.teleport.com>:
++ On Tue, 30 Sep 1997, Faust Gertz wrote:
++ 
++ > Just for my own information, why is 
++ > "$x = $y . $z;" a _better_ choice than
++ > "$x = join ('', $y, $z);"?  
++ 
++ Less typing. :-)  
++ 
++ Okay, that's not the _only_ critereon to use. But it's harder to make a
++ mistake with this shorter code, so it's easier to write and maintain. And
++ it's easy to read, too, IMHO.

You bring up an interesting point. I find that when you are concatenating
long expressions, the tiny dot often gets lost. I sometimes prefer

    join '', $obj1 -> method1 (name1 => parameter1,
                               name2 => parameter2,
                               name3 => parameter3),
             $obj2 -> method2 (name4 => {name5  =>  parameter5,
                                         name6  =>  parameter6},
                               name7 => parameter7);

over using dots.


++ 
++ All that said, I'd probably prefer this in almost every case.
++ 
++     $x = "$y$z";
++ 
++ It's even less typing, less to go wrong, even _easier_ to maintain (adding
++ a space between the items, for example, or putting on a trailing newline),
++ easier (IMHO) to read and understand. But, of course, TMTOWTDI.


That's indeed nice for concatenating simple scalars. But if things
are getting complex, you need to do

      $x = "${\expression1}${\expression2}";

More typing, and less readable.



Abigail


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

Date: Wed, 01 Oct 1997 17:10:07 +0200
From: Benarson Behajaina <Benarson.Behajaina@swh.sk>
Subject: operator expected.
Message-Id: <343267CF.CC98032B@swh.sk>

When running a perl script (cache-compare.pl) I've got the following
error message:
===============================================
Number found where operator expected at (eval 175) line 1, near ") 0"
       (Missing operator before 0?)
===============================================
My perl scripts cache-compare.pl is:

#!/usr/bin/perl

@getfrom = ('SOURCE', 'localhost:3128', 'bo:3128');

[...]

Is there someone who knows what does the message mean ?

Thanks,
Benarson.



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

Date: 1 Oct 1997 10:48:26 -0700
From: mcravit@best.com (Matthew Cravit)
Subject: Re: operator expected.
Message-Id: <60u2da$srl$1@shell3.ba.best.com>

[Courtesy Cc to cited poster via email]

In article <343267CF.CC98032B@swh.sk>,
Benarson Behajaina  <Benarson.Behajaina@swh.sk> wrote:

>Number found where operator expected at (eval 175) line 1, near ") 0"
>       (Missing operator before 0?)

Did you look at the perldiag man page? It has quite helpful descriptions of
just about every error message perl generates. It has this to say about
your error:

     %s found where operator expected
         (S) The Perl lexer knows whether to expect a term or an
         operator.  If it sees what it knows to be a term when it
         was expecting to see an operator, it gives you this
         warning.  Usually it indicates that an operator or
         delimiter was omitted, such as a semicolon.

Judging from your error message above, you probably have something like 

    DoWhatever() 0

in your script. I'd look carefully through your script and find the error
and then try again.

>@getfrom = ('SOURCE', 'localhost:3128', 'bo:3128');

I'd be willing to bet that this is not the line in your code that's
generating the error. Since it says "at (eval 175)" in the error message
you included, I'd look for anything in your script which is using an eval,
or modules you're including. I suspect you'll find the problem there.

>Is there someone who knows what does the message mean ?

Of course there is. And the people who do know went to a great deal of
trouble to write nice man pages for you. You'd probably have better luck
(and annoy fewer people) if you took advantage of those resources.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Wed, 01 Oct 1997 13:59:00 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: operator expected.
Message-Id: <comdog-ya02408000R0110971359000001@news.panix.com>

In article <343267CF.CC98032B@swh.sk>, Benarson Behajaina <Benarson.Behajaina@swh.sk> wrote:


>Number found where operator expected at (eval 175) line 1, near ") 0"
>       (Missing operator before 0?)


you can find a more detailed description of error messages in the 
perldiag manual page which is included with the perl distribution.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 01 Oct 1997 13:54:06 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Questions
Message-Id: <comdog-ya02408000R0110971354060001@news.panix.com>

In article <342C998B.670712F3@unsu.com>, Arthur Merar <amerar@unsu.com> wrote:

>1) Is there a way for me to execute a perl/CGI script from an HTML
>document without the user taking any action?  Say for example I wanted
>to have a counter on how many times a certain page was hit or something
>like that.  How would I execute the perl/CGI script?  Can I just call
>it?

see the various CGI FAQs in the resource listed at the bottom of this 
message.  further CGI questions should go to an appropriate
newsgroup, like comp.infosystems.www.authoring.cgi

>2)  Does Perl support 2-dimentional arrays?  If so, how do you declare
>them?

yes, but you don't "declare" them.  you just use them and perl does
the rest.  you can find out about such things from the Perl
documentation (for instance, the man pages) or a programming book
in Perl [1].

>3)  Has anyone heard of this new SQL databases on servers called msql,
>or
>mini SQL?  Well, I am trying to find out if it compatible with Perl?
>And if so, how do you issue the SQL commands????

those aren't new, but you can get interfaces for them from CPAN [1]


[1] 
Comprehensive Perl Archive Network
find one near you at <URL:http://www.perl.com>

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 01 Oct 1997 10:50:50 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Pine --> Eudora Converter
Message-Id: <ken-0110971050500001@news.swarthmore.edu>

Hi-

What's the difference?  I thought Eudora could read regular Unix
mailboxes, which is what Pine uses.  Maybe there are specifics I don't
know about.  Oh, are you talking about creating the resource fork (in mac
Eudora) for the table of contents?  If so, I don't think I know how to do
that.

If you want routines that can read Unix mailbox files (and presumably spit
the data out however you want it) check out the Mail::* packages available
from CPAN.  I've had pretty good luck with them.

In article <34326284.38A0AB3C@harvard.edu>, chris_braiotta@harvard.edu wrote:

>Does anyone know of a script that can convert a PINE folder into a
>Eudora mailbox?
>
>Thanks
>
>Chris Braiotta
>chris_braiotta@harvard.edu

-Ken Williams
 The Math Forum
 ken@forum.swarthmore.edu


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

Date: Wed, 01 Oct 1997 15:10:26 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Pine --> Eudora Converter
Message-Id: <343367c3.167323338@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 01 Oct 1997 09:47:35 -0500, Chris Braiotta
<chris_braiotta@harvard.edu> wrote:

>Does anyone know of a script that can convert a PINE folder into a
>Eudora mailbox?

No conversion should be necessary.

Eudora has a *documented* ability to read standard mailbox files.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Wed, 01 Oct 1997 15:09:09 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Please help me with this?!
Message-Id: <3432674e.167206850@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 1 Oct 1997 14:52:29 +0100, avert@dial.pipex.com (Andrew
Collington) wrote:

Please don't post to comp.lang.perl. It's a dead group.

>I have just bought the book "Using Perl 5 for Web Programming" and I'm 
>having a little trouble with some of the code, although I have copied it 
>straight out of the book.
>
>The bits of code I'm having porblems with go along the lines of:
>
>$words=[td]s/[^\w-' ]//g;
>if (!($dirs[$list]=[td]/temp/)) { do something... }
>
>Now, I understand what these do, but what is the [td] bit meant to do?  I 
>have tried running the code but it just gives me errors (it doesn't if I 
>remove the [td] though!)

Replace [td] with the "~" character. Apparently the publisher didn't
care if the code worked or not.

*sigh*

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Wed, 1 Oct 1997 08:13:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Andrew Collington <avert@dial.pipex.com>
Subject: Re: Please help me with this?!
Message-Id: <Pine.GSO.3.96.971001080224.20846L-100000@usertest.teleport.com>

On Wed, 1 Oct 1997, Andrew Collington wrote:

> Newsgroups: comp.lang.perl, comp.lang.perl.misc

If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.

> I have just bought the book "Using Perl 5 for Web Programming" and I'm 
> having a little trouble with some of the code, although I have copied it 
> straight out of the book.
> 
> The bits of code I'm having porblems with go along the lines of:
> 
> $words=[td]s/[^\w-' ]//g;
> if (!($dirs[$list]=[td]/temp/)) { do something... }
> 
> Now, I understand what these do, but what is the [td] bit meant to do? 

It's meant to be a tilde:

    $words =~ s/[^\w-' ]//g;
    if (!($dirs[$list] =~ /temp/)) { do something... }

Not every publisher knows how to make computer books. [col][hyph][rtpar]

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



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

Date: Wed, 01 Oct 1997 17:41:42 +3500
From: Joerg Kuemmerlen <joku@uni-bayreuth.de>
Subject: Problems with installing backend compiler
Message-Id: <343736A6.2781@uni-bayreuth.de>

I guess this question has been here a number of times ...

Perl version 5.003 is installed here on our machines for quite
a while and I never observed any problems with it (/usr/sbin/perl5).
We also have the older version 4 named /usr/sbin/perl.

Today I was trying to install Malcolm Beattie's Perl compiler.
I was following the instructions and the configuring
of the Makefile appears to be okay. When I finally type 'make'
the following happens :

 ...
cp something /somewhere
 ...

 /usr/sbin/perl5 -I/usr/local/lib/perl5/IP22-irix/5.003
-I/usr/local/lib/perl5 /usr/local/lib/perl5/ExtUtils/xsubpp  -typemap
/usr/local/lib/perl5/ExtUtils/typemap -typemap typemap B.xs >B.tc && mv
B.tc B.c
        cc -c  -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000
-I/usr/local/include -DLANGUAGE_C -O     -DVERSION=\"a2\" 
-DXS_VERSION=\"a2\"  -I/usr/local/lib/perl5/IP22-irix/5.003/CORE  B.c
cfe: Error: /usr/local/lib/perl5/IP22-irix/5.003/CORE/perl.h, line 1367:
Syntax Error
 extern   sigjmp_buf    top_env ;
 --------------------   ^
cfe: Error: /usr/local/lib/perl5/IP22-irix/5.003/CORE/perl.h, line 1367:
Empty declaration specifiers (3.5)
 extern   sigjmp_buf    top_env ;
 --------------------   ^
*** Error code 1 (bu21)


it appears that something is going wrong with perl.h ...
but I can not see what :-((  - i was just wondering if I am using
the wrong perl.h - or what else.

Any hints will be very much appreciated.

J.




-- 
*************************************************************************
*   Joerg Kuemmerlen                                 	|		*
*   Bayerisches Geo-Institut			 	| It's a	*
*   Universitaet Bayreuth			 	| fulltime	*
*   D-95440 Bayreuth				 	| job for 	*
*   Germany	    				 	| anyone 	*
*						 	| to stay	*
*   Tel.:  ++49-921-55 37 19			 	| alive.	*
*   Fax :  ++49-921-55 37 69			 	|		*
*   email: joku@uni-bayreuth.de	         		| J. Cocker	*	
*   WWW: http://torech-ungol.bgi.uni-bayreuth.de/~joku	|		*
*************************************************************************


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

Date: Wed, 01 Oct 1997 10:29:29 -0500
From: dsstevens@ingrDOT.com
Subject: Reading Excel
Message-Id: <34326C59.19CF@ingrDOT.com>

I am looking for the code to open existing MS Excel files and read the
specific cells. I realize that there is an example to create an Excel
file in the examples dir. But have not been able to find the specific
syntax for opening an existing file.

If you could e-mail me an example I would appreciate it.
This is what I have so far.

use OLE;
$application = CreateObject OLE 'Excel.Application' || die $!;
$application->{'Visible'} = 1;
$workbook = $application->Workbooks->Open("C:/temp/ws.xls");
$worksheet = $workbook->Worksheets(1);
print $worksheet->Range("D2")->{'Value'}

#... etc.

Thanks.

Scott 
e-mail: dssteven AT ingr DOT com
(replace AT for @ and DOT for .)


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

Date: Wed, 01 Oct 1997 16:05:03 GMT
From: simberg@interglobal.org (Rand Simberg)
Subject: Re: Script can't find module!
Message-Id: <34427457.165826611@nntp.ix.netcom.com>

On 1 Oct 1997 06:58:22 GMT, in a place far, far away,
mgjv@mali.comdyn.com.au (Martien Verbruggen) made the phosphor on my
monitor glow in such a way as to indicate that:

>try:
>
>use lib '/usr/contrib/lib/perl5/i386-bsdos';

That didn't work either.  I finally figured out what the problem
was--someone had deleted a link between the default paths in @INC and
the actual server directory structure.  I got a sysadmin to replace
it, and all is well.

************************************************************************
simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1391 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ to email me.  
Here's my email address for autospammers: postmaster@fbi.gov


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

Date: Wed, 01 Oct 1997 17:33:32 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: Week of the Year [Was: Re: Calculating the week number]
Message-Id: <lassehp-0110971733320001@ra.imv.aau.dk>

In article <3424A1AF.575F3D4E@dan.co.jp>, Dan Kogai <dankogai@dan.co.jp> wrote:

>Dan Kogai wrote:
>>   Ah!  I was mistaken.  Still a trivial prob to me....

Sorry for dropping in late in a thread, and perhaps with useless information.

But for ISO 8601:1988 week numbers, how about

perl -we 'use POSIX qw(strftime); $weekn = strftime("%V",localtime); print
$weekn;'

If your strftime has the %V option? (And there are other options if you
don't want  ISO 8601:1988 week numbers.)

Sorry if this has already been mentioned, but this was something that I
had problems with recently, until I came on the idea of using POSIX.

-Lasse


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

Date: Wed, 01 Oct 1997 09:01:29 -0700
From: Kerry Cakebread <kerry@lumber.com>
Subject: Win32ODBC-perl INSERT statement
Message-Id: <343273D9.4B4@lumber.com>

Hello,
	I'm using Roth Consulting's ODBC Win32ODBC module, and am having
difficulty with SQL INSERT statements to an Access97 datasource (Win
NT4.0).  I'm getting a syntax error from the ODBC driver that my INSERT
is wrong...

can someone help?

Thanks,

Kerry Cakebread
kerry@lumber.com
##################################################
When I do this:

(after successfully binding $db to the DSN, etc.)

$query = "INSERT INTO [Table2] (number, desc) VALUES( 15, 'test')";
print DEBUGFILE "submitting: $query\n\n";

$db->Sql( $query );
print DEBUGFILE "ODBC Query response:" . $db->Error() . "\n\n";


$query = "SELECT * FROM [Table2]";

print DEBUGFILE "submitting: $query\n";

$db->Sql( $query );
print DEBUGFILE "ODBC Query response:" . $db->Error() . "\n";

@FieldNames = $db->FieldNames();
print DEBUGFILE "$FieldNames[0]\t";
print DEBUGFILE "$FieldNames[1]\n";

while ($db->FetchRow()) {
    undef %Data;
    %Data = $db->DataHash();
    print DEBUGFILE "$Data{$FieldNames[0]}\t" .
"$Data{$FieldNames[1]}\n";
}

#########################################

I get this in my DEBUGFILE:

submitting: INSERT INTO [Table2] (number, desc) VALUES( 15, 'test')

ODBC Query response:[-3502] [1] [0] "[Microsoft][ODBC Microsoft Access
97 Driver] Syntax error in INSERT INTO statement."

submitting: SELECT * FROM [Table2]
ODBC Query response:
number	desc
1	Test1
2	Test2
0	Test0
3	Test3


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

Date: Wed, 01 Oct 1997 16:25:22 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Win32ODBC-perl INSERT statement
Message-Id: <34327917.2638544@igate.hst.moc.com>

[cc'd automagically to original author]

On Wed, 01 Oct 1997 09:01:29 -0700, Kerry Cakebread <kerry@lumber.com>
wrote:

>Hello,
>	I'm using Roth Consulting's ODBC Win32ODBC module, and am having
>difficulty with SQL INSERT statements to an Access97 datasource (Win
>NT4.0).  I'm getting a syntax error from the ODBC driver that my INSERT
>is wrong...

Take Perl out of the loop. First verify that your SQL is correct for
the DBMS you're using before you complicate matters by wrapping it in
Perl.

I'd suggest using the "MSQuery" tool that comes with 32 bit versions
of Office.

Once you're sure that it's good, translating into Perl shouldn't be
hard if you've read Dave Roth's ODBC FAQ.

Good Luck,

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 1 Oct 1997 17:17:38 GMT
From: jared@node6.frontiernet.net (Jared Evans)
Subject: Re: Win32ODBC-perl INSERT statement
Message-Id: <60u0ji$1esc$1@node6.frontiernet.net>

If you have verified that the syntax of the SQL statement is correct, I
suggest you rename the 'number' field to something else like 'the_number'.

I've been burned on this naming issue once before using ODBC.

-Jared
-- 
Jared Evans      Manufacturing Technology Analyst/Developer @ The Gleason Works
http://www.frontiernet.net/~jared


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

Date: Wed, 01 Oct 1997 10:24:11 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
Subject: Re: XS: sv_2mortal (when is it necessary?)
Message-Id: <3432873B.47A6966@weblogic.com>

Charles DeRykus wrote: 
>Pete Ratzlaff <rpete@ascda3.harvard.edu> wrote:
> > Just wrote my first real XS. Fantastic!
> > 
> > The routine involved creating C strings and passing them
> > back to Perl as scalars. Something like...
> > 
> > >void
> > >my_1st_xs(...)
> > >
> > >   PPCODE:
> > >   char *str1="Perl scalar 1";
> > >   char *str2="Perl scalar 2";
> > >
> > >   EXTEND(sp,2);
> > >   PUSHs(sv_2mortal(newSVpv(str1,length(str1))));
> > >   PUSHs(sv_2mortal(newSVpv(str2,length(str2))));
> > >
> > (No, this is not my XS routine, but just an example of how
> > I passed the C strings back to Perl)
> > 
> > The question:
> > 
> > Is 'sv_2mortal' really necessary here? If so, then why?
> > 
>Take a look at pg 331 of "Advanced Perl Programming" by 
>Sriram Srinivasan for an explanation of the "mortal" calls. 
>
>I concluded from reading Sriram that function arguments 
>passed on the stack need to be mortalized since they 
>live and die in the scope of that one-liner when they're
>thrown on the stack. That way, neither the caller nor the 
>called function needs to be bothered with this garbage :) 

Yes, that is correct. 

When you create a scalar with newSVpv, it comes with a refcount of 1. 
Either (i) you remember to delete it at some point, or (ii) you tell
Perl to
do it at end of scope (if that's when you want it gone). 
In your example, if you choose option (i), you will do something like
this:
   SV *arg1 = newSVpv(str1,length(str1));
   SV *arg2 = newSVpv(str2,length(str1));
   XPUSHs(arg1); /* Automatically does an EXTEND if necessary, then 
                    does a PUSH */
   XPUSHs(arg2); /* Automatically does an EXTEND if necessary, then 
   PUTBACK;
   perl_call_pv ("foobar", G_SCALAR);
   SPAGAIN;
   /* Manually get rid of the created scalars */
   svREFCNT_dec(arg1);
   svREFCNT_dec(arg2);
   ... and so on ...

If you just need a scalar to pass params to a subroutine, then
you might as well let it be a mortal. That way, you can simply
allocate a scalar, and have Perl delete it for you at the appropriate
time. 

Incidentally, if you are looking at hooking up C and perl, and don't
necessarily want to learn all these macros, then take a look at SWIG ...
it is a far better way of working than XS.  (www.cs.utah.edu:/~beazley)


>But, best read the book. Many great explanations of Perl 
>internals.   

Ah, thanks for the plug, Charles :)

- Sriram 


________________________________________________________________________
Principal Engineer      WebLogic, San Francisco        www.weblogic.com 
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/


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

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

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