Re: Can you make it use one or more less vars?

2002-06-11 Thread Sudarsan Raghavan
Elias Assmann wrote: > On Tue, 11 Jun 2002, Jeff 'japhy' Pinyan wrote: > > > modifies the ACTUAL argument you passed to rcsname()? Only if you had > > done > > > > sub rcsname { > > $_[0] =~ s/foo/bar/; > > } > > or some other specific effort would you have modified the argument to the >

Re: Can you make it use one or more less vars?

2002-06-11 Thread Elias Assmann
On Tue, 11 Jun 2002, Jeff 'japhy' Pinyan wrote: > modifies the ACTUAL argument you passed to rcsname()? Only if you had > done > > sub rcsname { > $_[0] =~ s/foo/bar/; > } > or some other specific effort would you have modified the argument to the > function. So Perl passes subroutine a

Re: taking a line with ; and surrounding it with %22

2002-06-11 Thread Sudarsan Raghavan
Tara Calishain wrote: > three mice > > While some of the lines have semicolons: > > three;mice > > For the semicolon'd lines, I need to remove the semicolons and > surround them with %22, like so: > > %22three mice%22 Loop through all the lines (assuming the line is in $str) and ad this line $s

taking a line with ; and surrounding it with %22

2002-06-11 Thread Tara Calishain
I have a program that processes a file of lines. It takes one line at a time and Does Things. Some of the lines are plain: three mice While some of the lines have semicolons: three;mice For the semicolon'd lines, I need to remove the semicolons and surround them with %22, like so: %22three

Re: LWP post fails

2002-06-11 Thread bob ackerman
On Tuesday, June 11, 2002, at 03:02 PM, David T-G wrote: > Bob -- > > ...and then bob ackerman said... > % > % i am trying to login to DI-704 DLink router. > > Why was this in the "killing idle users" thread instead of in your > "get external IP from D-Link router" thread? It makes it tough to

Re: get external ip from D-Link router

2002-06-11 Thread bob ackerman
On Tuesday, June 11, 2002, at 10:55 PM, Todd Wade wrote: > Right, but is the document you are trying to get the ip from called > status.htm? i have changed my strategy since then. the python posted to the /cgi- bin/logi file first to login. then called the status.htm to get data. again, i say,

Re: chop off 1 white space?

2002-06-11 Thread ahammell
To all who answered my question, thank you very much. It was quite a help. The idea was to remove the trailing white space character permanently. I think I have enough to go on from here. Thank you again. Al Mark Anderson wrote: > > > But, could someone explain the meaning of the "$" in the abo

Re: get external ip from D-Link router

2002-06-11 Thread Todd Wade
"Bob Ackerman" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> my $req = HTTP::Request->new(GET => 'http://192.168.0.1/status.htm'); > > > > The line above will work to fetch a document from a linksys BEFSR41 and > > the > > like. Are you sure thats right f

Clearing Idle User login sessions - Re: Killing Idle Users

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 12:23 , Akens, Anthony wrote: > The line > my @inputP = qx!ps -e |grep $port!; > I love this discussion but folks why not try, oh my @inputP =qx!ps -t $port'; Or what if we just pulled in the procTable ONCE, oh, I don't know, maybe into a Hash... ht

Re: it works but is this right

2002-06-11 Thread Todd Wade
A Taylor wrote: > howdy all, > I was wondering if you could help me, I have a perl script that executes a > SQL statement: > > 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' > > This returns many records but all i am interested in is the highest rank > hence the 'ORDER BY prop_rank DESC'.

Re: Killing Idle Users

2002-06-11 Thread Jeff
Why can't you just put export TMOUT=3600 readonly TMOUT in /etc/profile ? If it doesn't work, contact the vendor (IBM for AIX) for a patch. --- "Akens, Anthony" <[EMAIL PROTECTED]> wrote: > Hello, > I'm a sys-admin on an AIX (4.3) machine, and I'm trying to work > with a vendor progra

Re: Checking environment variables...outputting to file

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 09:14 , phumes1 wrote: > This way if someone runs the script from a command prompt I output it to > the screen using >CON: and if its run from a web browser then I redirect > it to a file and then read that file to the browser after completion > using >output.txt

Re: hidden stdin??

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 01:31 , learn perl wrote: > here's my code > > #code begins# > $i=-1; > do{ > $i++; > print 'please enter password: '; > chomp($input=); > }until (!$i); > > #end code# the do{...}until is not really useful unless you were planning to check the old

Re: it works but is this right

2002-06-11 Thread A Taylor
thanks everyone - a lot of help and I have learned loads ;-) >SELECT MAX(prop_rank)... >"A Taylor" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > howdy all, > > I was wondering if you could help me, I have a perl script that executes >a > > SQL statement:

Re: LWP post fails

2002-06-11 Thread David T-G
Bob -- ...and then bob ackerman said... % % i am trying to login to DI-704 DLink router. Why was this in the "killing idle users" thread instead of in your "get external IP from D-Link router" thread? It makes it tough to follow what you're doing, not to mention distracting... It looks like y

installation problems with CPAN

2002-06-11 Thread Angshuman Guin
I am getting these kind of message when I'm trying to install some packages on my machine with Windows 2000 Professional on it. Could someone suggest any solutions. Thanks in advance -AG- cpan> install Tcl Running install for module Tcl Running make for M/MI/MICB/Tcl-b2.tar.gz Is already unwra

Re: hidden stdin??

2002-06-11 Thread Janek Schleicher
Learn Perl wrote at Tue, 11 Jun 2002 22:31:31 +0200: > Hi guys, I am writing a script where a user is prompted for password. However, I do >not wish to > have the program display his/her password. Is there a way to do this? > Have a look to the Term::ReadKey module. use Term::ReadKey; ReadM

RE: chop off 1 white space?

2002-06-11 Thread Mark Anderson
> But, could someone explain the meaning of the "$" in the above expression, > s/\s$// . The $ looks for end of line/end of string. This is expression is saying take the whitespace character followed by end of line and replace it with nothing. If there is no whitespace character at the end of t

Re: Putting values into hash

2002-06-11 Thread Janek Schleicher
Anders Holm wrote at Tue, 11 Jun 2002 15:39:34 +0200: > Hi folks! > > Well, here's one I'm just not getting to grips with. > > I'm parsing a configuration file for an application, and it has a parameter as such: > > Parameter=Value1 Value2 Value3 \ > Value4 Value5 Value6 \ >

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
^ -> Beginning o the string $ -> End of the string $myVar =~ s/^\s+//; -> Remove all Leading White Space $myVar =~ s/\s+$//; -> Remove all Trailing White Space What is your actual requirement ?? -Original Message- From: Alaric Joseph Hammell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, J

Re: chop off 1 white space?

2002-06-11 Thread Alaric Joseph Hammell
At 01:34 PM 6/11/02 -0700, I wrote: >At 04:26 PM 6/11/02 -0400, Alaric Joseph Hammell wrote: > >>How would I get rid of one trailing white space character in >>$HASH{$key} and reassign the result > >If you're certain that the last character is a space: > > chop $HASH{$key}; > >If it might

Re: Placing Variable in "Open" function

2002-06-11 Thread Janek Schleicher
Michael Norris wrote at Tue, 11 Jun 2002 22:30:25 +0200: > I'm trying to place a variable in the spot of an argument when exectuting a command >with "open." > Here's what I'm trying to do. > > open(COMMAND,"home/usr/usrname command $argument|"); > while () > print "$_"; #print outpu

LWP post fails

2002-06-11 Thread bob ackerman
i am trying to login to DI-704 DLink router. i have python code that works. i want to do it in perl. the params below come from the python code. i get a 'Failed to login' when i run the code below. use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = HTTP::Request->new(POST => 'http://192.

Re: chop off 1 white space?

2002-06-11 Thread Peter Scott
At 01:34 PM 6/11/02 -0700, I wrote: >At 04:26 PM 6/11/02 -0400, Alaric Joseph Hammell wrote: > >>How would I get rid of one trailing white space character in >>$HASH{$key} and reassign the result > >If you're certain that the last character is a space: > > chop $HASH{$key}; > >If it might

Re: hidden stdin??

2002-06-11 Thread Peter Scott
At 01:31 PM 6/11/02 -0700, learn perl wrote: >Hi guys, I am writing a script where a user is prompted for password. >However, I do not wish to have the program display his/her password. Is >there a way to do this? Yes, you type "perldoc -q password". Here's what happens: $ perldoc -q password

Re: chop off 1 white space?

2002-06-11 Thread Peter Scott
At 04:26 PM 6/11/02 -0400, Alaric Joseph Hammell wrote: >How would I get rid of one trailing white space character in >$HASH{$key} and reassign the result If you're certain that the last character is a space: chop $HASH{$key}; If it might not be a space, and you only want to get rid o

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
oopsfor one you do $HASH{$key} =~ s/\s$//; -Original Message- From: Shishir K. Singh Sent: Tuesday, June 11, 2002 4:31 PM To: Alaric Joseph Hammell; [EMAIL PROTECTED] Subject: RE: chop off 1 white space? Is it only one Trailing white space or any trailing white space?? If any

hidden stdin??

2002-06-11 Thread learn perl
Hi guys, I am writing a script where a user is prompted for password. However, I do not wish to have the program display his/her password. Is there a way to do this? here's my code #code begins# $i=-1; do{ $i++; print 'please enter password: '; chomp($input=); }until (!$i); #end co

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
Is it only one Trailing white space or any trailing white space?? If any trailing white space , then you can do $HASH{$key} =~ s/\s+$//; If One ... $HASH{$key} =~ s/\s+$//; And then you can compare if ($HASH{$key} eq $myVariable) { } -Original Message- From: Alaric Joseph Ha

Placing Variable in "Open" function

2002-06-11 Thread Michael Norris
I'm trying to place a variable in the spot of an argument when exectuting a command with "open." Here's what I'm trying to do. open(COMMAND,"home/usr/usrname command $argument|"); while () print "$_"; #print output It's not accepting the $argument variable i'm putting in. __

chop off 1 white space?

2002-06-11 Thread Alaric Joseph Hammell
How would I get rid of one trailing white space character in $HASH{$key} and reassign the result OR how would I match a variable with 1 trailing white space to a variable that has no trailing white space character? Thanks, Al -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

RE: Killing Idle Users

2002-06-11 Thread Craig Moynes/Markham/IBM
So you noticed I didn't test in nearly enough :) try adding a -w to the grep for 'word grepping' (add it in both places), checking out the man page for grep may help. It was a fast hack job, it may be better to get a process list of the first, before the if statements, but I will leave that up t

Re: Killing Idle Users

2002-06-11 Thread David T-G
Tony -- ...and then Akens, Anthony said... % % Found another problem... % % The line % my @inputP = qx!ps -e |grep $port!; % is matching a bit overzealously... For instance, % if $port = pts/6 it matches (and therefore would kill) % not only processes on port pts/6, but also pts/61, pts/

Using Net::Telnet

2002-06-11 Thread Ken Hammer
Hi, I'm trying to use the Net::Telnet module to talk to a port a remote machine. There is an application on the remote machine (on a specific port) that takes a username/group as input and returns whether the user is a member of said group. No logging in is done at all. An example (done from the

RE: IP

2002-06-11 Thread James Kelty
Yes. If you are using Apache, you can just do it there. -James -Original Message- From: Thiago Ferreira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 12:39 PM To: beginners-perl Subject: IP Hi I need to control the access for some files in my httpd and I'd like to know

IP

2002-06-11 Thread Thiago Ferreira
Hi I need to control the access for some files in my httpd and I'd like to know if I can do this by knowing the IP of the computer that is requesting the file. If so, how? Thanks, Thiago.

Re: it works but is this right

2002-06-11 Thread Michael Fowler
On Tue, Jun 11, 2002 at 05:49:53PM +, A Taylor wrote: > 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' > > This returns many records but all i am interested in is the highest rank > hence the 'ORDER BY prop_rank DESC'. > I then retreive the highest rank like so: > > $rank = $sth1->fet

RE: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread Nikola Janceski
"Don't count on me for thinking today." Something my PDE professor said once in class before midterms, and that's my condition this week. > -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 3:08 PM > To: Nikola Janceski > Cc: phumes1

RE: Killing Idle Users

2002-06-11 Thread Akens, Anthony
Found another problem... The line my @inputP = qx!ps -e |grep $port!; is matching a bit overzealously... For instance, if $port = pts/6 it matches (and therefore would kill) not only processes on port pts/6, but also pts/61, pts/62 etc. Is there a better way to limit that? Tony Akens [EM

Re: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread phumes1
Where can I learn about hashes? At 01:58 PM 6/11/2002 -0500, you wrote: >Don't ask a question like this again... What you should really be asking >is where you can learn about hashes. never ask someone to do your work >for you. Anyway, here... > >print "$_ is $ENV{$_}\n" for (sort keys %ENV); >

RE: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, Nikola Janceski said: >my @allenv = map { [$_, $ENV{$_} ] } keys %ENV; > >local $" = "--"; >foreach my $env (@allenv){ > print "@{$env}\n"; >} That's a lot of work, and Philip has said he doesn't know how to use a hash. for (sort keys %ENV) { print "$_ => '$ENV{$_}'\n";

RE: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread phumes1
WHen I execute my script with the code below I get the following error: Missing $ on loop variable at runme.pl line 38. At 02:57 PM 6/11/2002 -0400, you wrote: >couldn't he do: > >my @allenv = map { [$_, $ENV{$_} ] } keys %ENV; > >local $" = "--"; >foreach my $env (@allenv){ > print "

RE: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread Felix Geerinckx
on Tue, 11 Jun 2002 18:57:46 GMT, Nikola Janceski wrote: > couldn't he do: > > my @allenv = map { [$_, $ENV{$_} ] } keys %ENV; > > local $" = "--"; > foreach my $env (@allenv){ > print "@{$env}\n"; > } Personally, I prefer print "$_--$ENV{$_}\n" for (keys %ENV); -- felix --

RE: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread Nikola Janceski
couldn't he do: my @allenv = map { [$_, $ENV{$_} ] } keys %ENV; local $" = "--"; foreach my $env (@allenv){ print "@{$env}\n"; } > -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 2:50 PM > To: phumes1 > Cc: [EMAIL PROTECTE

DBI data source for MS SQL server

2002-06-11 Thread learn perl
Sorry, I got it already. I just need to know the standard connection string for ODBC connection. Eric On Tue, 11 Jun 2002, Joe Raube wrote: > What kind of help? What have you tried so far? > What platform are you running Perl on? > > More info would be helpful... > > -Joe > > --- learn perl <[

Re: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread phumes1
I have a problem...I don't know how to use a hash. :-( At 02:50 PM 6/11/2002 -0400, you wrote: >On Jun 11, phumes1 said: > > >How can fetch all the environment variables and print them to the screen? > >The %ENV hash holds all the environment variables. > >If you know how to use a hash, you can

Re: FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, phumes1 said: >How can fetch all the environment variables and print them to the screen? The %ENV hash holds all the environment variables. If you know how to use a hash, you can display all the environment variables. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.po

RE: Killing Idle Users

2002-06-11 Thread Akens, Anthony
Thanks! The only thing I saw to change was the line if ( $idle =~ /^\d+$/ && $idle > 0 ) to if ( $idle =~ /^\d+$/ && $idle > $USER_IDLE ) I'm going to do some testing to be safe, but will probably put this in place soon - and the great part is that I understand *most* of it! Tony Akens [EMAIL

FETCHING ENVIRONMENT VARIABLES

2002-06-11 Thread phumes1
Hi, How can fetch all the environment variables and print them to the screen? +---+ Philip Humeniuk [EMAIL PROTECTED] [EMAIL PROTECTED] +-

Re: DBI data source for MS SQL server

2002-06-11 Thread Joe Raube
What kind of help? What have you tried so far? What platform are you running Perl on? More info would be helpful... -Joe --- learn perl <[EMAIL PROTECTED]> wrote: > Hi folks, > > Need help with the connection data source for MS SQL server. > > Thanks > > Eric > > > -- > To unsubscribe, e-

DBI data source for MS SQL server

2002-06-11 Thread learn perl
Hi folks, Need help with the connection data source for MS SQL server. Thanks Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: it works but is this right

2002-06-11 Thread Dave K
Uh,... no (atleast IMHO) SELECT MAX(prop_rank)... would be a more efficient approach HTH "A Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > howdy all, > I was wondering if you could help me, I have a perl script that executes a > SQL statement: > > 'SELE

Re: it works but is this right

2002-06-11 Thread Christopher Solomon
On Tue, 11 Jun 2002, A Taylor wrote: > > $rank = $sth1->fetchrow_array(); > > Now, my question is this: is this the right way to retreive just 1 record, > using fetchrow_array(); ??? or is there a more acceptable way. This does > work, its just the 'array()' part is making me a little uneasy. >

RE: Killing Idle Users

2002-06-11 Thread Craig Moynes/Markham/IBM
Something like this perhaps ?: #!/usr/bin/perl -w use strict; my $USER_IDLE = 40; my @input = qx!w -l!; shift @input; shift @input; foreach my $entry ( @input ) { my ($user, $port, undef, $idle) = split('\s+', $entry); if ( $idle =~ /^\d+$/ && $idle > 0 ) {

Re: Checking environment variables...outputting to file

2002-06-11 Thread phumes1
OK...thanks for all the great examples but because I'm running either manually from a command prompt our from a batch file via web browser they are both being executed as a command prompt. This is how ColdFusion sees it. SoI have a batch file with the following line. Note: The runme.exe i

it works but is this right

2002-06-11 Thread A Taylor
howdy all, I was wondering if you could help me, I have a perl script that executes a SQL statement: 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' This returns many records but all i am interested in is the highest rank hence the 'ORDER BY prop_rank DESC'. I then retreive the highest ra

Re: About Image

2002-06-11 Thread Jenda Krynicky
> I have the following code, which can port 1 image to browser, > when I use Sambar Server for Win32 System. > > > #!C:\perl\bin\perl.exe > > print "Content-type: image/jpeg\r\n\r\n"; > $| = 1; > open (FILE, 'C:/my/param/image.jpg'); > binmode (FILE) ; binmode(STDOUT); > while () { print $_ }

RE: Killing Idle Users

2002-06-11 Thread David . Wagner
Here is the site for Dave Roth and his sys admin via Perl: http://www.roth.net/ Wags ;) -Original Message- From: Akens, Anthony [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:14 To: [EMAIL PROTECTED] Subject: RE: Killing Idle Users Here's the shell script,

Re: Checking environment variables...outputting to file

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 09:58 , phumes1 wrote: > Weird. > > I put the below lines in my perl script and ran it from the command > prompt and from a web browser yet the results are telling me > that "You have started this script from the command prompt" > > Why? > > Is the HTTP_USER_AGENT

RE: Killing Idle Users

2002-06-11 Thread Akens, Anthony
Here's the shell script, for those interested. Sorry for the lack of comments, but it's not to hard to figure out with a little patience... --- PTS=`w -l | grep pts | cut -c10-15` echo "" >> /home/danb/killemresults RIGHTNOWDATE=`date` echo $RIGHTNOWDATE >> /home/danb/killemresults echo

RE: Killing Idle Users

2002-06-11 Thread Todd_Hemsell
I am not in a position to offer advice but would love to see it . -Original Message- From: Akens, Anthony [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:48 AM To: [EMAIL PROTECTED] Subject: Killing Idle Users Hello, I'm a sys-admin on an AIX (4.3) machine, and I'm trying

Re: Checking environment variables...outputting to file

2002-06-11 Thread phumes1
Hang on...I have a batch file that is being executed. In the batch file contains my perl script that I'm executing so the below does work. If anyone is familiar with Allaire Cold FUsion I'm using the Hi, > >There should be many ENV that would only be set if you are using a >browser, but >one of

Fwd: Re: Checking environment variables...outputting to file

2002-06-11 Thread phumes1
Weird. I put the below lines in my perl script and ran it from the command prompt and from a web browser yet the results are telling me that "You have started this script from the command prompt" Why? Is the HTTP_USER_AGENT check not correct? >Date: Tue, 11 Jun 2002 18:35:16 +0200 (METDST)

Re: Checking environment variables...outputting to file

2002-06-11 Thread David vd Geer Inhuur tbv IPlib
Hi, There should be many ENV that would only be set if you are using a browser, but one of them might be HTTP_USER_AGENT. Here is a tested example : # if($ENV{'HTTP_USER_AGENT'}) { print "Content-type: text/html\n\n"; print " You are using a browser"; } else { print "You have started t

windows, parameters and globbing (was Re: passing an empty string to a perl script via command line)

2002-06-11 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > On Tuesday, June 11, 2002, at 07:12 , Jenda Krynicky wrote: > > From: Bob Showalter <[EMAIL PROTECTED]> > >> The parsing of the command line and preparation of the argument > >> list is a function of the shell or command interpreter. Perl just > >>

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Bryan R Harris
Oh, thank you Bob! This has been annoying me since almost day 1 (almost 3 months now). You have lifted a great burden off my shoulders. I have a feeling I'm going to be polishing your car in the next life... =) - B __ > -Original Message- > From: Bryan R Harris [ma

Checking environment variables...outputting to file

2002-06-11 Thread phumes1
Hi, I thought of another way possibly...of doing this. Is there a way through environment variables (or someother way) to check to see if the perl script is being run via command prompt or from a browser (web interface)? This way if someone runs the script from a command prompt I output it to

About Image

2002-06-11 Thread Connie Chan
Hi all, I have the following code, which can port 1 image to browser, when I use Sambar Server for Win32 System. #!C:\perl\bin\perl.exe print "Content-type: image/jpeg\r\n\r\n"; $| = 1; open (FILE, 'C:/my/param/image.jpg'); binmode (FILE) ; binmode(STDOUT); while () { print $_ } close (FILE)

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Bob Showalter
> -Original Message- > From: Bryan R Harris [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 11:50 AM > To: [EMAIL PROTECTED] > Subject: RE: passing an empty string to a perl script via command line > > > > Interesting! It looks like my problem comes from the way I'm reading >

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Bryan R Harris
Interesting! It looks like my problem comes from the way I'm reading arguments off the command line. I've been using: $match = shift || die("Usage: rename match-expr replace-expr [filenames] \n example: rename txt html *.txt\n"); $replace = shift || die("Usage: rename match-expr replace-e

Killing Idle Users

2002-06-11 Thread Akens, Anthony
Hello, I'm a sys-admin on an AIX (4.3) machine, and I'm trying to work with a vendor program that doesn't behave very nicely. Basically, if a user's connection to the server is inappropriately severed the application keeps right on chugging, leaving the user logged in. By inappropriately sever

Thanks s/foreach/??/g

2002-06-11 Thread David vd Geer Inhuur tbv IPlib
I really have to thank you all !! I got so many replies, with hardcore answers. I need some time for that. But I really apreciate all of your excellent help ! Regs David One day, I hope to be as good as the best... One day.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: passing an empty string to a perl script via command line

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 07:12 , Jenda Krynicky wrote: > From: Bob Showalter <[EMAIL PROTECTED]> >> The parsing of the command line and preparation of the argument list >> is a function of the shell or command interpreter. Perl just takes the >> argument list given to it via

error installing a module

2002-06-11 Thread Lance Prais
I am trying to install CGI.pm-3.01 on my Solaris 2.6 ultra 5 box. Below is the install process. I am not familiar with the error ""[test_dynamic] Error 29" It dose not appear to be fatal because if I force the install everything appears to be working correctly. In everything I have read rega

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Bob Showalter
> -Original Message- > From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 10:12 AM > To: [EMAIL PROTECTED] > Subject: RE: passing an empty string to a perl script via command line > > > From: Bob Showalter <[EMAIL PROTECTED]> > > The parsing of

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Jenda Krynicky
From: Bob Showalter <[EMAIL PROTECTED]> > The parsing of the command line and preparation of the argument list > is a function of the shell or command interpreter. Perl just takes the > argument list given to it via the execve() call. This is not true under Windows. There the pr

Re: Putting values into hash

2002-06-11 Thread drieux
On Tuesday, June 11, 2002, at 06:39 , Anders Holm wrote: [..] > I'm parsing a configuration file for an application, and it has a > parameter > as such: > > Parameter=Value1 Value2 Value3 \ > Value4 Value5 Value6 \ > Value7 Value8 > > There are other parameters before

Re: Can you make it use one or more less vars?

2002-06-11 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> To: "Beginners (E-mail)" <[EMAIL PROTECTED]> Subject:Can you make it use one or more less vars? Date sent: Tue, 11 Jun 2002 09:17:38 -0400 > Can this be simplified with less variables? >

Re: Outputting to screen and file.

2002-06-11 Thread Jenda Krynicky
From: phumes1 <[EMAIL PROTECTED]> > I have a Perl script that I need to modify. Presently, its outputting > the results to the screen. Is there a way to also output the same to a > file? You might want to try Ron Wantock's Local::TeeOutput ( http://jenda.krynicky.cz/perl/TeeOut

Fwd: Re: Outputting to screen and file.

2002-06-11 Thread phumes1
Correct. I want to output to both but how? >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm >List-Post: >List-Help: >List-Unsubscribe: >List-Subscribe: >Delivered-To: mailing list

RE: Putting values into hash

2002-06-11 Thread Nikola Janceski
See inline comments: > -Original Message- > From: Tor Hildrum [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 12:01 PM > To: Perl > Subject: Re: Putting values into hash > > > > read the filein... > > > > open(FILE, $file) or die "blah blah $!"; > > undef $/; ## or local $/ i

Re: Outputting to screen and file.

2002-06-11 Thread Michael Lamertz
On Tue, Jun 11, 2002 at 06:11:21PM +0530, Ramprasad A Padmanabhan wrote: > run it on cmd-line with >perl perscriptname.pl >outputfile That doesn't work since... > >results to the screen. Is there a way to also > >output the same to a file? he obviously want's to output to *both*, the sc

Re: Outputting to screen and file.

2002-06-11 Thread Michael Lamertz
On Tue, Jun 11, 2002 at 07:58:15AM -0400, phumes1 wrote: > Hi, > > I have a Perl script that I need to modify. Presently, its outputting the > results to the screen. Is there a way to also > output the same to a file? Here's a possible solution you can use for starters: http://archive.devel

Re: s/foreach/??/g

2002-06-11 Thread Sudarsan Raghavan
David vd Geer Inhuur tbv IPlib wrote: > Hi Sudarsan, > > Sorry forgot to mention that : > > $pwuser = ($ENV{'REMOTE_USER'}); ## Apache var > > $groupfile is the group-file apache uses to authenticate. Unfortunetly there is > no such thing as : > > $group = ($ENV{'REMOTE_GROUP'}); > > The

Re: s/foreach/??/g

2002-06-11 Thread Felix Geerinckx
on Tue, 11 Jun 2002 13:17:57 GMT, [EMAIL PROTECTED] (David Vd Geer Inhuur Tbv Iplib) wrote: > I am currently almost done with my current job. > As I am reviewing my scripts the foreach-loop started to anoy me. > > I am afraid this is slowing down the script. Does anyone know a > faster way to d

Re: s/foreach/??/g

2002-06-11 Thread Janek Schleicher
David Vd Geer Inhuur Tbv Iplib wrote at Tue, 11 Jun 2002 15:17:57 +0200: > Hi, > > I am currently almost done with my current job. > As I am reviewing my scripts the foreach-loop started to anoy me. It should not be the only thing, but let's talk about it later. > > I am afraid this is slowin

Re: s/foreach/??/g

2002-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, David vd Geer Inhuur tbv IPlib said: >open(FH, "< $groupfile"); >@usrs = ; >close FH; > > $htusr = (grep {/htuser: /} @usrs)[0] ; > $phi = (grep {/phil: /} @usrs)[0] ; > $al = (grep {/all: /} @usrs)[0] ; That looks wasteful to me. You're looping over the data FOUR[1] times, instead o

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Anders Holm
Hi Bob. Well, all I can now say is "DOH!". Oooppsie, my mistake.. ;) Too green on this yet.. Thanks for clearing up my confusions! Cheers! Best Regards Anders Holm Critical Path Technical Support Engineer -- Tel USA/Canada: 1

Re: Can you make it use one or more less vars?

2002-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, Nikola Janceski said: >Can this be simplified with less variables? > >sub rcsname { >my $file = shift; >(my $rcsfile = $file) =~ s{somepattern}{andsubstitution}; >return $rcsfile; >} > >### remember that the original arguement CANNOT be affected. What makes you think that: sub rcsn

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Bob Showalter
> -Original Message- > From: Anders Holm [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 8:46 AM > To: Ramprasad A Padmanabhan; [EMAIL PROTECTED] > Subject: RE: passing an empty string to a perl script via command line > > > And, for completeness: > > I'd think that it's not *

Re: Putting values into hash

2002-06-11 Thread Tor Hildrum
> read the filein... > > open(FILE, $file) or die "blah blah $!"; > undef $/; ## or local $/ if in a BLOCK > $contents = ; > close FILE; > > $contents =~ s/\\\n//g; # put everything on one line (deletes \ followed by > newline) > > foreach (split /\n/, $contents){ > ## you can figure this part

Re: s/foreach/??/g

2002-06-11 Thread David vd Geer Inhuur tbv IPlib
Hi Sudarsan, Sorry forgot to mention that : $pwuser = ($ENV{'REMOTE_USER'}); ## Apache var $groupfile is the group-file apache uses to authenticate. Unfortunetly there is no such thing as : $group = ($ENV{'REMOTE_GROUP'}); Therefor I have to open the file manualy and set it's $group

RE: Putting values into hash

2002-06-11 Thread Nikola Janceski
read the filein... open(FILE, $file) or die "blah blah $!"; undef $/; ## or local $/ if in a BLOCK $contents = ; close FILE; $contents =~ s/\\\n//g; # put everything on one line (deletes \ followed by newline) foreach (split /\n/, $contents){ ## you can figure this part out righ

Re: s/foreach/??/g

2002-06-11 Thread Sudarsan Raghavan
David vd Geer Inhuur tbv IPlib wrote: > Hi, > > I am currently almost done with my current job. > As I am reviewing my scripts the foreach-loop started to anoy me. > > I am afraid this is slowing down the script. Does anyone know a faster way to > do the following : > > # -- > open(FH, "< $gr

Putting values into hash

2002-06-11 Thread Anders Holm
Hi folks! Well, here's one I'm just not getting to grips with. I'm parsing a configuration file for an application, and it has a parameter as such: Parameter=Value1 Value2 Value3 \ Value4 Value5 Value6 \ Value7 Value8 There are other parameters before and after

s/foreach/??/g

2002-06-11 Thread David vd Geer Inhuur tbv IPlib
Hi, I am currently almost done with my current job. As I am reviewing my scripts the foreach-loop started to anoy me. I am afraid this is slowing down the script. Does anyone know a faster way to do the following : # -- open(FH, "< $groupfile"); @usrs = ; close FH; $htusr = (grep {/htuse

Can you make it use one or more less vars?

2002-06-11 Thread Nikola Janceski
Can this be simplified with less variables? sub rcsname { my $file = shift; (my $rcsfile = $file) =~ s{somepattern}{andsubstitution}; return $rcsfile; } ### remember that the original arguement CANNOT be affected. Nikola Janceski I have great faith in fools; My friends call it self-confidence.

Re: Outputting to screen and file

2002-06-11 Thread phumes1
I tried the below but the output file was not created. The Perl script has open(STDOUT,"> NUL:); open(STDERR,"> NUL:); open(F,"> CON:); select(F);$|=1; . Should the code below be above or inside the "open"? Also, what does the line "select(F)..." do? > You want to use something call

RE: Outputting to screen and file.

2002-06-11 Thread Nikola Janceski
if you are on UNIX there is a program called tee that outputs both to screen and file: perl perscriptname.pl | tee outputfile > -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 8:41 AM > To: [EMAIL PROTECTED] > Subject: Re: Out

RE: passing an empty string to a perl script via command line

2002-06-11 Thread Anders Holm
And, for completeness: I'd think that it's not *nix that ignores the "", but rather Perl says that the variable that you assign the value to would then be undefined and just refuses to work with it. - use strict; should give you a warning about that. Best Regards Anders Holm Critical Path Tec

  1   2   >