Re: reverse range (10..1)

2003-09-04 Thread R. Joseph Newton
Paul Archer wrote: > 4:09pm, Ramprasad A Padmanabhan wrote: > > And the problem is not simply a puzzle, nor is it homework. If you had read > my post more carefully, you would see that I am 1) *teaching* the class, and > 2) want to be able to show off one concept (the range operator) before we > h

RE: FTP Daemon...

2003-09-04 Thread simran
Hi, I am actually indeed looking to build on an already existing perl module... i had a look at: * Net::FTPServer which seems pretty extensive, but from an initial view of the docs, did not give me the ability to easily override the authentication mechnism and use my own database for us

Re: Enumerating list of IP Addresses from a given range

2003-09-04 Thread John W. Krahn
Brian Burns wrote: > > given a start and finish address like this > > $start_address = "10.11.1.14:; > $finish_address = "12.13.2.3"; > > I need to output generarate a a sequential list of addresses like the > following: > > 10.11.1.14 > 10.11.1.15 > 10.11.1.16 > ... > 12.13.1.252 > 12.13.1.25

Enumerating list of IP Addresses from a given range

2003-09-04 Thread Brian Burns
given a start and finish address like this $start_address = "10.11.1.14:; $finish_address = "12.13.2.3"; I need to output generarate a a sequential list of addresses like the following: 10.11.1.14 10.11.1.15 10.11.1.16 ... 12.13.1.252 12.13.1.253 12.13.1.254 12.13.2.1 13.13.2.2 12.13.2.3 I have

RE: IIS Log File Conversion

2003-09-04 Thread Toby Stuart
> -Original Message- > From: David Wall [mailto:[EMAIL PROTECTED] > Sent: Friday, September 05, 2003 12:03 PM > To: [EMAIL PROTECTED] > Subject: RE: IIS Log File Conversion > > > > > --On Thursday, September 04, 2003 9:48 AM +0100 Nigel Peck - > MIS Web Design > <[EMAIL PROTECTED]>

RE: IIS Log File Conversion

2003-09-04 Thread David Wall
--On Thursday, September 04, 2003 9:48 AM +0100 Nigel Peck - MIS Web Design <[EMAIL PROTECTED]> wrote: Thanks, I found that but I'm looking for a Perl solution, should be possible with a one liner regex substitution AFAIK. Doesn't IIS document its log file format somewhere? I know Apache does:

RE: FTP Daemon...

2003-09-04 Thread Paul Kraus
Maybe I am misreading this but are you asking if anyone has written an ftp server in perl? Why not just use one of the many free open source ftp servers already out there? Paul Kraus -Original Message- From: simran [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 7:53 PM To:

Re: Launching shell scripts using PERL and passing arguments

2003-09-04 Thread segmentation fault
you could do something like open SCRIPT, "| /path/to/script" || die("$!"); select(SCRIPT); $|=1; print "argument\n"; select(STDOUT); close(SCRIPT); perldoc perlipc -- ___ Get your free email from http://www.hackermail.com Powered by Outblaze -- To u

FTP Daemon...

2003-09-04 Thread simran
Hi All, Has anyone written/used a simple ftp daemon, if so, can you please me to the CPAN modules you used (i haven't found anything that really suits my needs, can adapt a few, but maybe someone knows a module more appropriate). What i need: * People to be able to connect to my ftp server * M

Re: use strict, global variables, modules

2003-09-04 Thread John W. Krahn
Emil Perhinschi wrote: > > Hi! Hello, > 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" variab

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

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 > >writ

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

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 ar

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` Thi

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

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 = ;

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"){ Tim>print "It worked\n"; Tim> }else{ Tim>print "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

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

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 talki

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-mai

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

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 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]

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

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 o

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

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 separ

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: 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 ad

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 inform

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:

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.

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 m

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 = ; >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 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.

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 n

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

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: 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 > ear

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 t

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

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: 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 "b

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: 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, $whol

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 st

RE: $| in module

2003-09-04 Thread wiggins
On Thu, 4 Sep 2003 11:17:56 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote: > > 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: 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 = ; :chomp $item; :last unless $item; :$inventory{1c $item}++; : } : : : Gets Bare word found where operator expected : Syntax error line 13

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 table

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

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 = ; >>chomp $item; >>last unless $item; >>$inventory{1c $item}++; >> } > > You probably wanted: > > $inventory{'1

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: "

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 o

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 = ; >chomp $item; >last unless $item; >$inventory{1c $item}++; > } You probably wanted: $inventory{'1c'}++; or $inventory{$item}+

Help please. What is missing?

2003-09-04 Thread mdaily
Can someone please explain why this while (1) { my $item = ; 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. (479

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: > > > > p

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] > Subje

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 handl

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 ModuleWha

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; > $|++; >

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: 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

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 $se

$| 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 exampl

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]

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 open

RE: Editing files inplace with the <> operator

2003-09-04 Thread Bob Showalter
Babylon wrote: > ... > for $file () > { > push @ARGV, $file; > } Not related to the problem, but the loop here is unnecessary. Just use: @ARGV = ; -- 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 open

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 a

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

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: 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: 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 PROTECTE

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 runnin

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 o

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

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

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 sto

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 shoul

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 m

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 tw

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 pe

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 we

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 b

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 $forwa

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

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 () { push @

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 here?

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: 'Nig

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 () { push @ARGV, $file;

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

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 space

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 () { push @ARG

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 per

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

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 t

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. H

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, 200

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 goo

  1   2   >