character checking

2003-08-31 Thread Paul Archer
in use. So...does anyone know a way to tell if a particular character will be printable for a particular terminal type (so I can substitute it if I can't)? TIA, Paul Archer Never ascribe to malice what can perfectly well be explained by stupid

Re: reverse range (10..1)

2003-08-27 Thread Paul Archer
*Vey* cool examples--especially the 'map' in the first one. Thanks! Paul 7:26am, Todd W. wrote: > > "Paul Archer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Is there any (quick and easy) way to get a reverse range, like (

Re: reverse range (10..1)

2003-08-27 Thread Paul Archer
4:09pm, Ramprasad A Padmanabhan wrote: > Paul Archer wrote: > > Is there any (quick and easy) way to get a reverse range, like (10..1), > > rather than a standard (1..10)? The catch is to *not* use 'reverse'. > > I'm teaching Sun's perl course this week

reverse range (10..1)

2003-08-27 Thread Paul Archer
Is there any (quick and easy) way to get a reverse range, like (10..1), rather than a standard (1..10)? The catch is to *not* use 'reverse'. I'm teaching Sun's perl course this week (DTP-250), and we were talking about working on arrays. The book had an exercise that had the student reverse an arra

exists and defined--not just for hashes anymore

2003-08-27 Thread Paul Archer
Just a quick tip, which the docs mention that 'exists' and 'defined' will let you know if a particular element of a hash exists, or is defined, they work on arrays just as well. (I didn't know that, but a student today asked, so I tried it out.) Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: pronunciation guide

2003-08-25 Thread Paul Archer
p with "diamond". And I'm the culprit > responsible for "spaceship". > > -- And we (I, anyway) thank you. I got a good laugh out of that today when I told my class that's what it was called--"no, really, that's it's name..." Paul Archer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: pronunciation guide

2003-08-25 Thread Paul Archer
4:53pm, Paul Johnson wrote: > Paul Kraus said: > > > Wow. I find that unusual in my 10 years of computer use/programming ... > > I have always referred to $ and heard it referred to as "string". > > > > Not that it matters but I find that definitely unusual :) > > Do you have a background in BASIC

pronunciation guide

2003-08-25 Thread Paul Archer
Does anyone know of a pronunciation guide for the special variables and such in Perl? I came up empty on Google. I've been learning Perl by reading and doing, but I haven't talked to anyone face-to-face, so I'm not sure, for example, if $_ is spoken "dollar-underscore", or if people typically say s

Re: Global variables and a forked process

2003-08-14 Thread Paul Archer
Yesterday, Wiggins d'Anconia wrote: > Yes and no. There are multiple different implementations of threads all > of which have some good and bad points. You will need to look more into > them depending on your version of Perl and how complex the task is that > you wish to accomplish. (There is also

Re: our vs my

2003-08-14 Thread Paul Archer
Actually, while we're on the subject: can anyone *really* explain the difference between the two, or perhaps more importantly, when someone would want to use 'our' over 'my'? I've read the docs, but they're not sinking in. TIA, Paul 2:53pm, Dan Muey wrote: > Anybody know what version of Perl o

RE: Can run through perl, but not alone?

2003-08-14 Thread Paul Archer
/ p e r l \n > 058 This is more of a Unix trick than Perl, but worth mentioning (I guess): An(other) easy way to check for normally unprintable characters is to "send your cat to the vet". cat -vet weatherbug.pl -v show most non-printing characters -e show en

Re: perl/crontab Question

2003-07-29 Thread Paul Archer
> > > I have a perl job I want to run out of a cron job, However cron is not > > > reading my .cshrc file by default. So what I have to do is "wrap" the perl > > > job in a tcsh shell and then run the shell file out of cron. > > > > > > Is there a better way? Or maybe the real question is should I

Re: Very slow array searching

2003-07-29 Thread Paul Archer
In addition to the suggestions already given, you could sort your array, and then look at the middle and cut it in half (potentially several times). I forget the name for this technique, though... For example, you have 1000 elements, sorted. You compare your number to the 500th element. If it's hi

Re: perl/crontab Question

2003-07-29 Thread Paul Archer
Yesterday, [EMAIL PROTECTED] wrote: > This may be a bit off topic, but I'll ask it.. > > I have a perl job I want to run out of a cron job, However cron is not > reading my .cshrc file by default. So what I have to do is "wrap" the perl > job in a tcsh shell and then run the shell file out of cron

Re: Kinda Perl

2003-07-26 Thread Paul Archer
Yesterday, [EMAIL PROTECTED] wrote: > I have been writing perl along with some other languages, and I have been > thinking about setting up a server (so that I can play with different > server OS's and settings without messing anything up on our home network). > My parents think that it will cost

Re: Simple process controll question

2003-07-20 Thread Paul Archer
11:29am, Ramprasad A Padmanabhan wrote: > > > do "foo.pl args..." > > > > > > And in foo.pl set some scope defined variable like > > > > > > #foo.pl > > > $dbh=connect() > > > unless($dbh){ > > > $GLOBAL::ERRORSTR="Couldnot connect to database $@"; > > >exit 1 > > > } > > > > > > > > > A

Re: fast match count of char in string

2003-07-18 Thread Paul Archer
Here's a quick way: perl -e '$var="abdaatela"; print ((scalar grep /a/,(split /(.)/,$var)),"\n");' grep returns the number of matches in a scalar context, and the split breaks the string up into separate elements. The parens in the split return the item split on (otherwise it would throw away each

Re: custom return value from entire script

2003-07-18 Thread Paul Archer
> Anyone know if it's possible for the return/exit value of a script, in the > event of success, to be something other than 0? > The 'exit' command should work just like it does in the shell: 'exit 9;' for example, *should* give you an exit status of 9 (although I couldn't get it to work for me a m

Re: Comparing two strings for first difference

2003-07-17 Thread Paul Archer
Thanks a lot! This is just what I was looking for in your first example. (The second example won't do me as much good, as I need to consider characters that haven't changed inside of a string of characters that have--but it's still a good reference.) Thanks again, paul 10:11am, Rob Anderson wro

Comparing two strings for first difference

2003-07-17 Thread Paul Archer
I'm working on a bit of code to update a serial LCD display. The display is 4 lines by 40 characters, and each character can be addressed individually. First, the pseudocode I have is: compare each element of the new string and the old string # each string is 160 characters, and represents what i

array or scalar for display?

2003-07-10 Thread Paul Archer
have no idea if one is going to have any significant advantages/disadvantages over the other. Any suggestions? Thanks, Paul Archer - witzelsucht (vit'sel-zoocht) [Ger.] "A mental condition characteristic of frontal lo

RE: shared data in a class

2003-07-09 Thread Paul Archer
3:28pm, Bob Showalter wrote: > Paul Archer wrote: > > The answer to this is probably out there somewhere, but I haven't run > > across it yet, so a pointer to a webpage/tutorial/FAQ/whatever would > > be fine... > > > > I'm trying to put together

shared data in a class

2003-07-09 Thread Paul Archer
ade, and data written to the LCD). I suppose I could have a call like: $main_display->refresh_from_other_object(\$menu_display) (or something like that...I'm still getting used to the syntax), but that seems a waste to have to pass data manually, when the $menu_display object should be able

Re: convertion bash script to perl

2003-07-09 Thread Paul Archer
Sorry, nope. The thing is that shell scripts are essentially shell commands for control, and external commands for everything else. OTOH, manually rewriting a shell script in Perl is going to give you lots of experience in Perl. 8-) My best advice: take a deep breath and dive in. Paul 5:59am, th

Re: Removing entries from an array

2003-06-20 Thread Paul Archer
her_yates_shuffle( [EMAIL PROTECTED] ) : # generate a random permutation of @array in place sub fisher_yates_shuffle { my $array = shift; my $i; for ($i = @$array; --$i; ) { my $j = int rand ($i+1); @$array[$i

Re: I need help using %Hashes

2003-03-25 Thread Jason Archer
You need no changes at all to receive the input. Getting the input however into your program you need to understand CGI interface. I suggest you 1) Subscribe to [EMAIL PROTECTED] and 2) read up some tutorials on CGI Jason - Original Message - From: "Horace Franklin Jr." <[EMAIL PROTECT

Fw: Perl/TK problem with sub routines

2003-03-25 Thread Jason Archer
- Original Message - From: "Jason Archer" <[EMAIL PROTECTED]> To: "Zielfelder, Robert" <[EMAIL PROTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, March 25, 2003 3:56 PM Subject: Re: Perl/TK problem with sub routines

Using a module in the current pwd

2002-03-31 Thread Archer
Hi, how can I use a module that is located in the same directory as my .pl file? I'm searching for an equivalent to the C++ #include "headerfile.h" directive, which includes a header located in the current pwd. Thanks Robert Spielmann -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition