Re: TK madness

2002-04-18 Thread Mayank Ahuja
> So I will posit the question to members of this list: What resource do you > use when you need to learn about a feature of Tk? In Tk we have the concept of widgets. Everything like canvas, menubar, radio button, button, window is a widget. And fortunately many of them have been given a quite

RE: TK madness

2002-04-18 Thread Timothy Johnson
This request brings up a good point, though, in that we have this great thing, namely tk, that can be a great shortcut to creating graphical applications from the normally flexible but often spartan Perl, and there doesn't seem to be a really good resource for learning or reference. So I will p

Re: TK madness

2002-04-18 Thread Mayank Ahuja
The following has been taken from perldoc Tk::Canvas TEXT ITEMS A text item displays a string of characters on the screen in one or more lines. Text items support indexing and selection, along with the following text-related canvas methods: dchars, focus, icursor, index, in

Re: Incrementing the letters in an array

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 03:37 , Mark Anderson wrote: > No, you need ++ vs +1. As they say in perl, ++ is magical and will do want you want. + 1 will not. Wags ;) ps -- is not magical in the same sense as ++ either. >>> >>> How would you decrement a character then?

Re: How to check installed Modules in perl

2002-04-18 Thread drieux
On Wednesday, April 17, 2002, at 09:24 , Jaimee Spencer wrote: > > #!/usr/bin/perl > # list all of the perl modules installed > use File::Find ; > for (@INC) { find(\&modules,$_) ; } > > sub modules > { > if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return } > return unless /\.

TK madness

2002-04-18 Thread James Taylor
I'm trying to develop a user interface for a program I've written - What I need the program to do is print out the results of the current process to the TK interface. I absolutely can not figure out how to do a simple printing to TK function!@@!# For example, I would have a program that does

RE: Incrementing the letters in an array

2002-04-18 Thread Mark Anderson
>>> No, you need ++ vs +1. As they say in perl, ++ is magical and will >>> do want you want. + 1 will not. >>> >>> Wags ;) ps -- is not magical in the same sense as ++ either. >> >> How would you decrement a character then? There surely has to be a >> way? > >perldoc -f ord >perldoc -f chr >

Re: How to thread in Perl?

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 02:27 , Ahmed Moustafa wrote: > Chas, > > Thanks a lot! > >> #the main loop has exited, so we should check to see if there are >> #any unreaped children >> waitpid $_ for keys %running; > > My main loop is iterating forever i.e. a daemon; thus, any code after the

Re: Incrementing the letters in an array

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 03:14 , Elias Assmann wrote: > On Thu, 18 Apr 2002 [EMAIL PROTECTED] wrote: >> No, you need ++ vs +1. As they say in perl, ++ is magical and will >> do want you want. + 1 will not. >> >> Wags ;) ps -- is not magical in the same sense as ++ either. > > How w

RE: Incrementing the letters in an array

2002-04-18 Thread Elias Assmann
On Thu, 18 Apr 2002 [EMAIL PROTECTED] wrote: > No, you need ++ vs +1. As they say in perl, ++ is magical and will do want >you want. + 1 will not. > > Wags ;) ps -- is not magical in the same sense as ++ either. How would you decrement a character then? There surely has to be a way?

Re: How to thread in Perl?

2002-04-18 Thread Ahmed Moustafa
Chas, Thanks a lot! > #the main loop has exited, so we should check to see if there are > #any unreaped children > waitpid $_ for keys %running; My main loop is iterating forever i.e. a daemon; thus, any code after the main loop will not be executed. So, what do you think? Once again, thanks.

RE: What Causes PerlMongering

2002-04-18 Thread Nikola Janceski
> a) not knowing what has already been done in Perl > a la the CPAN A lot of my early work would have been spared if I knew that CPAN had EVERYTHING close to perfect that I wrote badly. > > b) other alternatives that exist in other open source solutions Eh... I let

What Causes PerlMongering

2002-04-18 Thread drieux
volks, One of the question sets that I really wonder about at times reviewing some of the questions that come up here is how much of what folks are working on is due to a) not knowing what has already been done in Perl a la the CPAN b) other alternatives that ex

RE: this may be offtopic: Open Source web-based email package?

2002-04-18 Thread James Kelty
http://turtle.ee.ncku.edu.tw/openwebmail/ This is by far the best one that I have seen, and it is even written in Perl! -James -Original Message- From: Anthony E. [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 12:36 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: th

Re: Incrementing the letters in an array

2002-04-18 Thread John W. Krahn
Allison Ogle wrote: > > Maybe it is because I am assigning my array to a line from another document > and not assigning letters dirtectly to the array because it still doesn't > work. It could be there is something wrong with my code too. > > $word=; #where is the filehandle and therefore $wo

Re: this may be offtopic: Open Source web-based email package?

2002-04-18 Thread Jonathan E. Paton
> I'm looking for an open source web-based email package > that will allow me to offer visitors free web-based > email accounts (However, I don't want to have to setup > system user accounts - as this would be a huge > security risk). Two PHP based solutions: www.squirrelmail.org www.horde.org/i

Re: how to return an array reference from a subroutine

2002-04-18 Thread drieux
On Wednesday, April 17, 2002, at 02:09 , richard noel fell wrote: > sub create_menu_bar > { > my $mb = $MW->Menu(); > $MW->configure(-menu=>$mb); > opendir DIR, "./" or die " cannot open current directory: $!"; > my $current_directory = cwd; >my @directories = grep { !/^\.\

this may be offtopic: Open Source web-based email package?

2002-04-18 Thread Anthony E.
Hello, I'm looking for an open source web-based email package that will allow me to offer visitors free web-based email accounts (However, I don't want to have to setup system user accounts - as this would be a huge security risk). Any info/help is appreciated! = Anthony Ettinger [EMAIL PRO

RE: Funny character on a dir name.

2002-04-18 Thread Jaimee Spencer
Hello Try, from the command line rm ./ name_ of_ directory -Original Message- From: Leon, Yanet I,,DMDCWEST [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 12:03 PM To: [EMAIL PROTECTED] Subject: Funny character on a dir name. Not necessarily a perl question. One of th

Re: Funny character on a dir name.

2002-04-18 Thread Chas Owens
On Thu, 2002-04-18 at 15:03, Leon, Yanet I,,DMDCWEST wrote: > Not necessarily a perl question. One of the users (on a Unix box) created a > directory with a dash at the beginning of the name (no idea how he did it) > and he needs to remove it. The name of the file is -testing is there a way > to

RE: Funny character on a dir name.

2002-04-18 Thread Bob Showalter
> -Original Message- > From: Leon, Yanet I,,DMDCWEST [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 18, 2002 3:03 PM > To: [EMAIL PROTECTED] > Subject: Funny character on a dir name. > > > Not necessarily a perl question. One of the users (on a Unix > box) created a > directory wit

Re: Funny character on a dir name.

2002-04-18 Thread Chris Ball
> "Yanet" == Yanet Leon, <[EMAIL PROTECTED]> writes: Yanet> Not necessarily a perl question. One of the users (on a Unix Yanet> box) created a directory with a dash at the beginning of the Yanet> name (no idea how he did it) and he needs to remove it. The Yanet> name of the

Funny character on a dir name.

2002-04-18 Thread Leon, Yanet I,,DMDCWEST
Not necessarily a perl question. One of the users (on a Unix box) created a directory with a dash at the beginning of the name (no idea how he did it) and he needs to remove it. The name of the file is -testing is there a way to remove it using perl or other means. I removed it using the inode

Re: how to return an array reference from a subroutine

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 11:21 , Felix Geerinckx wrote: [..] > Personally, however, I prefer an explicit 'return' statement, as in > > return map { ($_ => 1) }, @array; > > (The () are optional). [..] Ok, I can go there... so my test code shows me [jeeves:~/tmp/perl/misc] drieux% p

RE: Writing formatted results to a file - PLEASE IGNORE PREVIOUS EMAIL

2002-04-18 Thread Ho, Tony
Hi guys I managed to resolve the issue regarding the previous issue. First problem - $rows_processed = "rows_processed"; should be : $rows_processed = "rows processed"; After the first WHILE loop, I added a close and open (in this order) of SUMMARYTMP and it worked. Thanks again for the help. To

Re: how to return an array reference from a subroutine

2002-04-18 Thread Felix Geerinckx
on Thu, 18 Apr 2002 18:07:38 GMT, Drieux wrote: > hence > > map {[ 'cascade', '~'.$_]} @sub_directories; > > as the last line of the sub should have returned a 'list' > back to the caller just as the > > sub foo { qw/ 1 2 3 4 5 6 7 8 9 / } ; > > would return a 'list' ??? Yes > >

Re: string reading 5-4

2002-04-18 Thread Jonathan E. Paton
> How can I read a string 5 - 4 and get 1? Hallucinations may cause such strange errors. If the string is really "5 - 4", and you get "1" then your grey matter has failed. I suggest updating to a more reliable version ;) Oh, hang on... I know what you are talking about now! You want to evaluat

RE: Writing formatted results to a file

2002-04-18 Thread Ho, Tony
Hi Bob, I am having trouble writing another new format into the same file as the one I mentioned in the previous email. I executed the following code and it prints out the SUMMARY format but NOT the SUMMARY1 format into the same file. Any ideas ? Thanks in advance Tony The code is as follows :

RE: Incrementing the letters in an array

2002-04-18 Thread Stout, Joel R
Adding one and incrementing are different. You're adding 1. Did you try incrementing the character? Instead of this: $code[$y]=$code[$y]+1; try ($code[$y])++; #!/usr/bin/perl @code = qw( A B C D ); $y = 0; if( $code[$y] ne "F" ){ print "$code[$y]\n"; ($code[$y])++; print "$code[$y]\n"

RE: Incrementing the letters in an array

2002-04-18 Thread Mark Anderson
You are right, $code[$y]=$code[$y]++; shouldn't work, since it increments after the assignment. $code[$y]++; works for me, as does $code[$y]=++$code[$y]; This code: @code = split //,"ABCD"; #values stored in @code are now A B C D $y=0; if($code[$y] ne "F"){ print "$code[$y]\n"; $c

Re: how to return an array reference from a subroutine

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 06:05 , Felix Geerinckx wrote: > on Thu, 18 Apr 2002 12:56:43 GMT, [EMAIL PROTECTED] (Richard Noel Fell) > wrote: > >> However, I do not understand your >> comments about the return value of map. Does not map return a >> reference to an anonymous arrar, not a hash

RE: Incrementing the letters in an array

2002-04-18 Thread Wagner-David
No, you need ++ vs +1. As they say in perl, ++ is magical and will do want you want. + 1 will not. Wags ;) ps -- is not magical in the same sense as ++ either. -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 10:58 To: a a Subject:

string reading 5-4

2002-04-18 Thread P lerenard
Hi How can I read a string 5 - 4 and get 1? thanks Pierre _ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Incrementing the letters in an array

2002-04-18 Thread Allison Ogle
Maybe it is because I am assigning my array to a line from another document and not assigning letters dirtectly to the array because it still doesn't work. It could be there is something wrong with my code too. $word=; #where is the filehandle and therefore $word gets the string from the inpu

Re: about formal sub routine declartions

2002-04-18 Thread Chas Owens
On Thu, 2002-04-18 at 13:22, drieux wrote: > So my summary seems to be: > > Neat idea - may get cleaned up in perl6 > back in line behind my Seth and not to go there That is pretty much the long and short of it. I wouldn't recommend using prototypes unless you meet these three

Win32API::Time - setting the system clock

2002-04-18 Thread Craig C
Hi folks, Anyone know where to get hold of the module Win32API::Time ?? It's listed on ASPN but doesn't seem to be available through ppm or the obvious download lists. If there are any other suggestions for setting the system clock via a perl script I would be greatful. Thanks, Craig :) --

Re: about formal sub routine declartions

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 07:54 , Chas Owens wrote: [..] p0: thanks for the clarification on the @_; since my coding with that - like my habits with subs in general is based not upon any sense of 'understanding or knowledge' - but based solely upon a) ripped that off from someone

Fwd: Incrementing the letters in an array

2002-04-18 Thread drieux
> On Thursday, April 18, 2002, at 09:04 , Allison Ogle wrote: > >> Hi, >> >> I have an array which contains letters. I need to increment these >> letters >> in the array one at a time. For example going from B to C. I was trying >> something like >> >> $array[$x]++; > > did you check that yo

RE: Incrementing the letters in an array

2002-04-18 Thread Timothy Johnson
Oh, wait. I misread that. Are you sure the array contains letters? Usually an array will return 1 for an increment when the previous value was '', 0, or undef. -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 9:15 AM To: 'Allison Ogle';

RE: Incrementing the letters in an array

2002-04-18 Thread Timothy Johnson
Are you looking for something like this? $array[$x++]; #Moves to the next element in the array -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 9:05 AM To: a a Subject: Incrementing the letters in an array Hi, I have an array which cont

RE: Incrementing the letters in an array

2002-04-18 Thread Nikola Janceski
This works: use warnings; use strict; my @letters = qw( A B C D ); for (my $n = 0; $n < 4; $n++){ $letters[$n]++; } print "@letters\n"; > -Original Message- > From: Allison Ogle [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 18, 2002 12:05 PM > To: a a >

RE: Incrementing the letters in an array

2002-04-18 Thread Wagner-David
Must be missing something. Here is simple code and increments the current letter the next: my $x = 'E'; $x++; my @array = (); $array[0] = 'G'; $array[0]++; printf "%-s %-s\n", $x, $array[0]; Output: F H Wags ;) -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]

Incrementing the letters in an array

2002-04-18 Thread Allison Ogle
Hi, I have an array which contains letters. I need to increment these letters in the array one at a time. For example going from B to C. I was trying something like $array[$x]++; however that increments the letter to the number 1. Does anyone have any ideas? Thanks in advance. Allison -

RE: Studying & Source Code

2002-04-18 Thread Paul Ennis
Play with it. The more you play the better you will get, (just not too much or you'll go blind). Good books are: Perl by Example (the Example books are an excellent place to START) Perl in a Nutshell Also it takes time. You will not learn everything in 24 hours like some books advertise.

Re: Studying & Source Code

2002-04-18 Thread drieux
On Thursday, April 18, 2002, at 05:35 , Anthony Beaman wrote: [..] > I then try to study code but it's usually beyond me. [..] always remember perldoc -m will let you skim through the module completely - POD/Code/Comments. the three responses I have seen from Felix, Jonathan and Jen

Re: about formal sub routine declartions

2002-04-18 Thread Chas Owens
On Wed, 2002-04-17 at 20:25, drieux wrote: > > I just found this in the perldoc > > " Currently Perl subroutines have fairly limited > support for formal parameter lists. You can specify the > number of parameters and their type, but you still have to > manually take them

Re: How to thread in Perl?

2002-04-18 Thread Chas Owens
On Wed, 2002-04-17 at 19:06, Ahmed Moustafa wrote: > > You are better off trying > > > > $SIG{CHLD} = 'IGNORE'; > > > > at the top of your program and seeing if zombies are left out there. If > > so then you might want to use pop or shift like this > > > > waitpid shift @children while @children;

RE: how to return an array reference from a subroutine

2002-04-18 Thread David Gray
> But, the script below does not work. I get an error message : > Not an ARRAY reference at > /usr/local/ActivePerl-5.6/lib/site_perl/5.6.1/i686-linux-threa > d-multi/Tk/Menu.pm > line 69. The cause of this is the subroutine sub_menu. As I > understand things, the argument to -menuitems must b

RE: Perl simple array

2002-04-18 Thread Hooten, Michael
$d = 'test1,test2,test3,test4'; @data = split(/,/, $d); print $data[1]; -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 9:54 PM To: [EMAIL PROTECTED] Subject: Perl simple array Hey All, Just wondering why the following code won't p

Re: use of $_

2002-04-18 Thread Felix Geerinckx
on Thu, 18 Apr 2002 14:09:57 GMT, [EMAIL PROTECTED] (Gary Stainburn) wrote: > While your answer makes sense, why doesn't shift use the $_ as I > obviously expected? If you perldoc perlvar and look for the description of '$_', you will see where it is 'assumed'. To complicate

Re: Studying & Source Code

2002-04-18 Thread Felix Geerinckx
on Thu, 18 Apr 2002 13:01:39 GMT, [EMAIL PROTECTED] (Jonathan e. paton) wrote: > Studying other peoples Perl code is probably a Bad Thing, > since Perl doesn't enforce any style, design, efficency > or robustness on the programmer. > [...] > Not in my opinion. As above, many perl scripts availa

Re: use of $_

2002-04-18 Thread Gary Stainburn
On Thursday 18 April 2002 1:52 pm, Felix Geerinckx wrote: > on Thu, 18 Apr 2002 13:26:21 GMT, [EMAIL PROTECTED] (Gary > > Stainburn) wrote: > > [..] > > while this one, using $_ instead of $line fails stating once per line > > before the break that I'm using an uninitialised variable on the > > 'w

Re: how to return an array reference from a subroutine

2002-04-18 Thread richard noel fell
Felix - Thanks for the very clear explanation. Dick Felix Geerinckx wrote: > > on Thu, 18 Apr 2002 12:56:43 GMT, [EMAIL PROTECTED] (Richard Noel Fell) > wrote: > > > However, I do not understand your > > comments about the return value of map. Does not map return a > > reference to

Re: how to return an array reference from a subroutine

2002-04-18 Thread Felix Geerinckx
on Thu, 18 Apr 2002 12:56:43 GMT, [EMAIL PROTECTED] (Richard Noel Fell) wrote: > However, I do not understand your > comments about the return value of map. Does not map return a > reference to an anonymous arrar, not a hash? 'map' returns a *list*. This list can be coerced into an array or int

Re: Studying & Source Code

2002-04-18 Thread Jonathan E. Paton
> How's the best way to get the most out of studying and > studying source code? I'm always reading that looking > at source code (and coding in general) is the best way > to learn to program. The best way is to join a programming project, and learn the required aspects of the language you need

Re: Studying & Source Code

2002-04-18 Thread Jenda Krynicky
From: "Anthony Beaman" <[EMAIL PROTECTED]> > How's the best way to get the most out of studying and studying source > code? I'm always reading that looking at source code (and coding in > general) is the best way to learn to program. You should not just look at the code. You should play with it.

Re: use of $_

2002-04-18 Thread Felix Geerinckx
on Thu, 18 Apr 2002 13:26:21 GMT, [EMAIL PROTECTED] (Gary Stainburn) wrote: > [..] > while this one, using $_ instead of $line fails stating once per line > before the break that I'm using an uninitialised variable on the > 'while' line > > __BEGIN__ > print while (shift @HTML)!~/^

Re: how to return an array reference from a subroutine

2002-04-18 Thread richard noel fell
Drieux - Thanks for your reply. Your suggestion for the use of foreach makes sense and as been implemented. However, I do not understand your comments about the return value of map. Does not map return a reference to an anonymous arrar, not a hash? Dick Fell Drieux wrote: > > On Wednesda

Studying & Source Code

2002-04-18 Thread Anthony Beaman
How's the best way to get the most out of studying and studying source code? I'm always reading that looking at source code (and coding in general) is the best way to learn to program. I'm taking stuff of the net and going through it and trying to make sure I can "read" it and trying to see wha

use of $_

2002-04-18 Thread Gary Stainburn
Hi all, I've got a script that read in a HTML template file to an array, and then write it out a number of times substituting part of the text. Can anyone tell me why the following code fragment works __BEGIN__ my $line=''; print $line while ($line=shift @HTML)!~/^/; # skip to end of comment p

RE: Firewall

2002-04-18 Thread Kipp, James
http://www.packetfactory.net/Projects/Firewalk/ > > Anyone know of a perl script that can determine if a website > is actually > behind a firewall? > > thanks! > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubsc

Re: about formal sub routine declartions

2002-04-18 Thread Chris Ball
> "drieux" == drieux <[EMAIL PROTECTED]> writes: drieux> "Currently Perl subroutines have fairly limited support for drieux> formal parameter lists. You can specify the number of drieux> parameters and their type, but you still have to manually drieux> take them out of the `@

Sudoers Regex

2002-04-18 Thread Blackburn, David W
Hi I am trying to parse a string of text from a sudoers file, what I am trying to get out is the HOSTCLUSTER name and the hosts. Host_Alias HOSTCLUSTER = host1, host2, \ host3, host4, \ host5, host6 The first problem is I s

Re: regex question

2002-04-18 Thread Martin A. Hansen
hi john i implementet your solution. mine actually did work, but yours seemed more logical. it works nicely. thank you martin On Wed, Apr 17, 2002 at 12:58:07PM -0700, John W. Krahn wrote: > [EMAIL PROTECTED] wrote: > > > > hi, > > Hello, > > > im pasting some more of the lines i need to p

RE: Firewall

2002-04-18 Thread Joel Hughes
hmmm we'llyou can't tell anything from port 80 (http) coz (by the sounds of things) the firewall is configured to let that traffic thru (probably). now, you could sniff to see what other connections you can make (21 etc) but, if you make a connection or get some sorta reading back on a p