Re: Cgi Win xp Perl

2003-01-08 Thread Paul Johnson
R. Joseph Newton said: > The ActiveState installation on Windows totally ignores the Unix command, > treeating it as a comment. Are you sure about that? I would have expected it to parse and honour the switches, as happens for Unix, but since I don't use ActivePerl I may be mistaken. > Ken Leh

RE: Cgi Win xp Perl

2003-01-08 Thread Paul Kraus
IN LINE. FYI there are two identical scripts. count.pl and count.cgi. > let me get that straight: > if the script has a .pl extension, your browser tries to > download it even > with the '?whatever' portion append at the end No. If enter the script into the browser window as follows th

RE: Cgi Win xp Perl

2003-01-08 Thread Paul Kraus
yes I use post. > -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 07, 2003 10:01 PM > To: Paul Kraus > Cc: 'Ken Lehman'; 'Perl' > Subject: Re: Cgi Win xp Perl > > > Do you have method=POST in the action call? Without that, > many web ser

RE: How to substract words

2003-01-08 Thread Meidling, Keith, CTR, OSD-C3I
This may be oversimplified, but here's what I came up with and it worked for me... $word1="helloRed"; $word2="hello"; $word1 =~ /$word2(.+)/; print $1; This would be assuming that the word you are subtracting is at the beginning of the other word. Keith -Original Message- From: Alex

RE: Cgi Win xp Perl

2003-01-08 Thread Paul Kraus
Ok following these instructions. Now if I call a script http://localhost/path/myscript.cgi||.pl It will run the script just likes it is supposed to. When I call the scripts from a form with this command. then the pl file tries to download and the cgi file still displays the source. Where gettin

RE: Cgi Win xp Perl

2003-01-08 Thread wiggins
I believe in the new example the browser is not passing the form to any server because it is not a relative path, nor does it begin with a protocol specifier, and it recognizes C: as something it can handle. Try specifying either a relative path or using a full URL with something like http://lo

RE: Cgi Win xp Perl

2003-01-08 Thread Paul Kraus
That was it!!! Thanks. I still get an error when trying to use the -wT Do I have to add them to the command line call in the virtual directory? Instead of %s %s do I need to have -w -T? Paul > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, Jan

script looking for expression in files

2003-01-08 Thread Martin Hudec
Hello, I need to call a script which will be searching for string (posted from PHP) in all files in one directory and its subdirectories and then it will print filenames in which it found the string to STDOUT Can anyone help me please with this script? -- Best regards, Martin

Re: Debugging Problem: Phantom line numbers!

2003-01-08 Thread Christopher D . Lewis
On Tuesday, January 7, 2003, at 11:19 AM, Peter Scott wrote: [responding to replacement of sub displayResults with {print __LINE__ . " sub displayResults";}] That needs to be __LINE__, not __line__. The above is an error. You do have -w and use strict in this program, right? When I use "__LI

Re: Cgi Win xp Perl

2003-01-08 Thread R. Joseph Newton
Thanks, This demonstrates a very important point with CGI--whenever possible, one should use relative paths--and never use backslash-delimited paths in a URL, regardless of OS. Web servers will translate to the local delimiters transparently. Joseph [EMAIL PROTECTED] wrote: > I believe in th

Re: Phantom line numbers! (line numbers fixed; now, masking earlier declarations of variables??)

2003-01-08 Thread Christopher D . Lewis
On Tuesday, January 7, 2003, at 09:02 PM, Peter Scott wrote: You made a false economy by not using strict. Yes, you would have to fix those errors - mostly due to not declaring *everything* with 'my'. But to leave it out is to shoot yourself in the foot. You have managed to blow your whole le

Re: script looking for expression in files

2003-01-08 Thread John W. Krahn
Martin Hudec wrote: > > Hello, Hello, > I need to call a script which will be searching for string (posted > from PHP) in all files in one directory and its subdirectories and then > it will print filenames in which it found the string to STDOUT > > Can anyone help me please with th

Re: tailing a text file

2003-01-08 Thread zentara
On Tue, 7 Jan 2003 04:23:22 -0800 (PST), [EMAIL PROTECTED] (Admin-Stress) wrote: >Hi, > >Anyone have the fastest and efficien way to tail a text file ? > >suppose I have a text file "example.txt" and I want to print the last X lines. > Well there are alot of "ifs" to consider. How big the file is

CGI environment issues

2003-01-08 Thread Michael Ragsdale
I sent this to the DBI list, but didn't get any help. I'm not so sure it's a DBI problem, so I'm sending it here to see if perhaps someone here may be able to help me. I cannot get a script to run from a browser. I've added the ORACLE_HOME environment variable to the script, which is usually

cgi-bin.pl library

2003-01-08 Thread RAMAN KONDAPI
Hi, Could someone tell me how to add cgi-bin.pl library to my system. I have Sun Ultra with Solaris 8 ! thanks, raman __\/__ . / ^ _ \ . |\| (o)(o) |/| #---.OOOo--oo--oOOO.---# # # #

Re[2]: script looking for expression in files

2003-01-08 Thread Martin Hudec
Hello John, thanks a lot, now i can move further :))) -- Best regards, Martin mail [EMAIL PROTECTED] mobile +421.907.303.393 icq34358414 wwwhttp://www.corwin

Re: Debugging Problem: Phantom line numbers!

2003-01-08 Thread John W. Krahn
"Christopher D . Lewis" wrote: > > On Tuesday, January 7, 2003, at 11:19 AM, Peter Scott wrote: > > > [responding to replacement of sub displayResults with {print __LINE__ > > . " sub displayResults";}] > > That needs to be __LINE__, not __line__. The above is an error. > > You do have -w and u

CGI path with spaces

2003-01-08 Thread Paul Kraus
After getting it all working I created a new virtual directory. Setup the permissions and tested everything by loading static html pages with http://localhost/path/file and it works. I then load my form call my script and I get this error. The specified CGI application misbehaved by not returning

RE: CGI path with spaces

2003-01-08 Thread Paul Kraus
Figured it out. I had to change the command to perl "%s" %s > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:46 AM > To: Perl > Subject: CGI path with spaces > > > After getting it all working I created a new virtual > directory.

String manipulation benchmark

2003-01-08 Thread Pavle Lukic
Hi I did a little benchmarking in regard to the string manipulation issue raised on this forum. Here are relevant parameters and benchmark results. Problem Given a string and a pattern, construct new string by removing part of the string equal to pattern. Remove only first occurrence of the patt

Re: Phantom line numbers! (line numbers fixed; now, masking earlier declarations of variables??)

2003-01-08 Thread John W. Krahn
"Christopher D . Lewis" wrote: > > On Tuesday, January 7, 2003, at 09:02 PM, Peter Scott wrote: > > You made a false economy by not using strict. Yes, you would have to > > fix those errors - mostly due to not declaring *everything* with > > 'my'. But to leave it out is to shoot yourself in the

Re: String manipulation benchmark

2003-01-08 Thread John W. Krahn
Pavle Lukic wrote: > > Hi Hello, > I did a little benchmarking in regard to the > string manipulation issue raised on this forum. > > Here are relevant parameters and benchmark results. > > Problem > Given a string and a pattern, construct new string > by removing part of the string equal to p

Re: Debugging Problem: Phantom line numbers!

2003-01-08 Thread John W. Krahn
"Christopher D . Lewis" wrote: > > ... and I have no idea what an explicit package name is :-) At your > request, I have placed the whole, ugly thing at > www.PuckU.org/misc/nudice-01c for inspection of why Perl thinks the > line numbers are as it reports ... I apologize in advance for the > prog

RE: String manipulation benchmark

2003-01-08 Thread Dan Muey
Perhaps too complicated if you're just replacing a few lines but if I understand this right if you're doing many lines, like say updating entries in database then this mat cut the time down considerably. Could you try to explain a little what's going on in those two examples and perhaps why th

Re: [OT]++ ATT*.DAT

2003-01-08 Thread David Eason
See http://support.microsoft.com/?kbid=241538 Controlling TNEF in Mail Messages: TNEF can be controlled in three places, and is different depending on your installation of Outlook (Internet Mail Only, or Corporate or Workgroup). Global: Changing your default mail format to Plain Text or HTML wil

Loading a module (Net::Jabber) in Perl (Windows)

2003-01-08 Thread Mark Troyer
Hi all, I just started working with Perl and am having a great time at it. Quick question regarding the loading of modules. I am running activestate perl on my XP machine. It appears that many of the modules I have looked at seem to have an install program that is based around make. The first

RE: Loading a module (Net::Jabber) in Perl (Windows)

2003-01-08 Thread Timothy Johnson
If you have Visual C++ installed, then you can use nmake to install many of the modules. Otherwise there are binary distributions of most modules that are compatible with Windows. Your best bet would be to use the PPM utility that comes with ActivePerl. -Original Message- From: Mark Tro

removing emty lines without creating a new file or array

2003-01-08 Thread Konrad Foerstner
Hi, My problem today ;) : I have a file with some unmeant empty lines and I want to remove them, without writing a new file and without storing all the content temporarily in an array. I thought about the following lines of code, but they don't do the job. open (FH, "+<$filename"); foreach (){

Re: cgi-bin.pl library

2003-01-08 Thread Jenda Krynicky
From: "RAMAN KONDAPI" <[EMAIL PROTECTED]> > Could someone tell me how to add cgi-bin.pl library to my system. I > have Sun Ultra with Solaris 8 ! cgi-bin.pl is deprecated. You shoul use CGI; Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and

Re: References ch 8 programming Perl

2003-01-08 Thread David Eason
I am not as knowledgeable about such things as you guys, but.. Isn't an anonymous array the same thing as an array literal? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Cgi Win xp Perl

2003-01-08 Thread wiggins
On Wed, 8 Jan 2003 08:41:06 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > That was it!!! Thanks. > Glad to hear it. > I still get an error when trying to use the -wT > > Do I have to add them to the command line call in the virtual director

int or float

2003-01-08 Thread Jerry Preston
Hi! I am looking for a simple way to figure out if a value is a integer or a float. How to tell the difference between 7 and 7.5. Thanks, Jerry

Re: script looking for expression in files

2003-01-08 Thread Rob Dixon
John That doesn't seem to work on my Win2K system ;-) Rob "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Martin Hudec wrote: > > > > Hello, > > Hello, > > > I need to call a script which will be searching for string (posted > > from PHP)

Re[2]: script looking for expression in files

2003-01-08 Thread Martin Hudec
Hello Rob, this was meant for linux not windows...i don't know anything like that in windows :( sorry -- Best regards, Martin mail [EMAIL PROTECTED] mobile +421.907.303.393 icq34358414

Re: int or float

2003-01-08 Thread Rob Dixon
Hi Jerry Just check for the existence of a decimal point: if ($n =~ /\./) { print "Floating point\n" } else { print "Integer\n" ); ( This will work even if you have assigned $n = 7.000, but assumes that $n is at least numeric and isn't so large or small that it's in scientific notation )

Re: Matt's search script

2003-01-08 Thread David Eason
Great link! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
Hi Konrad Try: perl -p -i -e "redo if /^\s*$/" file.ext which will remove all lines consisting only of whitespace. Cheers, Rob "Konrad Foerstner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > My problem today ;) : I have a file with some unmea

RE: removing emty lines without creating a new file or array

2003-01-08 Thread NYIMI Jose (BMB)
> -Original Message- > From: Konrad Foerstner [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 5:25 PM > To: [EMAIL PROTECTED] > Subject: removing emty lines without creating a new file or array > > > Hi, > > My problem today ;) : I have a file with some unmeant empty > l

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Timothy Johnson
Except that it will essentially create a new file. Why did you want to avoid writing a new file? As far as I know, you can't just "erase" data in the middle of a file. That's just not how they work. Someone correct me if I'm wrong. As far as I know, any program that does this rewrites the fil

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
Ah, now that depends on what you call a 'new file'! I imagine Konrad just wanted to avoid the tedium of creating the new corrected file, deleting the old one and then renaming it. I guess it could be so big that it fills up more than half of the disk drive. I'm sure we'll find out. Cheers,

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Dan Muey
The only thing I know of that will change the curretn file is a combonation of som eunix commands like This takes three lins but I seem to remember doing it in one. Test it out on the command line and if you can get it to do what you want just do that command in backticks : print `cat `;

Re: Phantom line numbers! (line numbers fixed; now, masking earlier declarations of variables??)

2003-01-08 Thread Rob Dixon
"John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > my @rawRollArray = roll(@currentRollRequest); # produces raw roll array > > from roll request array > > while @rawRollArray { >^^^ > You are missing the parenthesis around th

Re: Re[2]: script looking for expression in files

2003-01-08 Thread Rob Dixon
Joking!! I was hinting that a Unix solution to a Perl question isn't Proper, even if it was exactly what you wanted! And no, there isn't anything like grep under Windows, except that most of the Unix utils have been ported in a fashion. Rob "Martin Hudec" <[EMAIL PROTECTED]> wrote in message [

Re: References ch 8 programming Perl

2003-01-08 Thread Randal L. Schwartz
> "David" == David Eason <[EMAIL PROTECTED]> writes: David> I am not as knowledgeable about such things as you guys, but.. David> Isn't an anonymous array the same thing as an array literal? No. :-) Well, for one thing, there's no such thing as an array literal. So that's like saying "aren'

Re: References ch 8 programming Perl

2003-01-08 Thread John W. Krahn
"Randal L. Schwartz" wrote: > > (In the past week, I just finished writing this stuff up for my next > book... see the bookshelves in six months or so.) Does it have a title yet? Will there be an animal on the cover? :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMA

Re: int or float

2003-01-08 Thread John W. Krahn
Jerry Preston wrote: > > Hi! Hello, > I am looking for a simple way to figure out if a value is a integer or a > float. How to tell the difference between 7 and 7.5. $ perl -le' for ( 7, 5.9 ) { print "$_ is an integer" if $_ == int; } ' 7 is an integer Also have a look at this FAQ:

Re: References ch 8 programming Perl

2003-01-08 Thread David Eason
Great explanation as usual, sir. I am looking forward to reading your next book, and good luck with everything. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: script looking for expression in files

2003-01-08 Thread John W. Krahn
Rob Dixon wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > > > > grep -lr "string" * > > That doesn't seem to work on my Win2K system ;-) It works fine on my Win95 system. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

forcing use of shell command over external cmd

2003-01-08 Thread HENRY,MARK (HP-Roseville,ex1)
Hi All, On windows, I have a script which calls gets the date from the system date command (using backticks) , or rather I would prefer it to. I have just installed mks toolkit on this machine which has it's own date command, and now this is the command getting chosen each time. How can I get it

RE: forcing use of shell command over external cmd

2003-01-08 Thread Dan Muey
Well if it was unix and for some reason there where two possibilies for the same command I'd use the entire path $date = `/usr/bin/date +%Y`; For windows not sure how that would work, maybe $date = `c:\path/to/cmd.exe date`; Perhaps, though like I said I'm not sure, I really hate windows and a

RE: forcing use of shell command over external cmd

2003-01-08 Thread Kipp, James
take a look at your path. the external program may have changed it. if so you can change the path back so the win32 directories come first to see your path type: echo %PATH% check your help on how to change the path, it is a bit different between win32 os's > -Original Message- > From: HEN

RE: forcing use of shell command over external cmd

2003-01-08 Thread HENRY,MARK (HP-Roseville,ex1)
Dan & Kipp, Thanks for the help. Dan, looks like that was the thing to do, passing an arg to cmd. Kipp, I tried the path stuff but it wouldn't fly.. Thanks guys! Mark > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 10:27 AM > To: HE

RE: forcing use of shell command over external cmd

2003-01-08 Thread Kipp, James
reboot after you change your path. what windows OS are you using ? > -Original Message- > From: HENRY,MARK (HP-Roseville,ex1) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 1:40 PM > To: 'Dan Muey'; HENRY,MARK (HP-Roseville,ex1); [EMAIL PROTECTED] > Subject: RE: forcing use

Re: References ch 8 programming Perl

2003-01-08 Thread david
Randal L. Schwartz wrote: > > (In the past week, I just finished writing this stuff up for my next > book... see the bookshelves in six months or so.) > is the book going to be focus to a certain topics (such as reference, OO, etc) in Perl or is it going to be a general one? david -- To uns

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
Timothy Johnson wrote: > Except that it will essentially create a new file. Why did you want > to avoid writing a new file? As far as I know, you can't just > "erase" data in the middle of a file. That's just not how they work. > Someone correct me if I'm wrong. As far as I know, any program th

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Under w2k I was unable to do an inline update without some type of backup. Tried from command line and korn shell. If I did this: perl -p -i.plsdel -e "s/^\s*\n//" 03WorkSheet.txt which would create a copy with the name 03WorkSheet.txt.plsdel and 03WorkSheet.txt would be without the bla

Re: String manipulation benchmark

2003-01-08 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > Pavle Lukic wrote: > > Problem > > Given a string and a pattern, construct new string > > by removing part of the string equal to pattern. > > Remove only first occurrence of the pattern. > > > > Problem solutions > > > > Solution #1 ($x = $a) =~ s/\Q$b

Re: Loading a module (Net::Jabber) in Perl (Windows)

2003-01-08 Thread Jenda Krynicky
From: "Mark Troyer" <[EMAIL PROTECTED]> > I just started working with Perl and am having a great time at it. > > Quick question regarding the loading of modules. I am running > activestate perl on my XP machine. > > It appears that many of the modules I have looked at seem to have an > install p

Re: removing emty lines without creating a new file or array

2003-01-08 Thread John W. Krahn
Rob Dixon wrote: > > Try: > > perl -p -i -e "redo if /^\s*$/" file.ext > > which will remove all lines consisting only of whitespace. redo will go back to the top of the loop without evaluating the while expression so the first blank line will cause an infinite loop. John -- use Perl; pr

Re: removing emty lines without creating a new file or array

2003-01-08 Thread John W. Krahn
Nyimi Jose wrote: > > > From: Konrad Foerstner [mailto:[EMAIL PROTECTED]] > > > > My problem today ;) : I have a file with some unmeant empty > > lines and I want to remove them, without writing a new file > > and without storing all the content temporarily in an array. > > I thought about the fol

"hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
Hi all, I'm using the Net::Telnet module to automate some of the more menial tasks I have to deal with every so often. Part of the task requires parsing a stream of data from the device I'm telnetting to (A Marconi ASX-200 to be exact) ... I've successfully set up the telnet, logged in,

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
"David --- Senior Programmer Analyst --- Wgo Wagner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Under w2k I was unable to do an inline update without some type of > backup. Tried from command line and korn shell. If I did this: > > perl -p -i.plsdel -e "s

RE: "hidden" characters in an input stream

2003-01-08 Thread Dan Muey
Perhaps that data contains '<' in it already? Try print "---$line\---\n"; Just in case it's seeing it as a varaible named 'line<..' That could cause all sorts of screwy ness For kicks what does it ouput if you do : print "\n start line \n $line \n end line \n";

RE: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
Output is as follows : (note: test.perl is just a small test program to do just the telnet and getline ... I don't really name my programs test.perl ... :) [friz@dhcp9-52 friz]$ ./test.perl | more start line sec log sho end line start line UserName

Re: "hidden" characters in an input stream

2003-01-08 Thread Dave K
Jason, You didn't say anyting about the OSs involved, but the '\n' *nix eoln versus win '\r\n' is an often encountered problem. if you are *nix and target is or may be win while (my $line = $Telnet->getline(Timeout => 5,)) { $line =~ s/\r\n$\\; chomp $line; ... might do th

RE: "hidden" characters in an input stream

2003-01-08 Thread Dan Muey
I'll bet it has to do with the <<'s right after the var name How about this output :: print "---$line\---\n"; Or this print "--- $line ---\n" You may try $line =~ s/\n|\r//g; Dan -Original Message- From: Jason Frisvold [mailto:[EMAIL PROTECTED]] Sent: Wednesday, Jan

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
Rob Dixon wrote: > ... > You're right, I'm wrong, and I hereby resign. > > perl -p -i -e "redo if /^\s*$/" file.ext > > is completely wrong, as the redo doesn't pull in the next line from > the input. It simply retests the same blank line indefinitely. The > neater > > perl -p -i -e "s/

RE: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
I had thought of that before, tho ... Here's the ourput using the backslash : --- sec log sho--- UserName Application Authentication Method Profile Name--- - --- - --- myuser con

Re: "hidden" characters in an input stream

2003-01-08 Thread John W. Krahn
Jason Frisvold wrote: > > Hi all, Hello, > I'm using the Net::Telnet module to automate some of the more menial > tasks I have to deal with every so often. Part of the task requires > parsing a stream of data from the device I'm telnetting to (A Marconi > ASX-200 to be exact) ... I've

Re: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
I'll give this a try in a sec ... :) The program is running on a linux machine with Perl 5.8.0 ... The device I'm telnetting to is a proprietary machine ... Marconi ASX-200 ATM switch ... I believe it's a Wind Rivers embedded OS? Not positive tho .. On Wed, 2003-01-08 at 14:50, Dave K wrote:

RE: "hidden" characters in an input stream

2003-01-08 Thread Dan Muey
What does print $line; Do? -Original Message- From: Jason Frisvold [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 2:00 PM To: Dan Muey Cc: Perl Beginners List Subject: RE: "hidden" characters in an input stream I had thought of that before, tho ... Here's the ourput us

RE: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
The exact output is as follows : [friz@dhcp9-52 friz]$ ./test.perl [friz@dhcp9-52 friz]$ telnet password admin--- That's why I figured there was a CR in there... :) On Wed, 2003-01-08 at 14:57, Dan Muey wrote: > What does > print $line; > > Do? > > -Orig

Re: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
I *think* you meant : $line =~ s/\r\n$//; At any rate, that had 0 effect :) On Wed, 2003-01-08 at 14:50, Dave K wrote: > Jason, > You didn't say anyting about the OSs involved, but the '\n' *nix eoln > versus win '\r\n' is an often encountered problem. > if you are *nix and target is or may be

Re: "hidden" characters in an input stream

2003-01-08 Thread Jason Frisvold
This works great :) Still curious what's in that line, but ... Is there a way to show the raw output? On Wed, 2003-01-08 at 14:52, John W. Krahn wrote: > Jason Frisvold wrote: > > > > Hi all, > > Hello, > > > I'm using the Net::Telnet module to automate some of the more menial > > t

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
Hi Bob. "Bob Showalter" <[EMAIL PROTECTED]> wrote in message 2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX... > Rob Dixon wrote: > > ... > > You're right, I'm wrong, and I hereby resign. > > > > perl -p -i -e "redo if /^\s*$/" file.ext >

RE: removing emty lines without creating a new file or array

2003-01-08 Thread Bob Showalter
Rob Dixon wrote: > Hi Bob. > > "Bob Showalter" <[EMAIL PROTECTED]> wrote in message > 2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E652@FRISTX... > > Rob Dixon wrote: > > > ... > > > You're right, I'm wrong, and I hereby resign. > > > > > > perl -p

delete file

2003-01-08 Thread Jakob Kofoed
Hi, How can I delete a file in a script - but get the script to ask me if I really want to delete this file - and then wait for the yes or no answer? Thanks, Jakob

Re: "hidden" characters in an input stream

2003-01-08 Thread Christopher Kruslicky
On Wednesday 08 January 2003 3:11 pm, Jason Frisvold wrote: > This works great :) > > Still curious what's in that line, but ... > > Is there a way to show the raw output? > a very good and useful idea :) it's a regex that matches from ' ' thru '~', which according to the ascii chart are the fi

RE: delete file

2003-01-08 Thread Dan Muey
Command line or html ? Unix or windows? -Original Message- From: Jakob Kofoed [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 2:38 PM To: [EMAIL PROTECTED] Subject: delete file Hi, How can I delete a file in a script - but get the script to ask me if I really want to del

RE: delete file

2003-01-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Something like this: while ( 1 ) { printf "Please enter file to delete:"; chomp(my $filetodelete = ); last if ( $filetodelete =~ /^exit$/i ); printf "Deleting file: %-s\n", $filetodelete; while ( 1 ) { printf "Do you want to delete?: "; chomp(

Re: "hidden" characters in an input stream

2003-01-08 Thread John W. Krahn
Jason Frisvold wrote: > > On Wed, 2003-01-08 at 14:52, John W. Krahn wrote: > > > > Jason Frisvold wrote: > > > > > > Here is a quick snippet of the code : > > > > > > $Telnet->print("sec log sho"); > > > while (my $line = $Telnet->getline(Timeout => 5,)) { > > > chomp $line; > > > > Inste

Re: removing emty lines without creating a new file or array

2003-01-08 Thread Rob Dixon
"Bob Showalter" <[EMAIL PROTECTED]> wrote in message 2E4528861499D41199D200A0C9B15BC001D7E653@FRISTX">news:2E4528861499D41199D200A0C9B15BC001D7E653@FRISTX... > Rob Dixon wrote: > > Hi Bob. > > > > "Bob Showalter" <[EMAIL PROTECTED]> wrote in message > > 2E4528861499D41199D200A0C9B15BC001D7E652@FRI

Re: "hidden" characters in an input stream

2003-01-08 Thread John W. Krahn
"John W. Krahn" wrote: > > Jason Frisvold wrote: > > > > On Wed, 2003-01-08 at 14:52, John W. Krahn wrote: > > > > > > Jason Frisvold wrote: > > > > > > > > Here is a quick snippet of the code : > > > > > > > > $Telnet->print("sec log sho"); > > > > while (my $line = $Telnet->getline(Timeout => 5,

Q: on an "is pingable" script

2003-01-08 Thread David Winters
I'm trying to write a script that'll check to see if another machine is pingable, and perform one of two actions based on the result. I found the following isPingable() subroutine on a website (that is now not responding, so I couldn't contact its author) and thought I'd see how well it works.

Re: Q: on an "is pingable" script

2003-01-08 Thread Jenda Krynicky
From: David Winters <[EMAIL PROTECTED]> > I'm trying to write a script that'll check to see if another machine > is pingable, and perform one of two actions based on the result. I > found the following isPingable() subroutine on a website (that is now > not responding, so I couldn't contact its au

length of hash name

2003-01-08 Thread Dan Muey
Anybody happen to know off the top of their head what the max length of characters is that a hash's name can be? EG :: %123456789 = (); is a nine charcter name %joe_mama_said_to_tell_you_hi = (); is a 28 character name etc.. Thanks Dan

Re: script looking for expression in files

2003-01-08 Thread R. Joseph Newton
Hi Rob, Works on mine. Make sure you don't forget the star. That apparently is the file specifier. Joseph Rob Dixon wrote: > John > > That doesn't seem to work on my Win2K system ;-) > > Rob > > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED].

Re: script looking for expression in files

2003-01-08 Thread R. Joseph Newton
Hi John, Do you have a C compiler installed. I found that grep also works on my W2K system, but explorinmg farther, I did a search on grep and found tht it was available only through my Borland C++ 5.02 and C++ Builder installations. It does not, for some reason, come as part of the ActiveSta

Re: Phantom line numbers! (line numbers fixed; now, masking earlier declarations of variables??)

2003-01-08 Thread R. Joseph Newton
Hi Christopher, Declarations within loops can be tricky. I pretty much try to avoid them. If I need a variable within any kind of loop, I declare it before entering the loop. This may or may not be necessary, but it makes sense until or unless I am certain that, for instance while( my $Test+

Re: CGI path with spaces

2003-01-08 Thread R. Joseph Newton
Paul, Don't use physical paths, and don't use spaces in the folder names within your virual web trees. Neither is portable, so either will box your code in. The advantage is that you canuse the same code on Unix without having to rewrite. I would also recommend using forward slashes whereve

Re: Phantom line numbers! (line numbers fixed; now, masking earlier declarations of variables??)

2003-01-08 Thread Wiggins d'Anconia
Christopher D. Lewis wrote: > Can you direct me to a resource which will help me to see what needs to happen here? Start here: http://perl.plover.com/FAQs/Namespaces.html perldoc -f my perldoc -f our as the others have mentioned 'strict' is your friend (to put it lightly). http://danconi

Looping through a Hash

2003-01-08 Thread Johnstone, Colin
Gidday All, Can I do this when looping through a Hash. foreach my($k, $v)( %picDetails ){ do stuff to $v; } Thanking you in Anticipation Colin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CGI environment issues

2003-01-08 Thread Wiggins d'Anconia
Don't know much about Oracle or Win2k but no one else seems to have posted... The only thing I found rather peculiar was the following line from the trace: "Trying to fetch ORACLE_HOME and ORACLE_SID from the registry." Is it possible it is completely ignoring your ENV and looking in the regi

Re: Looping through a Hash

2003-01-08 Thread Wiggins d'Anconia
Sort of foreach my $key (keys(%picDetails)) { my $val = $picDetails{$key}; # do stuff to val } or while (my ($key, $val) = each (%picDetails)) { # do stuff to key or val } (foreach may work here as well, but I have always preferred while's for some reason) perldoc -f each perldoc -f

Re: removing emty lines without creating a new file or array

2003-01-08 Thread R. Joseph Newton
HI Timothy, You got it. The reality is, that any kind of in-place editing would require processing on the O(n^2), while a single read-through would be O(n). Joseph Timothy Johnson wrote: > Except that it will essentially create a new file. Why did you want to > avoid writing a new file? As

Re: taint, safe, mkpath trouble

2003-01-08 Thread Wiggins d'Anconia
Since no one else responded I thought I would make a guess. Have you looked into "untainting" %ENV by removing the 4 values indicated in the perldoc perlsec , perldoc perlrun docs? If all of ENV is tainted at once rather than by key (which I don't know) then that could be the root of the prob

Re: CGI environment issues

2003-01-08 Thread Michael Ragsdale
Actually one member did converse with me at length off list about the issue. After much trial and error we found that by turning off sqlnet authentication (simply commenting out the SQLNET.AUTHENTICATION_SERVICES line in the sqlnet.ora file on the web server machine) allowed the script to be r

check file existence

2003-01-08 Thread Alex Cheung Tin Ka
Dear All, I have a problem on using CGI to check the file existence in a directory. Here is my code $workDir = "/usr/local/home/tkcheung/systemadmin/singlesar/Report"; $path = "tulisar030108.rpt"; $notAvailabe = 0; $a = qq`$workDir/$path`; if (! -e $a){ $notAvailable = 1;} return $notAvai

File Handle?

2003-01-08 Thread Beau E. Cox
Hi - I want to determine is a variable is a file handle. How would I do this? I know how to tell if it is a ref to something, but I can't seem to be able to find out if it is a file handle. Aloha => Beau/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: File Handle?

2003-01-08 Thread simran
Haven't needed to do this myself... but how about something like: == use FileHandle; open(AB, "/etc/passwd") || die; $a = AB->fileno; print "A=$a\n"; === On Thu, 2003-01-09 at 15:43, Beau E. Cox wrote: > Hi

  1   2   >