Re: Changing unix/linux passwords with Perl?

2001-06-10 Thread Chas Owens
On 08 Jun 2001 17:17:46 +1000, [EMAIL PROTECTED] wrote: > Hi Perl People, >I'm creating a web interface to a linux server and was wondering if >there are perl modules that can be used to change linux passwords? > > The idea is to be able to administrate a linux box without having

numb array getting value for letter array

2001-06-10 Thread bdale16
? How do i affect this type of result to my existing code if a grade of a 90-100 = an A and a grade of 80-90 = a B and a grade of 70-80 = a C and a grade of 60-70 = a D and a grade of 0-60 = a F I understand i am creating 2 more arrays but i need to get a range and assign it to a Letter

Re: system

2001-06-10 Thread Michael Fowler
On Sat, Jun 09, 2001 at 12:45:07AM -0700, SunDog wrote: > The SYSTEM and EXEC commands will only work for scripts running on > UNIX or unix like machines if you're doing this in Windoze ... > do not expect this to work .. could just be a good time to upgrade > to a Li

Re: numb array getting value for letter array

2001-06-10 Thread Peter Scott
At 02:43 AM 6/10/2001 -0500, bdale16 wrote: >? How do i affect this type of result to my existing code >if a grade of a 90-100 = an A >and a grade of 80-90 = a B >and a grade of 70-80 = a C >and a grade of 60-70 = a D >and a grade of 0-60 = a F > >I understand i am creating 2 more arrays but

Test: ignore

2001-06-10 Thread Will W
This post may be rejected by the [EMAIL PROTECTED] as has happened to one or two previous posts. The message body on those read "Our spam filter rejected this transaction." The ISP I use may have been blocked. We'll see if this message goes...

Cannot detect environment variables

2001-06-10 Thread George Petri
Hi all! Firstly, thanks to all those people who helped me with my command line arguments problem. Special mention goes to Jeff and his "Poorgramming joke". But unfortunately, I've run up against another problem :( I recently did this: print $ENV{USER}, "\n"; And i got "george" back

Re: Cannot detect environment variables

2001-06-10 Thread Markus Peter
On Sun, 10 Jun 2001, George Petri wrote: > But unfortunately, I've run up against another problem :( > > I recently did this: > > print $ENV{USER}, "\n"; > > And i got "george" back as the response. > > Then I did this (in Bash, Linux-Mandrake 7.2): > > MYVARIABLE=astring > perl

Re: Cannot detect environment variables

2001-06-10 Thread bmccoy
On Sun, 10 Jun 2001, George Petri wrote: > Then I did this (in Bash, Linux-Mandrake 7.2): > > MYVARIABLE=astring > perl -e 'print $ENV{MYVARIABLE}, "\n";' > > It spits out nothing...why doesn't PERL detect any of my environment > variables? This is critical in some CGI programs that

Re: Cannot detect environment variables

2001-06-10 Thread Paul Johnson
On Sun, Jun 10, 2001 at 10:44:09PM +, George Petri wrote: > Then I did this (in Bash, Linux-Mandrake 7.2): > > MYVARIABLE=astring > perl -e 'print $ENV{MYVARIABLE}, "\n";' I suspect you need to export MYVARIABLE. MYVARIABLE=astring export MYVARIABLE or export MYVA

Re: Cannot detect environment variables

2001-06-10 Thread Karen Cravens
On 10 Jun 2001, at 15:16, Markus Peter wrote: > On Sun, 10 Jun 2001, George Petri wrote: > > It spits out nothing...why doesn't PERL detect any of my environment > > variables? This is critical in some CGI programs that I intend to write (but > > Well - because MYVARIABLE is not yet an environm

RE: Understanding Randal's answer

2001-06-10 Thread Dave Newton
> ([EMAIL PROTECTED]) spew-ed forth: > > I've not been able to come up with any reasonable CGI that would be > > creating a path that the user has any control over; why would one want > > to do that? > What about things like document/filesystem management tools? Or > (re)configuration tools? Sayin

Re: numb array getting value for letter array

2001-06-10 Thread AB Ramos
On Sat, Jun 09, 2001 at 01:43:18PM +0800, bdale16 wrote: > ? How do i affect this type of result to my existing code > if a grade of a 90-100 = an A > and a grade of 80-90 = a B > and a grade of 70-80 = a C > and a grade of 60-70 = a D > and a grade of 0-60 = a F You have the psuedo-code r

Re: Cannot detect environment variables

2001-06-10 Thread Matt Cauthorn
George -- Make sure to use 'export' on your env. variables when setting them in a shell. So this should work: export MYVARIABLE=astring on my Red Hat box this did the trick: [mcauthorn@bubba mcauthorn]$ export MYVAR=testing [mcauthorn@bubba mcauthorn]$ perl -e 'print "$ENV{MYVAR}\n"'

Re: extracting substr

2001-06-10 Thread Matt Cauthorn
This works for me... #!/usr/bin/perl -w while (<>){ print if $_=~/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/; } Regards, Matt --- William <[EMAIL PROTECTED]> wrote: > hi, > > i want to be able to read a text file and extract only the valid > ip addresses. however, along with valid ip addres

CGI parser and stuff

2001-06-10 Thread Burt Humburg
Just installed Perl on a Linux box yesterday and I'm eager to get started... Is there a shareware/freeware Perl development environment? (As in comments are this color, constants are that color, a real-time debugger, etc?) Is there a module/include/header that parses CGI input and sticks it into

Re: CGI parser and stuff

2001-06-10 Thread bmccoy
On Sun, 10 Jun 2001, Burt Humburg wrote: > Just installed Perl on a Linux box yesterday and I'm eager to get started... > > Is there a shareware/freeware Perl development environment? (As in comments > are this color, constants are that color, a real-time debugger, etc?) If you are using Linux,

Re: CGI parser and stuff

2001-06-10 Thread Markus Peter
On Sun, 10 Jun 2001, Burt Humburg wrote: > Just installed Perl on a Linux box yesterday and I'm eager to get started... > > Is there a shareware/freeware Perl development environment? (As in comments > are this color, constants are that color, a real-time debugger, etc?) I suggest Emacs or Xemac

Re: CGI parser and stuff

2001-06-10 Thread Matt Cauthorn
I always point new Linux folks to: http://linuxnewbie.org. There you'll find board after board of useful stuff, dealing with almost anything you can think of. Click on the "discussion" link near the top of the page and you're off. As for editors on Linux, I use vim, which does sytax highlighting

Why ./perl/lib & ./perl/site/lib?

2001-06-10 Thread Tim Musson
Hey all, I was wondering why the perl install has both the ./perl/lib and ./perl/site/lib folders? They both seem to have the same type of things (modules, etc...). Why are there both, and why would you choose to put a module you were writing in one or the other? -- [EMAIL PROTECTED] Using Th

Re: Why ./perl/lib & ./perl/site/lib?

2001-06-10 Thread Rev. Jonathan T Sage
Unless I'm mistaken, I would have to say perl/site/lib = Site/Arch/Machine Specific Modules perl/lib = Default/Packaged Modules ~Jon --- Tim Musson <[EMAIL PROTECTED]> wrote: > Hey all, > > I was wondering why the perl install has both the > ./perl/lib and ./perl/site/lib folders? They both s

Archive old files

2001-06-10 Thread Tim Musson
Perl People, I am the only one at my current contract that knows Perl (and I can't for the life of me figure out why the others don't learn it instead of asking me each time it is needed... ). This time, I thought I would ask the list... The network drives (P: for personal data, etc)

Re: CGI parser and stuff

2001-06-10 Thread Bruno Veldeman
> Is there a shareware/freeware Perl development environment? (As in comments > are this color, constants are that color, a real-time debugger, etc?) I use midnight commander. Does syntax highlighting. On a RH Linux install it starts with mc. Some usefull keys: ctrl-o : switch between 2 line

Re: CGI parser and stuff

2001-06-10 Thread bmccoy
On Sun, 10 Jun 2001, Bruno Veldeman wrote: > > Is there a shareware/freeware Perl development environment? (As in > comments > > are this color, constants are that color, a real-time debugger, etc?) > > I use midnight commander. > > Does syntax highlighting. > > On a RH Linux install it starts wi

Re: CGI parser and stuff

2001-06-10 Thread Rev. Jonathan T Sage
For Linux/BSD there are quiet a number of editors that do syantax highlighting. Perhaps the most common is emacs or xemacs (both free). It is also avilible for Win32 at http://www.gnu.org/software/emacs/windows/ntemacs.html For linux/BSD, you will most likely find it on your distributions home

utf8 and uc()

2001-06-10 Thread Dave Neill
I've gotten the following to work (after doing a Linux localedef command for fi_FI - finnish) and am now trying to achieve some knowledge of how to do manipulations/matchings using the utf8 pragma. The locale test reads: #!/usr/bin/perl -w use POSIX; use locale; $loc = POSIX::setlocale( &POSIX

Re: Archive old files

2001-06-10 Thread Peter Scott
At 03:10 PM 6/10/2001 -0400, Tim Musson wrote: >Anyway, the requirement is to move all files older > than a specified age to another root folder while retaining the > entire directory structure. > > For example: > p: = d:\users\User1\WinNT\System32\notepad.exe > We want to move it to >

Re: CGI parser and stuff

2001-06-10 Thread Bruno Veldeman
> > What does mc use for its editor? It's probably using one of the editors > that come with Linux. > > No clue, it seems it has something like joe, vi or vim, but I am not sure. :-{ I use it because it is quick for browsing trough directories. I normaly open 3 to 5 tty's with mc in them so I

Re: CGI parser and stuff

2001-06-10 Thread bmccoy
On Sun, 10 Jun 2001, Bruno Veldeman wrote: > I normaly open 3 to 5 tty's with mc in them so I can cut and paste > between the files with ctrl-insert and shift-insert. The sixth tty I > use for running the scripts (and get blown away by endless errors and > warnings) :-) This is the closest I got

Re: CGI parser and stuff

2001-06-10 Thread Rolf
Bruno Veldeman wrote: > > > > What does mc use for its editor? It's probably using one of the editors > > that come with Linux. > > > > > > No clue, it seems it has something like joe, vi or vim, but I am not sure. > :-{ > afaik, on Linux, mc has it's own editor, called 'mcedit', which is invok

Perl Scope Question

2001-06-10 Thread Charles Lu
When I run the following code with the Warning flag I get the following message: Variable "%hash" will not stay shared Here is my code: #trying to sort a Hash by Value use strict; my @list = ('apple',12, 'peach', 2, 'pear', 45); &function_one(@list); sub function_one { my %hash = @_;

Re: Perl Scope Question

2001-06-10 Thread Karen Cravens
On 10 Jun 2001, at 23:37, Charles Lu wrote: >my @newhash = sort {$hash{$a} <=> $hash{$b}} keys %hash; It's not quite an answer to your question, but I'm curious why you nested the subroutine instead of just writing it like this? -- Karen J. Cravens ([EMAIL PROTECTED])

Re: Perl Scope Question

2001-06-10 Thread iansmith
On Sun, 10 Jun 2001, Charles Lu wrote: > When I run the following code with the Warning flag I get the following > message: > > Variable "%hash" will not stay shared This can be a dangerous situation. Perl is complaining because of the nested subroutine. The dangerous part is that it that t

Re: Perl Scope Question

2001-06-10 Thread Karthik Krishnamurthy
with use strict and use warnings putting the hash outside function_one as a lexical or global both seem to work. Even making the hash inside function_one a global seems to generate a warning if use warning is in effect. so putting a function inside another seems to be no different from have it ou

Re: Perl Scope Question

2001-06-10 Thread Paul Dean
hya, On Mon, 11 Jun 2001, Charles Lu wrote: > > When I run the following code with the Warning flag I get the following > > message: > > > > Variable "%hash" will not stay shared > > > > Here is my code: > > > > #trying to sort a Hash by Value > > use strict; my($var, @list, %hash); sub fu

Re: Perl Scope Question

2001-06-10 Thread iansmith
On Sun, 10 Jun 2001, Charles Lu wrote: > Variable "%hash" will not stay shared I forgot to mention a few little details.. so here is your example code with the corrections to get rid of the unsharing problem. use strict; my @list = ('apple',12, 'peach', 2, 'pear', 45); &function_one(@list);