RE: Checking to see if $user exists in a hash.

2001-11-26 Thread Wagner-David
if ( ! defined $users{$user} ) { # user not defined within the %users hash } Wags ;) -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Monday, November 26, 2001 22:59 To: [EMAIL PROTECTED] Subject: Checking to see if $user exists in a hash. Hey all, I hav

Checking to see if $user exists in a hash.

2001-11-26 Thread Daniel Falkenberg
Hey all, I have just created the hash that looks like this %users = ( 'uucp' => '14', 'daemon' => '2', 'daniel' => '45', 'test2' => '45', 'halt' => '0', 'test4' => '45' ); $user = "test4"; Now here I want to see if

RE: unique values

2001-11-26 Thread Wagner-David
One way: #!perl -w @list=(word1,word2,word1,WORD1,word3); my %MyUniqueHash = (); foreach ( @list ) { $MyUniqueHash{lc($_)} = 1; } foreach (sort keys %MyUniqueHash) { print "$_\n"; } Output: word1 word2 word3 Wags ;) -Original Message- From: Bart Schelstraete [mailto:[E

shell or perl ??

2001-11-26 Thread nafiseh saberi
hi all. we can write shell script in perl source. but which of them is better ?? e.g: for build directory.. we can write perl code and use shell script. which of them is better ?? in speed ?? or any condition? thx. Nafiseh Saberi

unique values

2001-11-26 Thread Bart Schelstraete
Hello beginners-list, Do somewhone know how to cut unique values from a list - ignoring the case (if possible) - with perl? For example: @list=(word1,word2,word1,WORD1,word3) and this must result in => (word1,word2,word3) Best regards, Bart mailto:[E

Split

2001-11-26 Thread Daniel Falkenberg
Hey all, I have a problem here that I don't really know how to go about. Basically I want to be able to find a user in the /etc/passwd with only a GID of 45 and a username of what I type the user name to be. test5:x:503:503::/home/tunnel:/bin/bash test:x:504:45:Test Account:/home/test:/bin/fal

Re: File System Sizes....

2001-11-26 Thread Mark Symonds
- Original Message - From: "James Kelty" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 26, 2001 2:17 PM Subject: File System Sizes > Hello! > > I am new to the list, so forgive me if this is not the correct forum. I am > writing (attempting to anyway) a script

Split

2001-11-26 Thread Daniel Falkenberg
Hey all, I have a problem here that I don't really know how to go about. Basically I want to be able to find a user in the /etc/passwd with only a GID of 45 and a username of what I type the user name to be. test5:x:503:503::/home/tunnel:/bin/bash test:x:504:45:Test Account:/home/test:/bin/fal

Split

2001-11-26 Thread Daniel Falkenberg
Hey all, I have a problem here that I don't really know how to go about. Basically I want to be able to find a user in the /etc/passwd with only a GID of 45 and a username of what I type the user name to be. test5:x:503:503::/home/tunnel:/bin/bash test:x:504:45:Test Account:/home/test:/bin/fal

What the heck is this code doing to me?

2001-11-26 Thread Daniel Falkenberg
Hey all! I have the following code that is doing *EXACTLY* what I want it to do and I would not have a clue why? LOL. The code was written by myself and I was only experimenting with it and testing it until I realized that it worked exactly how I wanted it to, but it wasn't ment to... :) Can any

Re: quick reg. exp. question

2001-11-26 Thread Jeff 'japhy' Pinyan
On Nov 26, Quelance said: >replace any matched spaces with   >replace a new line with Um, newline is a space. >while() { > s/\s/ /; #replace spaces with   > s/\n/\n/; #replace newlines with > print $_; > print OUTFILE $_; >} You probably want to change s/\s/ / to s/[ \t]/ /g. That do

quick reg. exp. question

2001-11-26 Thread Quelance
I've been avoiding regular expression for quite some time because they are eVil but I have no choice anymore :) Ok, as a warm up script I'm trying to get this working: replace any matched spaces with   replace a new line with while() { s/\s/ /; #replace spaces with  

RE: Any quicker way of writing the following...?

2001-11-26 Thread Daniel Falkenberg
WOW! Thanks all for your help with this one? It has helped me a great deal and now I can actually take a few lines of code off my program :) Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Any quicker way of writing the following...?

2001-11-26 Thread Michael Fowler
On Tue, Nov 27, 2001 at 10:18:23AM +1030, Daniel Falkenberg wrote: > foreach my $U (sort keys %PASS) { Why are you sorting them? As far as your code is concerned it doesn't matter what order you get them in, so it's pointless to sort it. > $PASS{$U}{'fname'} = ""; > $PASS{$U}{'lname'}

Re: Any quicker way of writing the following...?

2001-11-26 Thread Mel Matsuoka
At 10:18 AM 11/27/2001 +1030, Daniel Falkenberg wrote: >Hey all, > >Once again I feel as if the following code is far too long and can >easily be shortened. Could some one give me some ideas on doing this? > >foreach my $U (sort keys %PASS) { > $PASS{$U}{'fname'} = ""; > $PASS{$U}{'lname'}

Re: Any quicker way of writing the following...?

2001-11-26 Thread Randal L. Schwartz
> "Daniel" == Daniel Falkenberg <[EMAIL PROTECTED]> writes: Daniel> Hey all, Daniel> Once again I feel as if the following code is far too long and can Daniel> easily be shortened. Could some one give me some ideas on doing this? Daniel> foreach my $U (sort keys %PASS) { Daniel> $PASS{$U}

Thanks to everyone...

2001-11-26 Thread James Kelty
Thank you to all who replied to my mail. I basically went out, and grabbed the Filesys::DiskFree module, and incorporated it into a daemon script. Thanks so much... -James P.S. Incase anyone wants to see the finished product, take a look below. Thanks! #!/usr/bin/perl -w # Local to main thes

Any quicker way of writing the following...?

2001-11-26 Thread Daniel Falkenberg
Hey all, Once again I feel as if the following code is far too long and can easily be shortened. Could some one give me some ideas on doing this? foreach my $U (sort keys %PASS) { $PASS{$U}{'fname'} = ""; $PASS{$U}{'lname'} = ""; $PASS{$U}{'user'} = ""; $PASS{$U}{'password'

Re: Basic Questions

2001-11-26 Thread Michael Fowler
On Mon, Nov 26, 2001 at 05:54:24PM -0500, [EMAIL PROTECTED] wrote: I've modified the original email, and moved things around, for clarity. > # > #!/usr/bin/perl > use strict; > # IF I do not assign {}, nothing is printed > my($hash) = {

Re: anyone out their? HELP

2001-11-26 Thread Jonathan E. Paton
Hi, Unfortunately I don't have time tonight to answer your question in full... until someone does try reading: perldoc CGI in particular the bit about the param method, your code will end up looking like: use CGI qw(:standard); $value1 = param("value1"); $value2 = param("value2"); Also, when

Re: Basic Question on %ENV

2001-11-26 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > > Here is a basic question on %ENV hash. I gave a pronto statement as thus: > > perl -e "print $ENV{ComputerName};" > > and it printed the correct information. > > On my MS-DOS prompt when I gave the SET command, I noticed that the > environmental variable for Comput

Re: File System Sizes....

2001-11-26 Thread Jonathan E. Paton
Hi, I've just about solved the problem for you... I am obviously a student with too much time on his hands ;-) However, it is fairly complicated for a beginner example, but should be quite interesting for the more experienced "beginner" (like me :) The line with 'split' is what you are looking

Re: File System Sizes....

2001-11-26 Thread Andrea Holstein
James Kelty wrote: > > Hello! > > I am new to the list, so forgive me if this is not the correct forum. I am > writing (attempting to anyway) a script that will look at the size of the > filesystem, and warn me if it is getting too full, say 90% percent or so. > > Initially I though that combin

RE: [OT] Hello? Anyone? Like I'm off the list or something

2001-11-26 Thread Jeremy Vinding
great... all those people begging to get off the list, and now people begging to get on it :) > -Original Message- > From: Etienne Marcotte [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 26, 2001 11:39 > To: [EMAIL PROTECTED] > Subject: [OT] Hello? Anyone? Like I'm off the list or so

Re: Please answer my FAQ :) + a little enigma

2001-11-26 Thread Andrea Holstein
Etienne Marcotte schrieb: > > use strict; > > my $fd = "/foo/bar"; > > open (DIR, $fd) or die "Can't open directory: $!"; > readdir(DIR); > close(DIR); > splice(@_,0,2); #remove . and .. > foreach(@_) { > open(FILE, $fd/$_); > while () { > $_ =~ tr/KARMA1N3/N3V3RL4ND/g; # replace all KA

anyone out their? HELP

2001-11-26 Thread AMORE,JUAN (HP-Roseville,ex1)
Hello, Is anyone out there.. Can anyone write an example of perl code which will append the contents of the below URL to then be displayed via HTML to stdout... URL = candidate=Juan+Amore&position=Technician&education=Professional+Certificatio n&RESULT_FileUpload-7=&RESULT_TextArea-8=&Submit=Sub

Re: Basic Questions

2001-11-26 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > > # > #!/usr/bin/perl > use strict; > # IF I do not assign {}, nothing is printed > my($hash) = {}; > &getArray($hash); > > # IF I do not engulf array-ref within {} as @{$hash->{array}} > # an er

[OT] math puzzle

2001-11-26 Thread Jeff 'japhy' Pinyan
On Nov 26, Jeff 'japhy' Pinyan said: >>Mr.Foo: What's the age of your children Mr. Bar? >>Mr.Bar: I have 3 children, the multiplication of their ages is 36. >>Mr.Foo: This doesn't help very much. >>Mr.Bar: Well if you add their 3 ages, you get the number fo windows in >>my house. >>Mr.Foo: I know

Re: Please answer my FAQ :) + a little enigma

2001-11-26 Thread Jeff 'japhy' Pinyan
On Nov 26, Etienne Marcotte said: >open (DIR, $fd) or die "Can't open directory: $!"; >readdir(DIR); >close(DIR); >splice(@_,0,2); #remove . and .. readdir() doesn't read into @_. @files = grep $_ ne '.' && $_ ne '..', readdir DIR; >foreach(@_) { foreach (@files) { > open(FILE, $fd/$_);

Test Automation

2001-11-26 Thread Ahmed Moustafa Ibrahim Ahmed
Hi Everybody, How can I automate the process of testing my Perl script? Is there a standard way to do? Is there a tool for testing Perl scripts? Your help will be appreciated so much. Ahmed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Basic Questions

2001-11-26 Thread RArul
Friends, I would appreciate if you can throw light more on the subteleties of the following two questions:I have this code and comments for the ease of understanding my questions: # #!/usr/bin/perl use strict; # IF I do not assign {},

Please answer my FAQ :) + a little enigma

2001-11-26 Thread Etienne Marcotte
I know, this was asked 1000 times on the mailing list. The thing is I keep all emails that I find useful for my project, and delete the others. And this time I wanna do a little easy thing asked numerous time here, and I can't find a sample script. I want to replace every occurence of a word fro

[OT] Hello? Anyone? Like I'm off the list or something

2001-11-26 Thread Etienne Marcotte
I did not receive a single email from the list since this morning. And did not receive my own email sent to the list Are you reading this? Etienne -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscri

File System Sizes....

2001-11-26 Thread James Kelty
Hello! I am new to the list, so forgive me if this is not the correct forum. I am writing (attempting to anyway) a script that will look at the size of the filesystem, and warn me if it is getting too full, say 90% percent or so. Initially I though that combining the df -k output of the system

CGI Help!

2001-11-26 Thread AMORE,JUAN (HP-Roseville,ex1)
Hello Anyone; URL = candidate=Juan+Amore&position=Technician&education=Professional+Certificatio n&RESULT_FileUpload-7=&RESULT_TextArea-8=&Submit=Submit> Any examples on how to append the above string coming from a HTML URL command line so that I may display it via a STDOUT html file New to C

Re: CGI scripts security

2001-11-26 Thread Jonathan E. Paton
Hi, > I've read docs on security and I'm aware of that > all user variables should be checked before doing > something like opening a file, but can somebody > show me how example below can compromise my website? > > open(F, "/home/users/me/web/$in{'NAME'}.ext"); > What if $in{'NAME'} started wi

Basic Question on %ENV

2001-11-26 Thread RArul
Friends, Here is a basic question on %ENV hash. I gave a pronto statement as thus: perl -e "print $ENV{ComputerName};" and it printed the correct information. On my MS-DOS prompt when I gave the SET command, I noticed that the environmental variable for ComputerName to be denoted as COMPUTER

Re: Trouble installing modules with CPAN, or changing @INC

2001-11-26 Thread Elaine -HFB- Ashton
KEVIN ZEMBOWER [[EMAIL PROTECTED]] quoth: *> *>Any suggestions on cleaning up this mess? Can I just delete *>/usr/bin/perl and link it to /usr/local/bin/perl, or is there a more *>elaborate, better solution? If this is a Solaris 8 box then I'd recommend leaving /usr/bin/perl alone and adjusting y

Re: delete a line of a file

2001-11-26 Thread John W. Krahn
Jorge Goncalvez wrote: > > Hi, I would like to parse a file and delete the entire line if it begins with > subnet. > How can I do this in Perl? perl -ni -e'/^subnet/ or print' yourfile.txt Or perl -pi -e's/^subnet.*//s' yourfile.txt John -- use Perl; program fulfillment -- To unsubscrib

Re: adding a word

2001-11-26 Thread John W. Krahn
Prasanthi Tenneti wrote: > > I want to add a word at each end of the line of a file. > my file is like this > > packet1.rpm > packet2.rpm > packet3.rpm > packet4.rpm > > I want to add 'Node' word at the end of each line. > So it should be like this > packet1.rpm node > packet2.rpm node > packe

Re: cgi

2001-11-26 Thread Matija Papec
"Jon Howe" <[EMAIL PROTECTED]> wrote: >Is possible to have a cgi-perl script return the html form values + names, in the >same order in which they appearfo in the html rm supplying the post with out having >to >refer to each hash/array element. You probably have to write your own parsing rout

CGI scripts security

2001-11-26 Thread Matija Papec
I've read docs on security and I'm aware of that all user variables should be checked before doing something like opening a file, but can somebody show me how example below can compromise my website? open(F, "/home/users/me/web/$in{'NAME'}.ext"); Does something like '; rm * ;' can actually exec

Re: delete a line of a file

2001-11-26 Thread Elaine -HFB- Ashton
Jorge Goncalvez [[EMAIL PROTECTED]] quoth: *>Hi, I would like to parse a file and delete the entire line if it begins with *>subnet. *>How can I do this in Perl? http://history.perl.org/oneliners/filters/after_pattern.html e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

appending a html form file via a CGI script:

2001-11-26 Thread AMORE,JUAN (HP-Roseville,ex1)
Greetings Perl-Gurus; I'm trying to learn how to append data via the "GET" command within a HTML form used on the command line < Form Action = "/www/cgi-bin/" Method="GET"> Now the way I understand this is that after I submit data via the HTML form the GET via this command line;ie < Form Action =

RE: Trouble installing modules with CPAN, or changing @INC

2001-11-26 Thread KEVIN ZEMBOWER
You're absolutely right. The script began with "!#/usr/bin/perl" When I changed it to "/usr/local/bin/perl" the error went away. Furthermore: www:/usr/local/httpd/cgi-bin # ll /usr/bin/perl -rwxr-xr-x2 root root 775822 May 11 2001 /usr/bin/perl www:/usr/local/httpd/cgi-bin # ll /usr

RE: [Perl-unix-users] Script Help Please

2001-11-26 Thread Steve Aaron
Craig, this seems to work okay. I made a few amendments but only to add warnings and use strict. Its easier to debug typos, bad initializations etc. with warning and strict set. Give this ago #!/usr/bin/perl -w use strict; open (LISTFILE, "wuglist.txt") || die "$!\n"; open (OUTLOGFILE,

RE: regular expressions and search and replace.

2001-11-26 Thread Kris Vermeulen
Hi Bob and everyone else, Many thanks for the tip and for pointing me into the correct direction! Kris > > I want to replace every "[LINK='page.html']" with > > I just want to search for [LINK= and the matching ] and just leave > > the text in between. Is this possible using just regular expr

Net::Telnet / SPACEBAR Problem

2001-11-26 Thread Paul Kincaid
I am using Net::Telnet to gather data from a Foundry ServerIronXL during some testing we are performing, although the same will be a problem when it comes to Cisco Routers, etc... I am having the script log in, go into enable mode and run a couple show commands. Everything works except for mu

RE: Trouble installing modules with CPAN, or changing @INC

2001-11-26 Thread Bob Showalter
> -Original Message- > From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 26, 2001 11:36 AM > To: [EMAIL PROTECTED] > Subject: Trouble installing modules with CPAN, or changing @INC > > > I have a program that requires Mail::Mailer.pm. When I try to > run it, I > g

RE: regular expressions and search and replace.

2001-11-26 Thread Bob Showalter
> -Original Message- > From: Kris Vermeulen [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 26, 2001 11:26 AM > To: [EMAIL PROTECTED] > Subject: regular expressions and search and replace. > > > Hi everyone! > > Many programming languages are taking over regular expressions. > But s

Trouble installing modules with CPAN, or changing @INC

2001-11-26 Thread KEVIN ZEMBOWER
I have a program that requires Mail::Mailer.pm. When I try to run it, I get: www:/usr/local/httpd/cgi-bin # ./mail2friend.pl Can't locate Mail/Mailer.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i586-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i586-linux /usr/lib/perl5/site_perl/

RE: Outputing data for Excel / PDF

2001-11-26 Thread Crowder, Rod
Goto http://search.cpan.org and search for PDF, gives a number of modules relating to PDF files. I have not used these, so I can't make any recommendations. -Original Message- From: paul beckett (JIC) [mailto:[EMAIL PROTECTED]] Sent: 26 November 2001 15:02 To: [EMAIL PROTECTED] Subject: O

RE: delete a line of a file

2001-11-26 Thread John Edwards
open the file, create a new file, read each line of the source file, check if it starts with subnet, if not write it to the new file. When you are done, close both files, delete the source file (if you are sure your script has made the right changes), then rename the output file to the source. So

RE:delete a line of a file

2001-11-26 Thread Jorge Goncalvez
Hi, I would like to parse a file and delete the entire line if it begins with subnet. How can I do this in Perl? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

regular expressions and search and replace.

2001-11-26 Thread Kris Vermeulen
Hi everyone! Many programming languages are taking over regular expressions. But since it originated from Perl (am I correct?), I taught this would be the ideal place to drop my beginner's question. I already succeeded in replacing occurrences of some string in a complete text, but is it also po

RE: need to ouput excel / PDF file

2001-11-26 Thread Peter Hanson
Hey Paul, you can go to search.cpan.org and do a module search for Spreadsheet::WriteExcel This will let you right out excel files, works really well. As for PDF's, again if you go to search.cpan.org (this site is your best friend for finding modules) and do a module search for PDF, you should

Re: Script Help Please

2001-11-26 Thread Randal L. Schwartz
> "Craig" == Craig Sharp <[EMAIL PROTECTED]> writes: Craig> my %servers; (This is defining a hash?) Craig> open (I understand) Craig> { Craig> chomp (my @temp = ); (Removing the newline from each entry) Craig> @server{ @temp } =(); (What's this do?); Craig> } It's a hash slice, which contra

RE: Tk or menu based user interface.

2001-11-26 Thread Bob Showalter
> -Original Message- > From: Dermot Paikkos [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 26, 2001 6:48 AM > To: [EMAIL PROTECTED] > Subject: Tk or menu based user interface. > > > Hi Perl gurus, > I am trying to do a smallish script that will run once users > login to a > UNIX s

RE: stoopid newbie formmail question

2001-11-26 Thread Bob Showalter
> -Original Message- > From: neill roy [mailto:[EMAIL PROTECTED]] > Sent: Saturday, November 24, 2001 8:45 PM > To: [EMAIL PROTECTED] > Subject: stoopid newbie formmail question > > > hi, i am very new to perl and cgi so please excuse this dull, stoopid > question... > > > but i'm try

RE: build directory with source code

2001-11-26 Thread Bob Showalter
> -Original Message- > From: nafiseh saberi [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 25, 2001 4:26 AM > To: [EMAIL PROTECTED] > Subject: build directory with source code > > > hi all... > would you know any info for > build directory in specific path in middle > > of sourc

Re: writing file::find results to an file

2001-11-26 Thread John W. Krahn
Ben Crane wrote: > > I'm using file::find to (obviously!) find files, but I > want the results to be placed in a text file so I can > send the paths via email to others. Could someone have > a look at this code (granted it might and is messy), > But look at all lines beginning with * (near the >

Re: Script Help Please

2001-11-26 Thread Craig Sharp
John, Thanks for the info. I am a bit confused in the first part of the script. my %servers; (This is defining a hash?) open (I understand) { chomp (my @temp = ); (Removing the newline from each entry) @server{ @temp } =(); (What's this do?); } Thanks, Craig >>> "John W. Krahn" <[EMAIL PROT

Re: Script Help Please

2001-11-26 Thread John W. Krahn
Craig Sharp wrote: > > I am lost. I have the following script that opens the log file WUGEvent.log and >looks for the > statment "UP", replaces spaces and writes out the new log file. It works great! > > Here is the problem. I need to read in another file (wuglist.txt) containing a list >of

need to ouput excel / PDF file

2001-11-26 Thread paul beckett (JIC)
I need to write some data out in two different formats: 1) As a microsoft excel file 2) As an adobe acrobat PDF file Does anybody know if there are modules that can do this? I've tried looking at http://www.cpan.org without much success. Thanks Paul -- To unsubscribe, e-mail: [EMAIL PROTECTE

RE: adding a word

2001-11-26 Thread John Edwards
Try something like this open IN, "/path/to/file.txt" or die "Can't find input file: $!"; open OUT, ">/path/to/ouput.txt" or die "Can't create output file: $!"; $add_this = " node"; while () { chomp; print OUT "$_$add_this\n"; } close IN; close OUT; -Original Message- F

adding a word

2001-11-26 Thread Prasanthi Tenneti
hi, I want to add a word at each end of the line of a file. my file is like this packet1.rpm packet2.rpm packet3.rpm packet4.rpm I want to add 'Node' word at the end of each line. So it should be like this packet1.rpm node packet2.rpm node packet3.rpm node packet4.rpm node pls help me. than

Outputing data for Excel / PDF

2001-11-26 Thread paul beckett (JIC)
I need to write some data out in two different formats: 1) As a microsoft excel file 2) As an adobe acrobat PDF file Does anybody know if there are modules that can do this? I've tried looking at http://www.cpan.org without much success Thanks Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: [Perl-unix-users] Script Help Please

2001-11-26 Thread Craig Sharp
Steve, I made the correction as follows: if (/\bUP\b/ && /$server_name/) Does not work. I also tried: if (/$server_name/) Does not work. And: if (/\b$server_name\b/) Does not work. I have checked that the variable $server_name is defined but it seems like the compare is not working. Here

RE: cgi

2001-11-26 Thread John Edwards
You could just iterate over the hash and store the results in the array. This will also allow you to add formating and extra info to the key/value pairs. E.g foreach $key(sort keys %data) { push(@data,"Field $key: Value $data{$key}\n"); } open(SENDMAIL, "|/usr/lib/sendmail")

cgi

2001-11-26 Thread Jon Howe
Is possible to have a cgi-perl script return the html form values + names, in the same order in which they appearfo in the html rm supplying the post with out having to refer to each hash/array element. An example of what I am Woking with : ## /usr/bin/perl -w use CG

RE: Script Help Please

2001-11-26 Thread Jonathan E. Paton
> Can anyone confirm if I understand this right: > > if ( $username =~ /@/ ) > { >$_ = $username; >($username) = /(.*)\@/; > } > > The part > ($username) = /(.*)\@/; > removes the @ symbol? Yes, but what if you've got two @'s? ;-) The two lines in the 'if' can be rewritten as: $us

writing file::find results to an file

2001-11-26 Thread Ben Crane
Hi, I'm using file::find to (obviously!) find files, but I want the results to be placed in a text file so I can send the paths via email to others. Could someone have a look at this code (granted it might and is messy), But look at all lines beginning with * (near the bottom) and tell me why it

RE: [Perl-unix-users] Script Help Please

2001-11-26 Thread Steve Aaron
Try if (/\bUP\b/ && /$server_name/) You are not matching on $server_name as $server_name is not enclosed by the match operator. You could easily put this in a single regular expression if the position of $server_name is predictable. e.g. It alway falls after UP. If you cannot predict where the

RE: Script Help Please

2001-11-26 Thread Scott Ryan
Can anyone confirm if I understand this right: if ( $username =~ /@/ ) { $_ = $username; ($username) = /(.*)\@/; } The part ($username) = /(.*)\@/ this removes the @ symbol ?? Does it do anything else? -Original Message- From: Craig Sharp [mailto:[EMAIL PROTECTED]] Sent: 26 Novem

Re: Perl

2001-11-26 Thread Alfred Wheeler
Active Perl is for Microsoft Windows Perl at Perl.com is more general, but basically oriented for Unix like systems. - Original Message - From: "Purshottam Chandak" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 26, 2001 2:43 AM Subject: Perl > Is there a major dif

Script Help Please

2001-11-26 Thread Craig Sharp
Hi all, I am lost. I have the following script that opens the log file WUGEvent.log and looks for the statment "UP", replaces spaces and writes out the new log file. It works great! Here is the problem. I need to read in another file (wuglist.txt) containing a list of server names and then

Re: How to get rid of the last Ip number with a regex

2001-11-26 Thread Ahmed Moustafa Ibrahim Ahmed
To do the substitution, you can do that: s/[^\.]+$/0/; I'm not sure if that what you are looking for or not. Jorge Goncalvez wrote: > Hi, I have this: > open (IPCONF,"< $_Globals{IPCONFIG}") or die "je ne peux ouvrir > $_Globals{IPCONFIG} :$!"; > @ten=; close IPCONF; > foreach(@ten){

Win32::Event why for ?

2001-11-26 Thread abhra debroy
Hello I am came across with Win32::Event Module. I wanted to know what it is about ? Can u please give an example to describe the utility of the module. I have read perl doc,but I didn't understand what it is saying. Please help Abhra __ Do You

Similira Module of Win32:: GuiTest and Setupsup in Linux ?

2001-11-26 Thread abhra debroy
Hello Is there any similar module of win32::GuiTest and Setupsup for Linux (gor Gui Testing) free or commercial one Thank You Abhra __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/

Re: Perl

2001-11-26 Thread Jenda Krynicky
From: "Purshottam Chandak" <[EMAIL PROTECTED]> > Is there a major difference between the Perl at Perl.com and Active Perl? > > Pc No. ActivePerl is just the standard Perl, compiled for Windows (and Solaris and Linux IFAIK) packed up with modules and a few more goodies as an

Perl in Linux

2001-11-26 Thread abhra debroy
Hello All Automated GUI /Functioanl Testing is possible in Win32 System by using win32::GUI Test and Setupsup Module of perl. Whether same is possible in Linux System ? If Yes how should I approach ? My application is QT supported. PLEASE HELP ME AS I NEED THIS INFORMATION DESPERATELY. Is ther

Re: @_

2001-11-26 Thread Jenda Krynicky
From: "Leon" <[EMAIL PROTECTED]> > - Original Message - > From: "Jenda Krynicky" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, November 26, 2001 4:44 AM > Subject: Re: @_ > > > When you cann a function all the parameters you gave it end up in > > @_. You

Tk or menu based user interface.

2001-11-26 Thread Dermot Paikkos
Hi Perl gurus, I am trying to do a smallish script that will run once users login to a UNIX server. I want the users to be presented with a menu of options so they can perform some tasks without giving them complete access to the system. Every where I look I see TK as the answer. So I popped a

Perl

2001-11-26 Thread Purshottam Chandak
Is there a major difference between the Perl at Perl.com and Active Perl? Pc _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Re[2]: @_

2001-11-26 Thread Leon
> does that make it any clearer? Absolutely ! now 99.9% clear except the following query ! So am I right to say that @_ is the default array, something like the default scalar $_. eg of default $_ :- @array = qw (hello world); foreach (@array) { print; ## print $_ }; Thank You !

Re:How to get rid of the last Ip number with a regex

2001-11-26 Thread Jorge Goncalvez
Hi, I have this: open (IPCONF,"< $_Globals{IPCONFIG}") or die "je ne peux ouvrir $_Globals{IPCONFIG} :$!"; @ten=; close IPCONF; foreach(@ten){ chomp(); if ($_ =~ /Adresse IP/) { $_ =~ s/.+://; push @Ip,$_; }