[14067] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1477 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 24 12:09:37 1999

Date: Wed, 24 Nov 1999 09:05:36 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943463136-v9-i1477@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 24 Nov 1999     Volume: 9 Number: 1477

Today's topics:
    Re: alias a mailer (Fox)
    Re: alias a mailer (Fox)
    Re: alias a mailer (Fox)
    Re: Archive::Tar Sending File to Browser? (Malcolm Hoar)
    Re: Archive::Tar Sending File to Browser? <tony_curtis32@yahoo.com>
    Re: Archive::Tar Sending File to Browser? (Malcolm Hoar)
    Re: Best book on Perl <uri@sysarch.com>
    Re: Best book on Perl <uri@sysarch.com>
        CGI that doesn't return any result?? <citidancer@hongkong.com>
    Re: CGI that doesn't return any result?? <gellyfish@gellyfish.com>
    Re: CGI that doesn't return any result?? (Randal L. Schwartz)
    Re: Commercial Open Group (COG) development <henning@travellab.com>
        dynamically created filehandles. Help!! jkosowan@my-deja.com
    Re: filehandles and access symbols <rick.delaney@home.com>
    Re: getlogin() (Brett W. McCoy)
    Re: Help : Separate source file for some subroutines (Brett W. McCoy)
    Re: Help : Separate source file for some subroutines wanix@my-deja.com
    Re: how to print special characters? + new question <cuteman@sensewave.com>
    Re: lex, yacc perl ports <rhomberg@ife.ee.ethz.ch>
    Re: lex, yacc perl ports (Mark-Jason Dominus)
    Re: lex, yacc perl ports (Tad McClellan)
    Re: Merging files <lr@hpl.hp.com>
        mirror : y2k compliance <talk2tof@ifrance.com>
    Re: mirror : y2k compliance <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 24 Nov 1999 14:13:25 GMT
From: hry@163.net (Fox)
Subject: Re: alias a mailer
Message-Id: <383bf274.151713@news.bentium.com>

On Sat, 20 Nov 1999 17:02:56 GMT, kragen@dnaco.net (Kragen Sitaker)
wrote:

>>>That's not the same thing.
>>then ,how can i  do that ?
>
>Well, either change the aliases to say /www.fox/test.pl or change the
>filename to be /www/fox/test.pl.
i cchange aliases to test:"|/www/fox/test.pl"
add  Cwtest.com to sendmail.cf,and add DNS then it worked!

but i don't understand what on earth did i done.....8-(
>>i can run it in shell ,and no errors ....
>>so i don't think -W is useful.
>
>You are mistaken.
not fault in my script.

>>>That's an error from your MTA, not from perl
>>where to change to slove this error?
>
>"slove"?
my mother tongue not English ,I only remember approximate the
letters...8-)
"solve"
>So what happens if you execute the script by hand, feeding it an email
>message on stdin?
yes , by"|",the mail content would be passed as stdin.
i'm busy in these days ,so reply too late sorry.


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

Date: Wed, 24 Nov 1999 14:13:26 GMT
From: hry@163.net (Fox)
Subject: Re: alias a mailer
Message-Id: <383cf27f.162240@news.bentium.com>

On 20 Nov 1999 11:30:50 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>   ----- The following addresses had permanent fatal errors -----
>"|/home/gellyfish/clpmtest/mailthing.pl"
>    (expanded from: fook)
>
>   ----- Transcript of session follows -----
>Cant open  test to open - Permission denied
>554 "|/home/gellyfish/clpmtest/mailthing.pl"... unknown mailer error 13
>
>
>So the moral of the story is that you should *always* check the success
>of an open :
>
>  open (IFILE,'>>test') || die "Cant open test - $!\n";
file "test" is in 777 mode at that time.

>Almost certainly your problem is that you are trying to create a file in
>a directory that the user that the MTA runs the script as doesnt have=20
>permission to do so - you should specify a path to a location in the
>first instance that is world writeable like /tmp.  You should also
>check that the program file is executable by a possibly unknown user
>try 755 in the first instance.  The "Text file busy" is a wierd one
>because that is usually a sign that you are trying to overwrite the text
>of a running program - I think that it is probably a spurious message
>caused by whatever return your program has when it tries to write to
>an unopened filehandle.
i solved those problem ,but i changed too many settings to remember
what did i changed .8-(
too many possible ,make me bewilder....@-@



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

Date: Wed, 24 Nov 1999 14:13:30 GMT
From: hry@163.net (Fox)
Subject: Re: alias a mailer
Message-Id: <383df283.166236@news.bentium.com>

On 21 Nov 1999 11:44:46 GMT, mgjv@localhost.localdomain (Martien
Verbruggen) wrote:

>> then ,how can i  do that ?
>
>Euhmm.. Either change the location of test.pl to /www/fox/ or change the
>line in your aliases file to aaa:|/www.fox/test.pl...
aaa:|/www.fox/test.pl woun't work.

>
>Did you really need to ask that?
yes ,but not "aaa:|/www.fox/test.pl",that's aaa:"|/www.fox/test.pl"

>That's a very silly attitude. All the people here that are quite
>experienced Perl users believe that -w (_lowercase_) is a useful thing.
>Maybe you know more than all of use put together, and maybe we are
>mistaken, and maybe -w is not useful, but you'll have to explain
>slightly more verbosely why not,
i'm  too rampant..... SORRY,becourse in my script ,just like to
do a "hello world",so i don't think -w is useful.
if make you feel not so well i can make apologize to you.

>Sorry.. I don't understand. slove is not english, and I can't, even
>trying very hard, come up with a meaning for it, allowing for many sorts
>of typos and/or misspellings. Do you mean 'get rid of'?
yes that is "solve",i'm careless...8-(

>The above two remarks were meant to point out to you that the error
>messages have noting at all to do with Perl, and that you need to
>consult your shell and MTA documentation, or ask in a newsgroup that
>deals with those things.
I want to write a script to process mail ,and i like to use PERL,so i
think about here 1st.

>Yes? So.. get yourself a mail message, probably from your mailbox, and
>execute your script, with the mail message as input, just like your MTA
>hopefully would do. Not that your script does anything with the input at
>the moment (which means that it's lost for prosperity), but it may tell
>you something.
but in this way , i must jion into that job ,i want to process maill
automatic.

>But above, you already mentioned 'i can run it in shell, and no errors
>....', so there is nothing wrong with the perl. Maybe it's a
>configuration issue of your MTA. Maybe it's something else on your
>platform. But it's _not_ _perl_.
yes i'b solve (i hope the spell is right,and meaning is right 2) that
problem.
THX=20


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

Date: Wed, 24 Nov 1999 14:54:04 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Archive::Tar Sending File to Browser?
Message-Id: <383bfc0c$0$211@nntp1.ba.best.com>

In article <slrn83nqh6.m2v.abigail@alexandra.delanet.com>, abigail@delanet.com wrote:
>$$ 
>$$ When I am in the browser (netscape), I get a save file dialog but he
>$$ file name is always the name of my perlscript (perlscript.pl) by
>$$ default.  How do I get the desired filename to be the default in the
>$$ save dialog?  If I rename the default to temp.tar, and then use winzip,
>$$ I am able to read the archive.
>
>You would change the sources of Netscape...

That would be a very silly way to solve this problem.

Invoke your CGI via a URL that takes advantage of PATHINFO
(see the CGI specs). Like this:

<a href="perlscript.pl/temp.tar">

This will cause the browser to place "temp.tar" in the File
Save dialog. It works with all major browsers -- even Lynx IIRC.

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 24 Nov 1999 15:00:34 +0000
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Archive::Tar Sending File to Browser?
Message-Id: <wkln7oorxp.fsf@yahoo.com>

malch@malch.com (Malcolm Hoar) writes:

> In article
> <slrn83nqh6.m2v.abigail@alexandra.delanet.com>,
> abigail@delanet.com wrote:

> >You would change the sources of Netscape...
> 
> That would be a very silly way to solve this problem.

It's the only reliable way.

> Invoke your CGI via a URL that takes advantage of PATHINFO
> (see the CGI specs). Like this:
> 
> <a href="perlscript.pl/temp.tar">
> 
> This will cause the browser to place "temp.tar" in the File
> Save dialog. It works with all major browsers -- even Lynx IIRC.

Unless it's been configured to do something else.

how would my perl LWP robot -> braille browser open
a save dialog?

Server-side software cannot force browsers to do
things.

tony


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

Date: Wed, 24 Nov 1999 15:29:11 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Archive::Tar Sending File to Browser?
Message-Id: <383c0446$0$210@nntp1.ba.best.com>

In article <wkln7oorxp.fsf@yahoo.com>, Tony Curtis <tony_curtis32@yahoo.com> wrote:

>how would my perl LWP robot -> braille browser open
>a save dialog?
>
>Server-side software cannot force browsers to do
>things.

HTTP clients use certain conventions, some more formal than
others. This is one such convention, widely adopted. The solution
I proposed has been tested succesfully with more than a dozen
of the most common browsers going right back to Netscape 1.x.

Unconventional browsers may well produce unconventional results.

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 24 Nov 1999 11:11:10 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Best book on Perl
Message-Id: <x7puwzlvj5.fsf@home.sysarch.com>

>>>>> "DC" == David Cantrell <NukeEmUp@ThePentagon.com> writes:

  DC> On 23 Nov 1999 22:18:06 -0500, Uri Guttman <uri@sysarch.com> said:
  >>>>> ... "Elements of Programming with Perl" by Andrew Johnson ...
  >> 
  >> it is hard to judge a book aimed at non-programmers when we are all (i
  >> hope) experienced hackers ...

  DC> Which is why Croydon Perl Mongers has found a complete newbie to
  DC> review it.  Book hasn't arrived yet though, and I'm not going to
  DC> pester her for her review for at least a month after it does.

a total programming newbie, i hope? anyhoo, send me the review or a link
to it and i will put it on my perl books page.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 24 Nov 1999 11:13:19 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Best book on Perl
Message-Id: <x7n1s3lvfk.fsf@home.sysarch.com>

>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:

  DC> Do *not* buy any book with the word 'dummies', 'unleashed',
  DC> or 'idiot' if you really want to learn some Perl.

or which have a time period (in 5 days, 2 weeks, etc.), or which have
perl5 in the title (which usually means a sloppy upgrade of a perl4
book).

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 24 Nov 1999 23:34:04 +0800
From: "Calvin" <citidancer@hongkong.com>
Subject: CGI that doesn't return any result??
Message-Id: <81h077$d8p$1@hfc.pacific.net.hk>

Hi,
    I want to execute a perl cgi when the user click on a "submit" button.
However, i don't want the cgi script to return any result. And the user can
state in the current page and do other actions. How can i do that???

    If i just simply doesn't print anything to the STDOUT in the script, it
just get a internal server error page.

    The background is that i want to control a electrical vehicle. So there
are four buttons for move forward, backward, left and right. So i just want
to user to state in the same page to control the vehicle. Of course, i can
return the same html document from the cgi script. But there are something
other than the buttons in the html page (eg. a live CAM) which i don't want
to download and initilize it again each time the buttons are clicked.

    I would be grateful if anyone can point me out the direction.

Best regards
Calvin




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

Date: 24 Nov 1999 16:17:48 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI that doesn't return any result??
Message-Id: <383c0fac_2@newsread3.dircon.co.uk>

Calvin <citidancer@hongkong.com> wrote:
> Hi,
>     I want to execute a perl cgi when the user click on a "submit" button.
> However, i don't want the cgi script to return any result. And the user can
> state in the current page and do other actions. How can i do that???
> 

You have to return the appropriate status code - however this is not
particular to Perl - I would suggest that you ask in the newsgroup :

    comp.infosystems.www.authoring.cgi

Or read the appropriate RFC ...

/J\
-- 
"I want to be like Oprah" - Sarah, Duchess of York


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

Date: 24 Nov 1999 08:23:38 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CGI that doesn't return any result??
Message-Id: <m11z9fsvsl.fsf@halfdome.holdit.com>

>>>>> "Calvin" == Calvin  <citidancer@hongkong.com> writes:

Calvin>     I would be grateful if anyone can point me out the direction.

This would be the same if it were written in either Perl or COBOL.
Therefore, the proper group to get rather informed answers is
comp.infosystems.www.authoring.cgi, two doors down the hall to the
left.  Move along now.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 24 Nov 1999 15:30:02 GMT
From: Henning Strandin <henning@travellab.com>
Subject: Re: Commercial Open Group (COG) development
Message-Id: <81h09k$tnc$1@nnrp1.deja.com>

First, apologies for the off topic post. I haven't spent much time in
'misc' newsgroups and I guess it I thought it was a little more misc
than it actually is.

In article <slrn83kte4.b0e.tadmc@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
> On Tue, 23 Nov 1999 01:06:40 GMT, Henning Strandin
>    <henning@travellab.com> wrote:
>
> >The pay will be in company stock.
>
>    Programmers work for money.
>
>    Programmers are not (necessarily) investors.

Hmm... No, certainly not necessarily, and this will not necessarily
appeal to every programmer. I never thought it would. However, equity
shares are a common currency these days, and possibly the most
profitable. I am a programmer and I own stock. Not very much, but it
sure doesn't hurt.

>    misc.invest.* newsgroups would be a good place to look for
>    investors (well, better than in a computer language newsgroup
>    anyway).
>
> >Stock is cheap now, but will probably increase to about 400-600%
> >within
> >a year.
>
>    Investors speculate, not programmers.

I know a few programmers who would oppose that.

> >Pay will be calculated from an hourly fee and an aproximation of the
> >number of hours it would take a reasonably skilled programmer to
finish
> >the task. We don't care how long you spend, what your credentials are
or
> >whether you've ever programmed before. When the deadline arrives we
> >evaluate any contributions and pay one or several people, depending
on
> >how we use the code.
>
>    So the programmer might get paid or might not?

This is the main problem. However, the idea is that when you start
working on a contract, you communicate this to the rest of the group, in
some shared forum. You can also declare that you'd like to do some part
of the job, in cooperation with someone else. Any combinations of
cooperation and competition is possible. The important thing is that the
programmer knows the odds he's facing. Then it's up to the programmer to
decide whether the reward is worth it. I suspect that most of the time
not many programmers/teams will be working on the same contract. Group
communication will see to that.

>    That is not going to help you attract good programmers.
>
>    Good programmers can easily get paid for programming somewhere
>    else.

When I was a sysadmin, I used to do a lot of programming on my spare
time. This is aimed towards that kind of programming, or towards
programmers that do contract jobs. I'm talking about a few hours per
week, or more when you feel up to it. It's wholly up to you.

Thanks for the feedback, it's very useful.

Since I realize that this is very off-topic for this group I'm not going
to post about it any more here.

I can be reached at henning@travellab.com
and the COG website is being set up at http://www.travelstart.net/COG


Regards

Henning Strandin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 24 Nov 1999 16:20:42 GMT
From: jkosowan@my-deja.com
Subject: dynamically created filehandles. Help!!
Message-Id: <81h38k$5r$1@nnrp1.deja.com>

Hello Larry and Friends

I've hit a bit of a snag when trying to use dynamically created
filehandles.

Basically, when given a valid <filename>, my program renames it to
<filename>.bak, opens it as a source and opens a new copy of <filename>
as the target (in essence, simulating an in-place edit when the
<filename>.bak is unlinked)

Anyway, all of this happens in a subroutine, which passes back a list
of 2 filehandles: $list[0] = "BAK".$i and $list[1] = "NEW".$i

Note: $i is the dynamic part of the filehandle and is incremented before
being used.

After this, my ::main routine fills it's my @handlelist; with the
handles.  This all is OK, and the handles are passed into the list
correctly.

The problem comes when I try to use <> to read the <filename>.bak like
this:

$date_stamp = <$handlelist[0]>;

It doesn't return the first line of <filename>.bak, but populates
$date_stamp with the name of the filehandle instead.

I have a hack that will work, namely putting $handlelist[0] into a
separate variable then calling the <>:

my $temp = $handlelist[0];
$date_stamp = <$temp>;

But, somehow my spidersense tells me that I've got to force another
evaluation of $handlelist[0] before the <> gets the value.  Maybe it's
improperly quoted, or needs a bracket, or something, but I can't figure
it out.

Anyway, any help that the Perl gurus could give would be greatly
appreciated.

Thanks everyone

----------

J


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 24 Nov 1999 14:31:28 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: filehandles and access symbols
Message-Id: <383BF6E1.5609BC1D@home.com>

[posted & mailed]

Abigail wrote:
> 
> Rick Delaney (rick.delaney@home.com) wrote on MMCCLXXVI September
> MCMXCIII in <URL:news:383B794B.B7473360@home.com>:
> !!
> !! perldoc -f seek
> !! perldoc perlopentut
> 
> I checked the latter. It doesn't seem to mention seek when using +< open.

I mentioned perlopentut because it does mention the different open
modes, distinguishing >> as append from +< as read-write.  Re-reading
the original poster's question shows me that his problem was more likely
with the behaviour of his program versus his expectation rather than a
misunderstanding of the meaning of the open modes.  Thanks for catching
that.

However, perlopentut does mention seek with +<.

Excerpt 1:

    To open a file for update, where the file must already exist: 

        open(FH, "+< $path");
        sysopen(FH, $path, O_RDWR);

Excerpt 2:

    To open a file for update, creating a new file if necessary: 

        sysopen(FH, $path, O_RDWR | O_CREAT);

Excerpt 3 (look, it's even a hit counter):

        sysopen(FH, "numfile", O_RDWR | O_CREAT)
            or die "can't open numfile: $!";
        # autoflush FH
        $ofh = select(FH); $| = 1; select ($ofh);
        flock(FH, LOCK_EX)
            or die "can't write-lock numfile: $!";

        $num = <FH> || 0;
        seek(FH, 0, 0)
            or die "can't rewind numfile : $!";

Perl docs -- an excercise in deductive logic.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Wed, 24 Nov 1999 14:30:27 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: getlogin()
Message-Id: <slrn83ntou.g0r.bmccoy@moebius.foiservices.com>

Also Sprach Paul Walker <paul.walker@st.com>:

>> >Quick question - getlogin() is limited to returning 8 characters for a
>> >username. Is that because the OS only returns 8 characters, or just a
>> >limitation for some other reason?
>> Where does it say that it is limited 8 characters, and on what OS?
>
>The copy of "Teach yourself perl" that I'm using (since it's the closest
>thing we have to a handy reference!). Doesn't specify what OS, but we're
>using Solaris. If someone could check how many it returns under NT, that
>would be much appreciated. :-)

Does getpwuid() have the same restriction?  I think it is an OS
restriction, since they implement the underlying C functions.  Don't know
what the situation is with NT -- Linux doesn't seem to have a problem with
it.  Don't know what *BSD does, but it is probably easy enough to find
out.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: Wed, 24 Nov 1999 14:32:46 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Help : Separate source file for some subroutines
Message-Id: <slrn83ntt9.g0r.bmccoy@moebius.foiservices.com>

Also Sprach Jason <ancient_97@yahoo.com>:

>	I need some help on how to :
>	Keep my subroutines into a separate source file so that my main
>script does not show subroutine declarations.
>	I tried using USE but it doesn't seem to work.

use or require are the things to use.  But are you properly implementing
your packages and modules?  You can't just stick your subroutines in a
separate file and expect them to work.  Did you read perlmod?  If not, go
back and do it.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: Wed, 24 Nov 1999 15:53:59 GMT
From: wanix@my-deja.com
Subject: Re: Help : Separate source file for some subroutines
Message-Id: <81h1ml$upo$1@nnrp1.deja.com>

In article <383babf3.8276429@news.singnet.com.sg>,
  ancient_97@yahoo.com (Jason) wrote:
> Hi.
>
> 	I need some help on how to :
> 	Keep my subroutines into a separate source file so that my main
> script does not show subroutine declarations.
> 	I tried using USE but it doesn't seem to work.
>
>

If you just want another simple file with some routines in it that can
be called directly from the main file without having to actually write a
package file (.pm), slap all the routines in the other file, make sure
the very last statement in there evaluates to 1 (I usually just make the
last line "1;") and then go back to your main file. At the top of that,
put in "require <otherfile>;" replacing <otherfile> with the name of the
file containing your other routines.

That second file has to evaluate a "1" at the end, otherwise your main
file will exit with the error "program.pl did not return true at line
xx". Cryptic enough to keep you searching for a while. ;)

Ex.:
========================
main.plx:
---------
require './routines.pl';

while (!($done)) {
	do_stuff();
}

routines.pl:
------------

sub do_stuff () {
	print "doing stuff...\n";
}
1;

========================

HTH
-Jon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 24 Nov 1999 16:28:40 GMT
From: "cuteman" <cuteman@sensewave.com>
Subject: Re: how to print special characters? + new question
Message-Id: <YmU_3.2769$QA6.186179584@news.telia.no>


cuteman <cuteman@sensewave.com> wrote in message
news:1wB_3.2608$QA6.185347072@news.telia.no...
> I don't seem to get the special characters I want.
>
> I have programmed a WebShop using Perl/CGI. But my script writes out
"funny"
> characters for the norwegian characters "æøåÆØÅ". How do I type them? I've
> tried "\æ\ø\å\Æ\Ø\Å". (Hmm... perhaps something like "%XX" for each?)
>
>
> Sigmund S.

I just thought I should add another aproach. I made a script listing up the
ASCII value of each character. Then I found that the characters I needed had
the values:
æ:230
ø:248
å:229

Then when I wanted to print something I used the syntax

print "Trykk her for ";
print chr(229);
print " g";
print "chr(229);
print " tilbake\n";

Now I wonder how this could be written in one line.(?)


Sigmund S.




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

Date: Wed, 24 Nov 1999 15:13:36 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: lex, yacc perl ports
Message-Id: <383BF290.C26B62D@ife.ee.ethz.ch>

W. Lyle Hayhurst wrote:
> 
> Does perl have any mods for these two standard
> programs?  I searched cpan and didn't come up
> with anything.

What do you mean: lex/yacc written in Perl or lax/yacc producing Perl?
For the first, I don't see much reason. The originals work, Perl would
be quite a bit slower. For the second, AFAIK the yacc & lex output
depends heavily on C as does the code added to the .y file. You'd either
have to replace that with perl, which gives you a different language, or
convert it, which is very complicated.

I use a shared library containing a lex/yacc parser to read my data
files and convert the stuff to a perl structure for processing, because
the parser existed before.

- Alex


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

Date: Wed, 24 Nov 1999 15:03:14 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: lex, yacc perl ports
Message-Id: <81gulr$1cc$1@monet.op.net>

In article <Pine.GSO.3.96L.991124084737.1492B-100000@unixs4.cis.pitt.edu>,
W. Lyle Hayhurst <wlhst6+@pitt.edu> wrote:
>
>Does perl have any mods for these two standard
>programs? 

Parse::Yapp is  very similar to Yacc.

My `py' project is another attempt to do the same sort of thing in a
different way (although I recommend using Oarse::Yapp instead.)

Another Perl module for generating parsers is Parse::Recdescent.

`lex' in Perl is a silly idea, because Perl's powerful built-in
regular expressions already do everything that lex does that you would
want to do.  `lex' lexers read an input one character at a time and
return a token to yyparse() when they recognize one.  In Perl reading
an input one character at a time is a foolish thing to do.  The
`perlop' man page has examples of better approaches in the section on
the m//gc operator.




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

Date: Wed, 24 Nov 1999 05:08:50 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: lex, yacc perl ports
Message-Id: <slrn83ne9i.d7m.tadmc@magna.metronet.com>

On Wed, 24 Nov 1999 15:13:36 +0100, Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote:
>W. Lyle Hayhurst wrote:
>> 
>> Does perl have any mods for these two standard
>> programs?  I searched cpan and didn't come up
>> with anything.

>AFAIK the yacc & lex output
>depends heavily on C as does the code added to the .y file. You'd either
>have to replace that with perl, which gives you a different language, or
>convert it, which is very complicated.


   http://www.plover.com/~mjd/perl/#parser


   "This program, py, implements LALR(1) parsers in Perl. 
    These are the sorts of parsers produced by YACC and Bison.
    But the program is a complete oddity."


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 24 Nov 1999 08:17:07 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Merging files
Message-Id: <MPG.12a5af5da8d4423298a273@nntp.hpl.hp.com>

In article <383BDC85.E9927CB7@shell.no> on Wed, 24 Nov 1999 13:39:33 
+0100, Magne Oevregaard <b.m.ovregard@shell.no> says...
> Hi all,
> 
> I have made a perl script to merge to ascii listings.
> I used a "while loop within a while loop" to test on conditions
> within the second file, and extracted a field from it.
> The script scans the complete second file for each line in the first
> file.
> The script works, but it's slow.
> 
> Could any of you suggest other ways of doing this. witch speeds up
> things?.

The algorithm you describe is inherently quadratic.  What you have to do 
is to pre-process the 'second file' first and extract and save the 
information you need to make decisions about the lines in the 'first 
file'.

In the absence of more information about what those decisions might be, 
no one will be able to help you further.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 24 Nov 1999 17:18:25 +0100
From: "xtof" <talk2tof@ifrance.com>
Subject: mirror : y2k compliance
Message-Id: <81h367$rhs2@news.issy.cnet.fr>


Hi,

I was told that the perl mirroring script "mirror" is not y2k compliant. But
i can't find a clue about it except this post :
http://x22.deja.com/getdoc.xp?AN=540069037&CONTEXT=943458544.687734862&hitnu
m=0
which seems to be a very special case to me.

[quote]
I recently noticed that for non-existent files, mirror (the Perl script) now
reports dates of "2069/12/31-19:00:00" instead of  "1969/12/31-19:00:00" :
 Compare src README.ftp (1): 1998/11/06-00:00:00 1301 f
                                dest README.ftp (): 2069/12/31-19:00:00 0 0
[/quote]

Might there be any perl 4 y2k compliance ? Then running mirror with perl 5
should be ok !?

Anyone has info about that ?
Thanks.

Christophe




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

Date: 24 Nov 1999 16:51:12 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mirror : y2k compliance
Message-Id: <383c1780_1@newsread3.dircon.co.uk>

xtof <talk2tof@ifrance.com> wrote:
> 
> Hi,
> 
> I was told that the perl mirroring script "mirror" is not y2k compliant. But
> i can't find a clue about it except this post :
> 

If the author of the script hadnt read and understood the description of
the gmtime and localtime functions in the manpage then this is a possibility
- without seeing the actual code we cant say any more : why dont you
ask the author ?

/j\
-- 
"You don't watch the Eurovision Song Contest to hear good music" -
Katrina Leskanich, Katrina and the Waves


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 1477
**************************************


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