RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
A simple regex will do the trick... # untested $text = ...; $text =~ s|head.*?/head||s; Or something more generic... # untested $tag = head; $text =~ s|$tag[^]*?.*?/$tag||s; This second one also allows for possible attributes in the start tag. You may need more than this if the HTML isn't

Re: Stripping HTML from a text file.

2003-09-04 Thread Wiggins d'Anconia
Won't this remove *everything* between the given tags? Or maybe I misunderstood the question, I thought she wanted to remove the code from all of the contents between two tags? Because of the complexity and variety of HTML code, the number of different tags, etc. I would suggest using an HTML

Re: Stripping HTML from a text file.

2003-09-04 Thread drieux
On Wednesday, Sep 3, 2003, at 03:32 US/Pacific, Sara wrote: [..] What I want to do is to remove/delete HTML code from the text file from a certain tag upto certain tag. For example; I want to delete the code completely that comes in between head and /head (including any style tags and embedded

RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
Or maybe I misunderstood the question Or maybe I did :) HTML::TokeParser::Simple I agree... but only if you are looking for a strong permanant solution. The regex way is good for quick and dirty HTML work. Sara, if you need to keep the head tags, then you could use this modified version...

Re: Stripping HTML from a text file.

2003-09-04 Thread Sara
Thanks a lot Hanson, It worked for me. Yep, you are right The regex way is good for quick and dirty HTML work. and especially for the newbies like me :)) Sara. - Original Message - From: Hanson, Rob [EMAIL PROTECTED] To: 'Wiggins d'Anconia' [EMAIL PROTECTED]; 'Sara' [EMAIL PROTECTED]

Re: Stripping HTML from a text file.

2003-09-04 Thread Wiggins d'Anconia
drieux wrote: It could just be my OCD, but if I could have hammered flat every FROOOTLOOP who wanted merely a 'quick and dirty' one time only fix, 'honest, it's just this one time', rather than actually cure the root cause problem, WE would be on a flat earth from all the pounding That or

Re: Stripping HTML from a text file.

2003-09-04 Thread drieux
On Thursday, Sep 4, 2003, at 17:55 US/Pacific, Hanson, Rob wrote: $text =~ s|(head).*?title.*?/title.*?(/head)|$1$2$3|s; actually that should be: $text =~ s|(head).*?(title.*?/title).*?(/head)|$1$2$3|s; way stylish! I actually like. But assumes that there will be a title element - otherwise

Re: [Addendum] Stripping HTML from a text file.

2003-09-04 Thread drieux
On Wednesday, Sep 3, 2003, at 06:08 US/Pacific, Sara wrote: #!/usr/bin/perl use LWP::Simple; print Content-type: text/html\n\n; $url = 'http://yahoo.com'; $html = get($url); [snip] $html =~ s|head.*?\/head||s; print $html\n; what you get from 'get' is a scalar $html that is the WHOLE PAGE

Desperately needs help with nested looping

2003-09-04 Thread B. Fongo
I'm quit confused with what I have below. I have 2 database tables; Games and groups. Name Group # John ,GroupA Miler, GroupA Peter, GroupB Mathew, GroupB Mark, GroupB Luke, GroupA I'm trying to select the members based on their groups and insert them into a different

passing an argument to a subroutine

2003-09-04 Thread B. Fongo
Hello An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; showValue ($x); # or showValue (\$x); sub showValue { my $forwarded = @_; print $forwarded; # print ${$forwarded}; } In both cases, the script prints out 1. What is going on

Re: passing an argument to a subroutine

2003-09-04 Thread Andrew Brosnan
On 9/4/03 at 11:34 AM, [EMAIL PROTECTED] (B. Fongo) wrote: Hello An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; showValue ($x); # or showValue (\$x); sub showValue { my $forwarded = @_; print $forwarded; # print

Re: cutting a string

2003-09-04 Thread sc00170
basename is more convenient i think. What do you say? Quoting [EMAIL PROTECTED]: On Mon, 1 Sep 2003 [EMAIL PROTECTED] wrote: What is the function of cutting a string from a point until the last character? For example $string=C:/progra~1/directory1/directory2/file.txt; i want

Re: WWW::Mechanize and Cookies

2003-09-04 Thread rkl
Hi all: Are these libs: WWW:: Mechanize and HTTP::Cookies in perl or mod_perl? -rkl Pablo Fischer writes: Hi! Im creating an script that checks for broken links. Im using this modules: use WWW::Mechanize; use HTTP::Cookies; What Im trying to do?, I need to login in a website (cause

Capturing passed Parameters?

2003-09-04 Thread Mark Weisman
How do you capture passed parameters in Perl on Windows? In regular perl its: $variable = param('passed'); However, when I tried to run that under windows, it dies a horrible death? I've looked through perl.org for more information about converting over my unix scripts to windows, any other

RE: Reverse Order?

2003-09-04 Thread Mark Weisman
Worked like a charm, big time thanks. Sincerely in Christ, Mark-Nathaniel Weisman President / Owner Outland Domain Group Consulting Anchorage / Washington DC / Bellevue [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 01,

Re: cutting a string

2003-09-04 Thread Freddy Söderlund
I think it would be easier to skip the split-function and use substr and rindex insted. It's shorter code. #!perl -w my $path = C:/program files/directory1/directory2/file.txt; my $filename = substr($path,(rindex($path,/)+1)); print $filename; This code will give you file.txt as output. Hope

chmod

2003-09-04 Thread Christiane Nerz
Hi all! I like to read several rows out of two different table-files and put them successively in a new file by: @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m]; Anything works fine, except that I can't delete the ending newline in the lines in the first tables. So

Re: chmod -- chomp not chmod!!

2003-09-04 Thread Christiane Nerz
Oh-oh - there was a mistake - I tried chomp, not chmod.. How do I use chomp correctly? I have an array of strings, want to cut off the last \n in each line and use the rest of the line. (concatenate it to another string) Jane Hi all! I like to read several rows out of two different table-files

Using external Unix commands

2003-09-04 Thread c s secret
I cant use Telnet or Sockets because the modules are not loaded on. I want to automate telnets to a list of ips. It looks like this is running but I am not prompted for a login and password until after I interupt the script. How can I get the prompts sent to the display then return to the

Inplace file editing with operator

2003-09-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I know how it's supposed to be done but when i tried it in a program i'm working on at the moment it isn't working quite how i expected. The program is, in it's simplest form (which still doesn't work): -- #!perl for $file (s2/*) { push

A big trouble

2003-09-04 Thread Antonio Jose
Hello I have 3 weeks learning Perl and I am trying to solve a trouble I need to write my thesis I have to read a file where I don't know the content of the first rows (only strings) and I need to read only data (numbers), I mean, I am going to read information that begin with blank

if-else-statemnet question

2003-09-04 Thread Babale Fongo
Hello Below is a portion of a script that displays a table. The argument passed by param() determines the number of rows the table should display. For some unknown reason, the value of param() seem to behave strangely. It at times the value does not change; even if a different number is sent as

Editing files inplace with the operator

2003-09-04 Thread Babylon
I know how it's supposed to be done but when i tried it in a program i'm writing at the moment it isn't working quite how i expected. The program is, in it's simplest form (which still doesn't work): -- #!perl for $file (s2/*) { push @ARGV,

RE: IIS Log File Conversion

2003-09-04 Thread Nigel Peck - MIS Web Design
Thanks, I found that but I'm looking for a Perl solution, should be possible with a one liner regex substitution AFAIK. Cheers, Nigel MIS Web Design http://www.miswebdesign.com/ -Original Message- From: Toby Stuart [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 04:58 To: 'Nigel

Re: Editing files inplace with the operator

2003-09-04 Thread Sudarshan Raghavan
Babylon wrote: I know how it's supposed to be done but when i tried it in a program i'm writing at the moment it isn't working quite how i expected. The program is, in it's simplest form (which still doesn't work): -- #!perl for $file (s2/*) {

Re: passing an argument to a subroutine

2003-09-04 Thread Freddy Söderlund
- Original Message - From: B. Fongo [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 11:34 AM Subject: passing an argument to a subroutine Hello An argument passed to a subroutine returns wrong value. What value do you want it to print?

Re: passing an argument to a subroutine

2003-09-04 Thread Rob Anderson
B. Fongo [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Hi An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; showValue ($x); # or showValue (\$x); sub showValue { my $forwarded = @_; print $forwarded; # print

Re: passing an argument to a subroutine

2003-09-04 Thread Sudarshan Raghavan
B. Fongo wrote: Hello Please don't cross post An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; You are trying to assign an array to a scalar. An array evaluated in a scalar context gives the no elements present in it. In this case the value 5 will

Re: Capturing passed Parameters?

2003-09-04 Thread Freddy Söderlund
Capturing parameters passed to a perl-script on Windows is done using the special @ARGV variable. @ARGV can be checked to see how many parameters were passed to your script, easily by doing so: die blah blah blah unless @ARGV == 2; This will make your script die with a message unless there

Re: Capturing passed Parameters?

2003-09-04 Thread Rob Anderson
Mark Weisman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How do you capture passed parameters in Perl on Windows? In regular perl its: $variable = param('passed'); Hi Mark, Erm, are you talking about passing parameters on the command line or to a cgi. if you calling perl

Re: chmod -- chomp not chmod!!

2003-09-04 Thread Sudarshan Raghavan
Christiane Nerz wrote: Oh-oh - there was a mistake - I tried chomp, not chmod.. How do I use chomp correctly? I have an array of strings, want to cut off the last \n in each line and use the rest of the line. (concatenate it to another string) Jane Hi all! I like to read several rows out of

AW: passing an argument to a subroutine

2003-09-04 Thread B. Fongo
I assigned it to scalar to get the number of elements contained in the array @x. Printing @x 0utside the subroutine gives me the right answer (5), but within the sub, I get 1; which is wrong. I need the correct number of elements within the sub to use it for a database entry. Why does Perl give

Re: passing an argument to a subroutine

2003-09-04 Thread Freddy Söderlund
When I run your code (slightly modified) like so: #!perl -w [EMAIL PROTECTED] = param-('group'); @group = (John,mark,Peter); # let's @group contains John, mark, Peter # I 'm passing exactly John, mark, Peter to the sub here. do_db(@group); sub do_db { @x = @_; # @x should be John,

Extracting equal entities from two different sized arrays?

2003-09-04 Thread Freddy Söderlund
Hi! I have stuck my thoughts on this one, maybee someone can help me out? I have two arrays @array1 = C:\Program files\directory1\directory2\directory3; @array2 = C:\Program files\directory1\dir2\dir3; What I want to do is, compare the arrays, one char at a time, from the beginning and stop

Getting rid of white space...

2003-09-04 Thread LoneWolf
I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. THe files from the SCO box are poorly formatted with extraneous whitespace (sometimes as much as 30 or more) before and after the text. I need to parse all of the files I DL and put them into a new file with _nice added

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread Rob Anderson
Freddy söderlund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! Hi I have stuck my thoughts on this one, maybee someone can help me out? I have two arrays @array1 = C:\Program files\directory1\directory2\directory3; @array2 = C:\Program files\directory1\dir2\dir3; It looks

RE: Getting rid of white space...

2003-09-04 Thread Marcos . Rebelo
are you speaking of this? use strict; while(my $line = ) { ($line) = ($line =~ /^\s*(.*)\s*\n$/); print($line._nice/n); } -Original Message- From: LoneWolf [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:38 PM To: [EMAIL PROTECTED] Subject: Getting rid of

RE: Capturing passed Parameters?

2003-09-04 Thread Dan Muey
How do you capture passed parameters in Perl on Windows? In regular perl its: $variable = param('passed'); However, when I tried to run that under windows, it dies a horrible death? I've looked through perl.org for more What dies a horrible death, and how? How are you running it?

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread Freddy Söderlund
- Original Message - From: Rob Anderson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:30 PM Subject: Re: Extracting equal entities from two different sized arrays? Freddy söderlund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! Hi

Re: WWW::Mechanize and Cookies

2003-09-04 Thread wiggins
On Thu, 04 Sep 2003 00:39:55 -0700, rkl [EMAIL PROTECTED] wrote: Hi all: Are these libs: WWW:: Mechanize and HTTP::Cookies in perl or mod_perl? Written in or available in? Written in: Perl Available in: yes They are standard Perl

RE: What's the command to find the name of the file being execute d?

2003-09-04 Thread Bob Showalter
[EMAIL PROTECTED] wrote: What's the simple Perl command to find the name of the file from which the Perl program is being executed? It was recently on this newsgroup but I can't find the article now. Check out the FindBin module. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread Rob Anderson
Freddy söderlund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] - Original Message - From: Rob Anderson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:30 PM Subject: Re: Extracting equal entities from two different sized arrays? Freddy

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread James Edward Gray II
On Thursday, September 4, 2003, at 09:28 AM, Freddy Söderlund wrote: Another example on just how *stuck* I was! You're right ofcourse and I were wrong when typing my example. It's really two strings: $string1 and $string2. Let me re-phrase my question a bit: I want to compare the two strings

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
I figured I'd take a stab at fleshing this out into what he wants... Any comments on things I could do better? I only added to what Robert had coded... Tony #!/usr/bin/perl -w use strict; my $dirname = /my/stuff/; my $file; my $newfile; my $line; opendir (DIR, $dirname) or die Can't

RE: Editing files inplace with the operator

2003-09-04 Thread Bob Showalter
Babylon wrote: ... for $file (s2/*) { push @ARGV, $file; } Not related to the problem, but the loop here is unnecessary. Just use: @ARGV = s2/*; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
I figured I'd take a stab at fleshing this out into what he wants... Any comments on things I could do better? I only added to what Robert had coded... Tony #!/usr/bin/perl -w use strict; my $dirname = /my/stuff/; my $file; my $newfile; my $line; opendir (DIR, $dirname) or die Can't

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread Freddy Söderlund
- Original Message - From: Rob Anderson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 4:50 PM Subject: Re: Extracting equal entities from two different sized arrays? Freddy söderlund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -

$| in module

2003-09-04 Thread Dan Muey
Howdy list! I was wondering...(imagine that!) If I have in my script: #!/usr/bin/perl -w use strict; use ModuleWhatever; And ModuleWhatever has: package ModuleWhatever; $|++; Would that turn on autoflush for the rest of the script? IE is the above

RE: What's the command to find the name of the file being execute d?

2003-09-04 Thread Dan Muey
[EMAIL PROTECTED] wrote: What's the simple Perl command to find the name of the file from which the Perl program is being executed? It was recently on this newsgroup but I can't find the article now. Do you mean the $0 variable? You could also do: use CGI qw(url); my $self =

RE: WWW::Mechanize and Cookies

2003-09-04 Thread Hanson, Rob
mod_perl isn't a language, it is an application server. If the question is Is it mod_perl safe?, then that is a different question. I would think they are, both are OOP, and there is no state that I am aware of that is outside of the object properties. Rob -Original Message- From: rkl

Test if browser's allows cookies/has them turned onetc..

2003-09-04 Thread Dan Muey
Howdy list, You know how some sites will say You need to enable cookies for this site to use this service As much as I hate to do stuff that requires cookies, there is a project I'm doing that requires cookies. I don't think you can set a cookie in a header then get the value of that cookie

Re: $| in module

2003-09-04 Thread Peter Scott
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Dan Muey) writes: Howdy list! I was wondering...(imagine that!) If I have in my script: #!/usr/bin/perl -w use strict; use ModuleWhatever; And ModuleWhatever has: package ModuleWhatever; $|++; Would that turn

RE: $| in module

2003-09-04 Thread wiggins
On Thu, 4 Sep 2003 10:01:43 -0500, Dan Muey [EMAIL PROTECTED] wrote: Howdy list! I was wondering...(imagine that!) If I have in my script: #!/usr/bin/perl -w use strict; use ModuleWhatever; And ModuleWhatever has:

RE: Getting rid of white space...

2003-09-04 Thread Marshall, Stephen
I have a similar problem to this , does anyone have another answer? Don't know if its just me but The use strict; while(my $line = ) { ($line) = ($line =~ /^\s*(.*)\s*\n$/); print($line._nice/n); } Code doesn't work , and the enhanced version with the fancy file handling

RE: Getting rid of white space...

2003-09-04 Thread Marshall, Stephen
Got it working this way fror the important line, but theres probably a slicker way of doing it. $line =~ s/(\s)+/ /g; -Original Message- From: Marshall, Stephen Sent: 04 September 2003 17:07 To: 'Akens, Anthony'; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject:

RE: $| in module

2003-09-04 Thread Dan Muey
In article [EMAIL PROTECTED] nfiniplex.com, [EMAIL PROTECTED] (Dan Muey) writes: Howdy list! I was wondering...(imagine that!) If I have in my script: #!/usr/bin/perl -w use strict; use ModuleWhatever; And ModuleWhatever has: package ModuleWhatever;

Help please. What is missing?

2003-09-04 Thread mdaily
Can someone please explain why this while (1) { my $item = STDIN; chomp $item; last unless $item; $inventory{1c $item}++; } Gets Bare word found where operator expected Syntax error line 13 near 1c thanks Madison Daily Weldon, Williams Lick, Inc.

Re: Help please. What is missing?

2003-09-04 Thread K Old
On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote: Can someone please explain why this while (1) { my $item = STDIN; chomp $item; last unless $item; $inventory{1c $item}++; } You probably wanted: $inventory{'1c'}++; or $inventory{$item}++;

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
Try it like this... I was a slacker and didn't have warnings in place if it couldn't open the file... Should be able to just change the /my/stuff/ to your directory and have it work, I tested it here, and it seems to go fine. (on an aix box - maybe I have something in place that doesn't work on

RE: Getting rid of white space...

2003-09-04 Thread Perry, Alan
On Thursday, September 04, 2003 11:11, Marshall, Stephen wrote: Got it working this way fror the important line, but theres probably a slicker way of doing it. $line =~ s/(\s)+/ /g; This will work, but may leave an extraneous space at the beginning and/or end of the line. This text: Test

Re: Help please. What is missing?

2003-09-04 Thread Paul Johnson
K Old said: On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote: Can someone please explain why this while (1) { my $item = STDIN; chomp $item; last unless $item; $inventory{1c $item}++; } You probably wanted: $inventory{'1c'}++; or

Re: Help please. What is missing?

2003-09-04 Thread wiggins
On Thu, 4 Sep 2003 18:46:48 +0200 (CEST), Paul Johnson [EMAIL PROTECTED] wrote: K Old said: On Thu, 2003-09-04 at 12:24, [EMAIL PROTECTED] wrote: Can someone please explain why this while (1) { my $item = STDIN;

RE: Help please. What is missing?

2003-09-04 Thread Charles K. Clarkson
Madison Daily [EMAIL PROTECTED] wrote: : Can someone please explain why this : : while (1) { :my $item = STDIN; :chomp $item; :last unless $item; :$inventory{1c $item}++; : } : : : Gets Bare word found where operator expected : Syntax error

RE: $| in module

2003-09-04 Thread wiggins
On Thu, 4 Sep 2003 11:17:56 -0500, Dan Muey [EMAIL PROTECTED] wrote: snip I have a bunch of scripts that use a module for simply sharing variables, IE if I change one I change it in one place instead of having to edit tons of scripts. So I

RE: $| in module

2003-09-04 Thread Peter Scott
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Dan Muey) writes: In article [EMAIL PROTECTED] nfiniplex.com, [EMAIL PROTECTED] (Dan Muey) writes: Howdy list! I was wondering...(imagine that!) If I have in my script: #!/usr/bin/perl -w use strict; use ModuleWhatever;

Re: chmod

2003-09-04 Thread John W. Krahn
Christiane Nerz wrote: Hi all! Hello, I like to read several rows out of two different table-files and put them successively in a new file by: @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m]; You should be using push for that: push @ergebnis_alles,

Re: Inplace file editing with operator

2003-09-04 Thread John W. Krahn
Perldiscuss - Perl Newsgroups And Mailing Lists wrote: I know how it's supposed to be done but when i tried it in a program i'm working on at the moment it isn't working quite how i expected. The program is, in it's simplest form (which still doesn't work):

Re: Test if browser's allows cookies/has them turned onetc..

2003-09-04 Thread Randal L. Schwartz
Dan == Dan Muey [EMAIL PROTECTED] writes: Dan As much as I hate to do stuff that requires cookies, there is a Dan project I'm doing that requires cookies. This should have been on [EMAIL PROTECTED] instead. More experts there about this stuff. Having said that, you should read my basic cookie

Re: Getting rid of white space...

2003-09-04 Thread Brian Harnish
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 04 Sep 2003 06:37:57 -0700, LoneWolf wrote: I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. THe files from the SCO box are poorly formatted with extraneous whitespace (sometimes as much as 30 or more) before

RE: $| in module

2003-09-04 Thread Dan Muey
Thanks Peter and Wiggins, hey Peter Wiggins like Ender's brother? Cool! Any way I appreciate all the insights and angles into the subject. I'll Consider all that and see if it si something I need to do or not. Thanks Dan PS it is a module on only one server with a really speciallized name and

retrieve command data from DOS using telnet

2003-09-04 Thread Nitin Aggarwal
Hi , I am writing this code to telnet into windows machine. The code works fine on the unix machine and runs the command 'ps -ef'. On W2K I am trying to telnet into the machine and to recognize the prompt 'C:\' . but it keeps on giving the error 'time-out. I have tried different combinations of

Re: Extracting equal entities from two different sized arrays?

2003-09-04 Thread John W. Krahn
Freddy söderlund wrote: Let me re-phrase my question a bit: I want to compare the two strings and I want to extract those chars that are matching each other in the first and second string (in order from the beginning), and put them in a new string (not array as I mistakenly said earlier).

RE: Getting rid of white space...

2003-09-04 Thread Bob Showalter
LoneWolf wrote: I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. THe files from the SCO box are poorly formatted with extraneous whitespace (sometimes as much as 30 or more) before and after the text. I need to parse all of the files I DL and put them into a new

RE: Test if browser's allows cookies/has them turned onetc..

2003-09-04 Thread Dan Muey
-Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 12:33 PM To: [EMAIL PROTECTED] Subject: Re: Test if browser's allows cookies/has them turned onetc.. Dan == Dan Muey [EMAIL PROTECTED] writes: Dan As much as I hate to

Re: Getting rid of white space...

2003-09-04 Thread John W. Krahn
Lonewolf wrote: I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. THe files from the SCO box are poorly formatted with extraneous whitespace (sometimes as much as 30 or more) before and after the text. I need to parse all of the files I DL and put them into a new

Re: Net::SSH::Perl

2003-09-04 Thread zentara
On Wed, 3 Sep 2003 12:54:07 +0800, [EMAIL PROTECTED] (Jaws) wrote: Hi all, I am currently using Net::SSH::Perl module to login in my remote machine. Below is my code: == #!/usr/bin/perl use Net::SSH::Perl; $user=jaws; $pass=password; $host=111.222.333.444; my

Re: Help please. What is missing?

2003-09-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Can someone please explain why this while (1) { my $item = STDIN; chomp $item; last unless $item; You should use a different test then true or false for $item last unless length $item; $inventory{1c

Re: Net::SSH::Perl

2003-09-04 Thread wiggins
On Thu, 04 Sep 2003 14:23:44 -0400, zentara [EMAIL PROTECTED] wrote: On Wed, 3 Sep 2003 12:54:07 +0800, [EMAIL PROTECTED] (Jaws) wrote: Hi all, I am currently using Net::SSH::Perl module to login in my remote machine. Below is my code:

Ring Bell

2003-09-04 Thread Jimstone77
Is there any way in PERL to ring a Bell or make some sound in a script. For example, to let you know when a task is completed. Any help would be appreciated.

Thanks and another quick Q, how to unconcatenate...

2003-09-04 Thread LoneWolf
Thanks for everyone's help with this one, I was stuck and knew I was missing something simple.. UGH. perldoc -q replace didn't turn me up with anything either, which was a bummer, but going off the code posted here I was able to do more with it. This is what I used:

Re: A big trouble

2003-09-04 Thread John W. Krahn
Antonio Jose wrote: Hello I have 3 weeks learning Perl and I am trying to solve a trouble I need to write my thesis I have to read a file where I don't know the content of the first rows (only strings) and I need to read only data (numbers), I mean, I am going to read information

Re: Ring Bell

2003-09-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Is there any way in PERL to ring a Bell or make some sound in a script. For example, to let you know when a task is completed. Any help would be appreciated. print \a; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Thanks and another quick Q, how to unconcatenate...

2003-09-04 Thread Akens, Anthony
Something like this will skip all files with _nice at the end... next if $file =~ /_nice$/; unlink ($file) or die Couldn't delete file; (I think that would work. Untested) Tony -Original Message- From: LoneWolf [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 2:23

Re: Getting rid of white space...

2003-09-04 Thread John W. Krahn
John W. Krahn wrote: #!/usr/bin/perl use warnings; use strict; ( $\, $^I ) = ( $/, '.bak' ); while ( ) { s/^\s+//; # remove space at beginning of line s/\s+$//; # remove space at end of line s/\s*\|\s*/|/g; # remove space around pipe separator Forgot

Re: Thanks and another quick Q, how to unconcatenate...

2003-09-04 Thread John W. Krahn
Lonewolf wrote: Thanks for everyone's help with this one, I was stuck and knew I was missing something simple.. UGH. perldoc -q replace didn't turn me up with anything either, which was a bummer, but going off the code posted here I was able to do more with it. This is what I used:

Fixed Problems... Thanks Everyone!

2003-09-04 Thread LoneWolf
John, thanks for the heads-up, I saw the errors and modified the lines. For anyone wanting to do this on their own system... sub cleanup{ use strict; my $dirname = /home/data; my $file; my $newfile; my $line; opendir (DIR, $dirname) or die Can't

help if than else statement

2003-09-04 Thread Thomas Browner
Can some one tell me way this does not work. if (@ARGV[0] = -q){print it worked\n;} else {print it did not work\n;} if I use a -w instead of -q it still prints it worked. Thomas Browner Digidyne, Inc Technical Engineer (251)479-1637

Re: help if than else statement

2003-09-04 Thread Matt Matijevich
try this: if (@ARGV[0] == -q){print it worked\n;} else {print it did not work\n;} -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: help if than else statement

2003-09-04 Thread Tim Johnson
This is a very common mistake, so don't feel bad. The = operator assigns the value on the right to the variable on the left. The == operator checks two numeric values for comparison, returning true if they match The eq operator checks two string values for comparison, returning true if they

RE: help if than else statement

2003-09-04 Thread West, William M
Can some one tell me way this does not work. if (@ARGV[0] = -q){print it worked\n;} try (@ARGV[0] == -q) ^^ this got me too- the == compares values while = assignes the right side value to lef side

RE: help if than else statement

2003-09-04 Thread West, William M
The == operator checks two numeric values for comparison, returning true if they match The eq operator checks two string values for comparison, returning true if they match oh dear!! i'd forgotten that detail. sometimes i still get myself with this one. willy -- To unsubscribe, e-mail:

Re: help if than else statement

2003-09-04 Thread James Edward Gray II
On Thursday, September 4, 2003, at 04:31 PM, Thomas Browner wrote: Can some one tell me way this does not work. I believe I can, yes. :) if (@ARGV[0] = -q){print it worked\n;} else {print it did not work\n;} Okay, one issue at a time. First @ARGV[0] should be $ARGV[0]. When we're talking

RE: IIS Log File Conversion

2003-09-04 Thread Toby Stuart
-Original Message- From: Nigel Peck - MIS Web Design [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 10:26 AM To: [EMAIL PROTECTED] Subject: IIS Log File Conversion Does anyone have a code snippet or a module for converting the IIS log file format to NCSA Common?

Re: help if than else statement

2003-09-04 Thread Randal L. Schwartz
Tim == Tim Johnson [EMAIL PROTECTED] writes: Tim So you need to change your code to: Tim If(@ARGV[0] eq -q){ Timprint It worked\n; Tim }else{ Timprint It did not work\n; Tim } And you really need to change @ARGV[0] to $ARGV[0], or else the don't use an array slice when an element will

Redirect output of command to a list

2003-09-04 Thread Wong, Nelson
Hi all, I have been doing redirect the output of command (an external tool, exe) to a file, by doing following: system( tool.exe args args args tempoutput); and I read tempoutput to a list, by doing following: my $FIN = new FileHandle; open ($FIN,$map_file); my @lines = FIN;

RE: Redirect output of command to a list

2003-09-04 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Wong, Nelson wrote: Hi all, I have been doing redirect the output of command (an external tool, exe) to a file, by doing following: system( tool.exe args args args tempoutput); You might be able to do: my @lines =`tool.exe args args args` This should

use strict, global variables, modules

2003-09-04 Thread Emil Perhinschi
Hi! I'm writing a rather complicated script, reading bibtex (my code) and xml (XML::Grove) files etc. I have to use strict and my $variable in order to keep references in check, as there are lots of them. I want to define some global variables in the main script instead of passing them arround

Re: Redirect output of command to a list

2003-09-04 Thread John W. Krahn
Nelson Wong wrote: Hi all, Hello, I have been doing redirect the output of command (an external tool, exe) to a file, by doing following: system( tool.exe args args args tempoutput); and I read tempoutput to a list, by doing following: my $FIN = new FileHandle; open

Re: Editing files inplace with the operator

2003-09-04 Thread Babylon
Thanks for your help and for the detailed info :) (Needless to say it works fine when i changed it to while () ) Sudarshan Raghavan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Babylon wrote: I know how it's supposed to be done but when i tried it in a program i'm writing at the

Launching shell scripts using PERL and passing arguments

2003-09-04 Thread Rajesh Dorairajan
Hello All, I have a very basic question. I need to launch a Bourne shell script using PERL and automate the responses required by the script. I have shown the sample shell script below: #!/bin/sh echo Welcome to my script echo Do you want to continue read ans if [ $ans = n ] then exit 0 fi

  1   2   >