[10349] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3942 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 10 13:07:24 1998

Date: Sat, 10 Oct 98 10:00:20 -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           Sat, 10 Oct 1998     Volume: 8 Number: 3942

Today's topics:
    Re: [OT] London.pm (was "Many Jars" Mystery) (Ronald J Kimball)
    Re: anyone got a rtf->html converter in perl? <avitala@macs.biu.ac.il>
    Re: Are there any "perl.newbie" group or forum? (Ronald J Kimball)
        Back-Reference <avitala@macs.biu.ac.il>
    Re: Back-Reference <jdf@pobox.com>
    Re: Back-Reference (Larry Rosler)
    Re: bug in this subroutine (Kevin Reid)
    Re: CGI search results and breakup output? <rootbeer@teleport.com>
    Re: CGI upload problem <gellyfish@btinternet.com>
    Re: crypt function in perl (Ronald J Kimball)
        DBM File <gaving@enter.net>
    Re: How do I remove a carriage return or space from a s <avitala@macs.biu.ac.il>
    Re: How do I remove a carriage return or space from a s <avitala@macs.biu.ac.il>
    Re: How do I remove a carriage return or space from a s (Larry Rosler)
    Re: How do I remove a carriage return or space from a s (Larry Rosler)
    Re: How do I remove a carriage return or space from a s <jdf@pobox.com>
    Re: How do I use die? (Michael Rubenstein)
    Re: Hrm. Linguistic Quandry (Ronald J Kimball)
    Re: Issuing remote commands trough sockets. <rootbeer@teleport.com>
    Re: Looking for redirect-scpt but *not* for a drop-down <rootbeer@teleport.com>
        Pb building Perl with Cygwin <xxxx@xxxx.xx>
    Re: Please help with time... (Ronald J Kimball)
        Printing a character to the same position on the monito <stackhou@execpc.com>
    Re: Printing a character to the same position on the mo (Honza Pazdziora)
    Re: Printing a character to the same position on the mo (Larry Rosler)
    Re: Q: Any List of Win32 Error Codes ? (Jeffrey Drumm)
    Re: re newbie question (Tad McClellan)
    Re: reg-exp: change < to &lt; but keep <I> - look ahead <alex@kawo2.rwth-aachen.de>
    Re: symlinks and perl (Honza Pazdziora)
        Syntax error <imran@netwave.ca>
    Re: Syntax error <jdf@pobox.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 10 Oct 1998 09:46:02 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: [OT] London.pm (was "Many Jars" Mystery)
Message-Id: <1dgnm57.1c6vr9lpf1tlmN@bos-ip-1-76.ziplink.net>

<dave@mag-sol.com> wrote:

> A bunch of techies in a City pub are very easy to spot. No-one's ever had any
> problems before. There are also a few photos on the web site - try the links
> from <http://london.pm.org/London.pm/WhatDone.html>. Last meeting, someone had
> downloaded a photo to a Palm Pilot and was going round the pub trying to
> recognise us!

Which may not have helped him much, but walking around with the Palm
Pilot probably helped the rest of you to recognise him!

There's been a PDA at every Boston Perl Mongers meeting so far.

Usually thanks to Chris.

:-)

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 8 Oct 1998 19:49:57 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: anyone got a rtf->html converter in perl?
Message-Id: <6viu34$l5o$1@news.biu.ac.il>


Chris Denman wrote in message <361cc9cb.0@norbert.cerbernet.co.uk>...
>anyone got a rtf->html converter in perl?
>
>If not I'll code one myselft (not looking forward to it, really!)


if working in win95, you could load the doc in Word - which will cvrt to
 .doc.
and then save as html




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

Date: Sat, 10 Oct 1998 10:38:22 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <1dgoh3t.5em2apqudydcN@bos-ip-1-76.ziplink.net>

madame philosophe <mp@mkt2mkt.com> wrote:

> OK, so I don't know the particulars of newsreaders... could it be the
> first message sent to the newsreader?  Or is this really a ridiculous
> question???

Yes, it is a ridiculous question.  You can't control how a random news
server handles your message, nor how a random news reader handles it
once it is received.

> I'm just thinking about making life easier for newbies as well as
> non-newbies. (That's not to say that I think my such pondering is the
> first to contemplate such a solution to such a problem, I'm sure it has.)

That's true, and it is a good idea.  Unfortunately, there's no way to
implement this particular suggestion

> What about implementing a color feature the way the Netscape Mail software
> can change the color of a subject header.  Then...I did think about the
> lovely <blink> tag....

Umm...  So you want us to implement a color feature in every news reader
on every hard drive in existence?  That is, I'm afraid, even more
ridiculous.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 8 Oct 1998 19:41:22 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Back-Reference
Message-Id: <6vitj2$msu$1@news.biu.ac.il>

after using a regex with some part in parenthesis, the vars $1, $2, etc are
set.
if a new regex is followed, do those vars loose they're previous val?

Avshalom Avital
Information Retrieval Laboratory
Bar-Ilan, Israel
avitala@macs.biu.ac.il




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

Date: 10 Oct 1998 17:16:13 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: Back-Reference
Message-Id: <m3vhlsqwg2.fsf@joshua.panix.com>

"Avshi Avital" <avitala@macs.biu.ac.il> writes:

> after using a regex with some part in parenthesis, the vars $1, $2,
> etc are set.  if a new regex is followed, do those vars loose
> they're previous val?

The documentation says:

       The scope of $<digit> (and $`, $&, and $') extends to the end
       of the enclosing BLOCK or eval string, or to the next
       successful pattern match, whichever comes first.
       ^^^^^^^^^^
See perlre.
-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 10 Oct 1998 08:08:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Back-Reference
Message-Id: <MPG.10891830ce9848c09898a9@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6vitj2$msu$1@news.biu.ac.il> on Thu, 8 Oct 1998 19:41:22 
+0200, Avshi Avital <avitala@macs.biu.ac.il> says...
> after using a regex with some part in parenthesis, the vars $1, $2, etc are
> set.
> if a new regex is followed, do those vars loose they're previous val?

There are two ways to answer this question:

1.  Try an experiment and see what happens.

2.  RTFM (`perldoc perlre`).

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


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

Date: Sat, 10 Oct 1998 12:14:47 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: bug in this subroutine
Message-Id: <1dgom3e.eh05ugq6lu38N@slip166-72-108-206.ny.us.ibm.net>

<zobsky@my-dejanews.com> wrote:

> Hi, all out there,
> 
> I am trying to construct a language parser but am being held up by this
> kind of bug. This segment of code and the associated subroutine analyses
> thecontents of an array @str.
> 
> I first point to the first member of the array (noun) I then call the
> subroutine (for case np1 defined by the string $next). I intend for the
> subroutine to  goto case noun but it seems to go the case adjective ( $x is
> incremented in the output)
> 
> Can anyone help me debug this tiny piece of code,please????

You need to use eq (string comparison) instead of == (numeric
comparison).

> Also, could someone show me how to impliment case structure in perl, i'm
> guessing it might be a more robust solution, but my text makes no mention
> of case structures.
<snip code>

Here's your code, fixed, reformatted, and using my favorite kind of case
structure:

$next = "np1";
$x = 0;
@str = qw(noun noun2 noun);

print "initially, next is $next and x is $x and str() points to
$str[$x]\n";

np1(); # parameters removed because they weren't doing anything.

print "finally, next is $next and x is $x and str() points to
$str[$x]\n";

sub np1 {
  if ($next ne 'np1') {
    $next;
  } else {
    &{{
      'adjective' => sub {$x++; $next = 'np1'},
      'noun' => sub {$next = 'np2'},
    }->{$str[$x]} || sub {$next = 'fail'}};
  }
}

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Sat, 10 Oct 1998 15:21:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI search results and breakup output?
Message-Id: <Pine.GSO.4.02A.9810100820020.4710-100000@user2.teleport.com>

On Sat, 10 Oct 1998, Noel Sampol wrote:

> I'm trying to write a Perl CGI script that searches for keywords in
> multiple ASCII text delimitted databases.  My question is how to show
> the results in lumps of 10.

Randal did that sort of thing in one of his Web Techniques
columns, I believe.

   http://www.stonehenge.com/merlyn/WebTechniques/

> noels@ozinet69.zip.com.au   (e-mail)
> * NOTE: Please remove '69' if replying by e-mail

Why should I remove broccoli beef? (Sorry, old joke... :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 10 Oct 1998 12:28:51 +0100
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CGI upload problem
Message-Id: <6vngdj$148$1@gellyfish.btinternet.com>

On Fri, 09 Oct 1998 19:21:48 GMT nepatsfan@my-dejanews.com wrote:
> I've written a CGI application to allow users to upload files.
> 
> After defining $file = param('filename') I'm attempting to read it and store
> it into another file.
> 
> while (<$file>){
> 
>     $new_file .= $_;
> }
> 
> All I seem to get is the name of the file rather than the contents of the
> file. What am I doing wrong?
> 

If you are using CGI.pm as it appears you are doing then this should work.

It is probably because you are using the incorrect encoding or your browser
doesnt support file upload. 

Go back to the CGI.pm documentation and read the section on file upload
fields.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Sat, 10 Oct 1998 10:38:29 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: crypt function in perl
Message-Id: <1dgohfc.3l6s36nm80u9N@bos-ip-1-76.ziplink.net>

[posted and mailed]

Ryan <see@bottom.of.sig> wrote:

> what do i encrypt a word from a file with to get a match with crypt.pl
> or even better what are linux/unix passwords encrypted with.

Passwords are encrypted with a two-character string called a salt.  The
salt appears as the first two characters of the encrypted password.

Thus,

crypt('perl', 'camel')

yields

ca96pY/3tgC4w

where the salt is 'ca'.


[Note that if you used the same string as the salt

crypt('perl', 'perl')

the first two letters of the password are preserved

peH86FQXdRxrU

which is a very bad thing.
Use a random salt instead.]


You would verify a password like this:

$encrypted = 'ca96pY/3tgC4w';
chomp($guess = <>);
while ($encrypted ne crypt($guess, $encrypted)) {
  print "Incorrect password\n";
  chomp($guess = <>);
}
print "Password ok\n";


Remember that the first two characters of the encrypted password are the
salt.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 10 Oct 1998 10:06:31 -0400
From: "Gavin" <gaving@enter.net>
Subject: DBM File
Message-Id: <361f69c3.0@news3.enter.net>

I am using a multi level hash table say for instance I make a has table that
looks like the following:

%testt = (
        joe => {
                name => "joey"
        }
);

To read the value I can simply reference is like this:
$testt{joe}{name}

When I put this in a DBM file I can not access the "2nd branch"
I would get an error saying use of an unitialized value.  I can access the
first set of values EX: $testt{joe}, but if I would access the name of joe
it cant in the DBM file, but it can in the hash file.  Can someone please
help me.  I need to get this DB file up and running.  If its not possible
please let me know.

Gavin




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

Date: Thu, 8 Oct 1998 19:30:28 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: How do I remove a carriage return or space from a string?
Message-Id: <6visuk$m94$1@news.biu.ac.il>


Glenn West wrote in message <36150c3e.162573892@news.ses.cio.eds.com>...
>>Suppose the var $hello contains the string "hi " and has a space or
carriage
>>return at the end of it. How would I remove the space or carriage return
so
>>that only the word "hi" exist?
>
>$hello=~s/[ \n]+$//g;

sorry, but I believe that's a mistake.
this is the correct one:

$hello =~ s/[\n\c]$//;




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

Date: Thu, 8 Oct 1998 19:33:38 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: How do I remove a carriage return or space from a string?
Message-Id: <6vit4h$lp4$1@news.biu.ac.il>


Craig Bandon wrote in message <6v32le$qnr@news-central.tiac.net>...
>$hello = chop($hello);
>
>--


no no no!

just chop($hello);
but what if there is no /n at the end, wouldn't you prefer:

$hello =~ /[\n\c]$//;

ha?




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

Date: Sat, 10 Oct 1998 08:06:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I remove a carriage return or space from a string?
Message-Id: <MPG.108917b438701f0a9898a8@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6vit4h$lp4$1@news.biu.ac.il> on Thu, 8 Oct 1998 19:33:38 
+0200, Avshi Avital <avitala@macs.biu.ac.il> says...
> Craig Bandon wrote in message <6v32le$qnr@news-central.tiac.net>...
> >$hello = chop($hello);
> no no no!
> 
> just chop($hello);
> but what if there is no /n at the end, wouldn't you prefer:
> 
> $hello =~ /[\n\c]$//;

I certainly wouldn't prefer that -- I would prefer something that 
compiled.

See my detailed flame in response to your other submission of this error.

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


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

Date: Sat, 10 Oct 1998 08:03:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I remove a carriage return or space from a string?
Message-Id: <MPG.1089172c9a8e289d9898a7@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6visuk$m94$1@news.biu.ac.il> on Thu, 8 Oct 1998 19:30:28 
+0200, Avshi Avital <avitala@macs.biu.ac.il> says...
> Glenn West wrote in message <36150c3e.162573892@news.ses.cio.eds.com>...
> >>Suppose the var $hello contains the string "hi " and has a space or carriage
> >>return at the end of it. How would I remove the space or carriage return so
> >>that only the word "hi" exist?
> >
> >$hello=~s/[ \n]+$//g;
> 
> sorry, but I believe that's a mistake.
> this is the correct one:
> 
> $hello =~ s/[\n\c]$//;

What makes you think so?  Did you take the trouble to try testing this 
one line of code before posting it for thousands of readers (and the 
archives) to see?

"\c]" represents a control character, so the character class is not 
terminated and the syntax of the regex is invalid.  You may have been 
thinking about so-called 'carriage return' which is "\r".  But the 
submitter probably meant newline in any case.

Thank you for trying to be helpful.  But it helps much more to be 
correct, and testing is essential for achieving correctness.

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


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

Date: 10 Oct 1998 17:17:33 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: How do I remove a carriage return or space from a string?
Message-Id: <m3sogwqwdu.fsf@joshua.panix.com>

"Avshi Avital" <avitala@macs.biu.ac.il> writes:

> Craig Bandon wrote in message <6v32le$qnr@news-central.tiac.net>...
> >$hello = chop($hello);
> 
> no no no!
> 
> just chop($hello);
> but what if there is no /n at the end, wouldn't you prefer:
> 
> $hello =~ /[\n\c]$//;

Lo lo lo!

  chomp $hello;

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


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

Date: Sat, 10 Oct 1998 14:39:15 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: How do I use die?
Message-Id: <361f6f46.72098732@nntp.ix.netcom.com>

On 10 Oct 1998 06:11:32 GMT, Jeff Zucker <jeff@vpservices.com> wrote:

>brettr wrote:
>> #!/usr/bin/perl
>> chdir('/user/printer')or die;
>> [snip]
>> I get Internal Server Error.
>
>Mistake #1: you left off -w on the first line.  Always use perl's
>warnings to find out what is going wrong.
>
>Mistake #2: you left off $! on the second line so you won't know what
>the error message is when it dies.
>
>Mistake #3: (and this is the big one) there's no way you can find out
>what went wrong by accessing that script from your browser - you have to
>run it on the command line to see what is going on.  Put in the -w and
>the $! and run it from the command line and you will find out why the
>script isn't working.  That is what die is for - to exit the program
>when something goes wrong so you can find out what went wrong.  You can
>use the CGI::CARP module to see a lot of specific error messages in your
>browser but even then it's best to test your scripts on the command line
>first so you can see where and often why the die exited the script.
>
>My guess BTW is that the script died because the directory you tried to
>chdir to didn't exist - either a typo or wrong path.

Another possibility is that the directory does exist but the web
server is running under a user id that does not have permission to
access it.  This would be common on Unix systems.  This can be a trap
if, as is common, you test it from the shell using an id that does
have proper permissions.

--
Michael M Rubenstein


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

Date: Sat, 10 Oct 1998 09:46:04 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Hrm. Linguistic Quandry
Message-Id: <1dgnmzj.1xqzgat1n1ljpeN@bos-ip-1-76.ziplink.net>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:

> [blah blah troll blah blah trawl blah blah trowel] 
> What say you boys?

I say that this was just a troll.  Or whatever you prefer to call it.

:-)

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 10 Oct 1998 15:28:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Issuing remote commands trough sockets.
Message-Id: <Pine.GSO.4.02A.9810100827110.4710-100000@user2.teleport.com>

On Mon, 5 Oct 1998, Farley Christian wrote:

> How can i have a script execute a command on a remote machine (like rsh)
> and collect back the output from that command?

Install a server on that remote machine which will execute commands sent
over a socket. But there's nothing perl-specific here; the server could be
written in C or in another language. Of course, you should do some kind of
authentication before running arbitrary commands. Have fun with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 10 Oct 1998 15:18:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Looking for redirect-scpt but *not* for a drop-down box!
Message-Id: <Pine.GSO.4.02A.9810100818160.4710-100000@user2.teleport.com>

On Sat, 10 Oct 1998 fon@cheabit.com wrote:

> I'm looking for this script - or maybe someone's here who can write this!?

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 10 Oct 1998 17:05:46 +0200
From: "Robert Germic" <xxxx@xxxx.xx>
Subject: Pb building Perl with Cygwin
Message-Id: <6vnsud$8qn$1@adis.cesnet.cz>

I edited config.sh from hints, ran sh Configure -d and everything worked
smoothly (well, I had to use /bin/gcc2 instead of gcc2 beacause sh
was saying 'gcc2: permission denied').
Now when I try 'make' it would say

BASH.EXE-2.01$ make
make: *** No rule to make target
`C:\\CYGNUS\\H-I386~1\\lib\\gcc-lib\\i386-cygwi
n32\\egcs-2.91.57\\..\\..\\..\\..\\i386-cygwin32\\include\\_ansi.h', needed
by `
miniperlmain.o'.  Stop.

Can anybody help? Thanks.

Robert Germic

P.S. I'm trying to build Perl (5.005_02) with Cygwin b19/egcs1.1 for Win95
SR2 CZ



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

Date: Sat, 10 Oct 1998 10:38:32 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Please help with time...
Message-Id: <1dgoial.u5g08t1pswphbN@bos-ip-1-76.ziplink.net>

Bernie <bfb@att.net> wrote:

> Thanks.  I thought their might be date/time methods
> I could use.

You could also look into the Date::Manip and Date::Calc modules, which
probably have methods that you could use for this.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 10 Oct 1998 07:31:24 -0500
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Printing a character to the same position on the monitor?
Message-Id: <6vnkfc$kfm@newsops.execpc.com>

I'd like to create a "pin wheel" to indicate to the user that my script
is still working and not hung.  The problem is, I have no idea how to 
print the characters (-,/,|, and \) to the same position on the monitor.

Would someone please point my in the right direction?

Thanks,

--
Mark Stackhouse

***********************************************************************

homepage: http://www.execpc.com/~stackhou

"The best things in life aren't things."
--Art Buchwald

***********************************************************************


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

Date: Sat, 10 Oct 1998 14:46:38 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Printing a character to the same position on the monitor?
Message-Id: <slrn71usqf.nq8.adelton@aisa.fi.muni.cz>

On Sat, 10 Oct 1998 07:31:24 -0500, Mark Stackhouse <stackhou@execpc.com> wrote:
> I'd like to create a "pin wheel" to indicate to the user that my script
> is still working and not hung.  The problem is, I have no idea how to 
> print the characters (-,/,|, and \) to the same position on the monitor.
> 
> Would someone please point my in the right direction?

There is a backspace character that will move the cursor one position
back. You need $| = 1 so that the output is flushed after each stage.
Consider the following code:

$| = 1;
print " ";		# so that we have something to delete ;-)

while (1) {
	for (qw( - \ | / )) {
		print "\b$_";
		sleep 1;
		}
	}
__END__

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sat, 10 Oct 1998 08:34:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Printing a character to the same position on the monitor?
Message-Id: <MPG.10891e5e4107f03d9898aa@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6vnkfc$kfm@newsops.execpc.com> on Sat, 10 Oct 1998 07:31:24 -
0500, Mark Stackhouse <stackhou@execpc.com> says...
> I'd like to create a "pin wheel" to indicate to the user that my script
> is still working and not hung.  The problem is, I have no idea how to 
> print the characters (-,/,|, and \) to the same position on the monitor.

Use backspace!

#!/usr/local/bin/perl -w
use strict;

$| = 1;               # This is vital!

my $x = '-/|\\';

print '-';
for (1 .. 20) {
    sleep 1;
    print "\b", substr $x, $_ % length $x, 1;
}
                                                                               
-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 10 Oct 1998 13:38:49 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Q: Any List of Win32 Error Codes ?
Message-Id: <361f5f80.243863045@news.mmc.org>

[ not really replying to Jonathan, as I missed the original post somehow ]

On 10 Oct 1998 11:53:43 +0100, Jonathan Stowe <gellyfish@btinternet.com>
wrote:

>In comp.lang.perl.misc Eisen Chao <echao@interaccess.com> wrote:
>> 
>> To All:
>> 
>> 
>> Any one out there know where a list of all the returned error
>> codes from Win32 modules like NetResources is ? I'm getting
>> some non-zero error codes but I have no idea what they mean.
>> 
>> 
>I couldnt get you a list but there is a Win32::* function that will
>give you the text for an error. I.E.
>
>use Win32;
>
>if( .. somehting that might return non-zero .. )
>{
>   print Win32::FormatMessage(Win32::GetLastError());
>}

You can also get the text for the messages interactively with the

C:\> NET HELP nnnn (Win95/98)

or

C:\> NET HELPMSG nnnn (NT)

commands, where nnnn represents the error number (at least in regard to
error codes returned by Win32::NetResource). I haven't used the
Win32::FormatMessage method yet myself (Thanks, Jonathan, I'll check it
out), but it appears as though this functionality is supposed to be
provided by Win32::NetResource::WNetGetLastError() and that I'm just to
stoopud to figure it out. Of course, I am fooling around with NT, so how
smart can I be anyway? ;-)

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: Sat, 10 Oct 1998 09:05:12 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: re newbie question
Message-Id: <oipnv6.shp.ln@flash.net>

Sam Wang (samwang@freewwweb.com) wrote:
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <HTML>

   HTML is for the World Wide Web.

   Usenet is not the World Wide Web.

   Please post in text only like everybody else does.


: sure there's the * wildcard. 

   Globbing and regular expressions are both "pattern matching",
   but they do different things, and are not the same.

   'wildcard' is a globbing term.

   The asterisk is called a 'quantifier' (in Camel and PODs) or
   'multiplier' (in Llama) in regular expressions.


: but something has to be infront of it and
: it'll only match zero or more of that. 
        ^^^^^^^^^^

   How many do you want to match instead?


: is there any way to make it match
: zero or more of ANYTHING?</HTML>


   So, if you could arrange for the "something infront of it"
   to match any character, then you would have what you want.

   I think if you do a word search for 'match any' in the
   Regular Expression documentation that came with your
   copy of perl (perlre) you can find out how to arrange that...


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


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

Date: Sat, 10 Oct 1998 13:24:12 +0000
From: Alex Farber <alex@kawo2.rwth-aachen.de>
Subject: Re: reg-exp: change < to &lt; but keep <I> - look ahead?
Message-Id: <361F5FFC.2DA31B07@kawo2.rwth-aachen.de>

Abigail wrote:
> Alex Farber (alex@kawo2.rwth-aachen.de) wrote on MDCCCLXV September

> ++ But how do you still allow people using <I>, </I>,
> ++ <A HREF=""> and </A> ? I guess it is probably done
> ++ somehow with (!=...)
> 
> No, because there are way too many cases you would like to consider.
> use HTML::Parser;

Hi,

thanks for the advice. I unfortunately made a typo: (?!...).
Isn't it possible with a look ahead reg. exp.? I wonder how
?! and ?= are usually used.

Greetings
Alex

--
http://www.simplex.ru/pref.html


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

Date: Sat, 10 Oct 1998 14:39:37 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: symlinks and perl
Message-Id: <slrn71usd9.nq8.adelton@aisa.fi.muni.cz>

On Fri, 09 Oct 1998 16:50:15 -0400, Shane Dewitt <dewitt@jlab.org> wrote:
> hi, this is my first time posting and i still new to perl.
> 
> my problem is that i have a html form that calls a symlink in
> /usr/csite5/WebServer/httpd/cgi-bin/TestPlans/TestPlan.pl (symlink is
> called TestPlan.pl) which points to
> /usr/csite5/WebServer/httpd/cgi-bin/TestPlans/1-0/TestPlan.pl
> 
> which works but the reall TestPlan.pl still thinks its in the symlink
> dir and cannot
> find it required files which are in the 1-0/. directory.

If I catch you well, you need

use lib '/usr/csite5/WebServer/httpd/cgi-bin/TestPlans/1-0';

at the beginning of the TestPlan.pl script.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sat, 10 Oct 1998 09:44:17 -0400
From: Imran Zalfackruddin <imran@netwave.ca>
Subject: Syntax error
Message-Id: <361F64B1.A2FF87EA@netwave.ca>

Hello:

I have attached a snip of a code. I am getting a syntax error on the
assignment to the
FORM array. What is wrong with the code??? Any help would be greatly
appreciated.

Regards.
Imran.

--------------------------------------------
open(IN,"</var/apps/xxxx.dat");
while(<IN>)                             # For each line of the file:
{
   #

  #
  # SPlit the inputline into its subcomponets
  # Each line has 40 sub components
  #

 @hold = split(/:/,$_);

 if(/^#/) { next; }                     # Discard comments.

  $FORM{'sessions'} = $hold(21);       <------- syntax error here
  $FORM{'expiration'} = $hold(9);

 ......




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

Date: 10 Oct 1998 17:10:59 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Imran Zalfackruddin <imran@netwave.ca>
Subject: Re: Syntax error
Message-Id: <m3yaqoqwos.fsf@joshua.panix.com>

Imran Zalfackruddin <imran@netwave.ca> writes:

> I have attached a snip of a code. 

>   $FORM{'sessions'} = $hold(21);       <------- syntax error here

> I am getting a syntax error on the assignment to the FORM
> array. What is wrong with the code???

There is no FORM array in your code; there's a *hash* called
%FORM. You refer to an array element like so:

  $hold[21]

The parentheses make no sense. Read perldata.

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


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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