Re: Starting Perl

2003-11-16 Thread R. Joseph Newton
"Randal L. Schwartz" wrote: > > "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: > > Rob> Perl programs conventionally go in *.pl files. > > No. Only on broken architectures that demand it (read: "windows"). Oh? Greetings! E:\d_drive\ocf\discuss\prototype>perl mailparse

Re: Starting Perl

2003-11-16 Thread R. Joseph Newton
drieux wrote: > > Which Organizational Process > The one here on Earth, specifically the one a beginner to Perl, and probably also to programming, faces in taking his first steps to learning the language. This was the subject of the original post, from a user who stated that he opera

Re: Starting Perl

2003-11-16 Thread R. Joseph Newton
"Randal L. Schwartz" wrote: > I don't mind it for source files, but having to type "foo.pl" to run > the "foo" command strikes me as excessive user hostility. ..and so does double-clicking on the script icon? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

RE: What $| actually does?

2003-11-16 Thread Tim Johnson
The autoflush($|) variable is very useful, especially for debugging, so that you can monitor the printed output of your script in real time. One thing to watch out for that most people miss the first time they read the docs, though, is that you need to select() your filehandle before you use i

Re: What $| actually does?

2003-11-16 Thread John
Well, in the beginning of every script, the $|=1 should be placed. Am i right? - Original Message - From: "Tim Johnson" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]>; "Perl Beginners" <[EMAIL PROTECTED]> Sent: Sunday, November 16, 2003 10:39 AM Subject: RE: What $| actually does? >

Re: What $| actually does?

2003-11-16 Thread Hacksaw
>Well, in the beginning of every script, the $|=1 should be placed. Am i >right? Only if you really want that behavior. The trade off here is that you will not really be buffering your writes. If you only have a few, it probably fine, but if you have a lot, like a complicated web page, your scri

Re: Counting (easy!) - select???

2003-11-16 Thread Rob Dixon
R. Joseph Newton wrote: > > Rob Dixon wrote: > > > > > Not exactly a transparent piece of code though is it. Especially > > if your base system isn't Unix! > > Works jusat fine on Windows, although it helps to have a longer list, since this > gets p[rocessed really fast, too fast to > see what's g

Re: Counting (easy!) - select???

2003-11-16 Thread Rob Dixon
Joseph wrote: > > Rob Dixon wrote: > > > > Not exactly a transparent piece of code though is it. Especially > > if your base system isn't Unix! > > Works jusat fine on Windows, although it helps to have a longer list, > since this gets p[rocessed really fast, too fast to see what's going > on. Try

Re: Starting Perl

2003-11-16 Thread Rob Dixon
Joseph wrote: > > > I don't mind it for source files, but having to type "foo.pl" to run > > the "foo" command strikes me as excessive user hostility. > > ..and so does double-clicking on the script icon? Which, to be fair, doesn't allow any command-line parameters apart from those that you though

Re: When is Perl 6 coming out?

2003-11-16 Thread Rob Dixon
Randal L. Schwartz wrote: > > > "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: > > Km> i am just curious -- is perl 6 coming with a compiler ? > >> > >> Why would they remove a feature already available since Perl 1? > > Rob> I think you and I both know what Km means by a 'compiler'. > > No. I

Logging to a Server via ftp.

2003-11-16 Thread John
What is the module and some examples to do tha bove job? Thanks in advance.

Question on grep search

2003-11-16 Thread Paul Harwood
I am trying to push an element into a nested array, but ONLY if it doesn't already exist. I thought the best way to do this might be the code I wrote below but it doesn't work. @{$names{TEST}} = ('Paul', 'Mike'); print "Arrays is: "; print @{$names{TEST}}; print "\n"; $another_name = "George"; pus

first steps with perl, a log reader

2003-11-16 Thread Sander
Hi all This is my first time on this mailing list, so i'll start with a Hello (world) :) I have a prob with my first script (i have read Learning Perl, and (not yet readed) Programming Perl. Now i want to make a simple tool to read my logs (i've started simple with one log, i need to filter it lat

Re: Question on grep search

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 15, Paul Harwood said: >push @{$names{TEST}}, $another_name > unless grep ($another_name, @{$names{TEST}}); >I thought that the $another_name scalar would be pushed once a grep of >the nested array shows that it doesn't already exist. How can I make >this work? That's because you're assu

Re: When is Perl 6 coming out?

2003-11-16 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> Just to pick the remainder of your nits, a compiler traditionally Rob> creates an object file. That's only *one* meaning of the word. And it's the meaning least appropriate in the Perl world. :) -- Randal L. Schwartz - Stonehenge Consul

Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, Sander said: >open (ER,"/home/unicorn/Plscripts/error_log"); #opening error_log >open (EL, "home/unicorn/Plscripts/ERROR.LOG"); #opening ERROR.LOG I have a feeling you're missing the leading '/' for that second file. You should never open a file without being sure it worked: open F

Re: Logging to a Server via ftp.

2003-11-16 Thread Wiggins d'Anconia
John wrote: What is the module and some examples to do tha bove job? Thanks in advance. I am assuming you mean "Logging into a server via ftp"... Net::FTP Or did you really mean "Logging to a server via ftp"... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Question on grep search

2003-11-16 Thread Paul Johnson
On Sat, Nov 15, 2003 at 11:33:15PM -0800, Paul Harwood wrote: > I am trying to push an element into a nested array, but ONLY if it > doesn't already exist. A question of this nature usually suggests that you should be using a hash instead of an array. >I thought the best

Re: first steps with perl, a log reader

2003-11-16 Thread Rob Dixon
Hi Sander. First of all, I guess this will feel like I'm ripping your code apart. Try to imagine me as your best-friend cardboard-cutout programmer with nothing but your interests at heart. :) Few people know what to make of Perl the first time they see it. People try to force it into either C or

Re: first steps with perl, a log reader

2003-11-16 Thread Hacksaw
Sander: I have an answer, and a comment: The answer: select wants a filehandle, so line 7 wants to read select EL; The comment: You are probably complicating things a great deal by using select. #!/usr/bin/perl -w open (ER, "/home/unicorn/Plscripts/ERROR.LOG"); #opening ERROR.LOG for writing

Re: first steps with perl, a log reader

2003-11-16 Thread Rob Dixon
Rob Dixon wrote: > > } select (STDOUT); #make sure STDOUT is normal again > > What for, if you're not going to use STDOUT again? A better comment would have also said, "And anyway STDOUT is still selected." Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Re: first steps with perl, a log reader

2003-11-16 Thread Rob Dixon
Rob Dixon wrote: > My code would look like > > use strict; > use warnings; > > open ER, '/home/unicorn/Plscripts/error_log' or die $!; > open EL, '> /home/unicorn/Plscripts/ERROR.LOG' or die $!; > > print while ; > > You write a darned good acorn! Oaks are next week. :) Damn. And also

Re: Question on grep search

2003-11-16 Thread Rob Dixon
Jeff 'Japhy' Pinyan wrote: > On Nov 15, Paul Harwood said: > > >push @{$names{TEST}}, $another_name > > unless grep ($another_name, @{$names{TEST}}); > > >I thought that the $another_name scalar would be pushed once a grep of > >the nested array shows that it doesn't already exist. How can I make

Re: references and objects

2003-11-16 Thread Rob Dixon
Angie Ahl wrote: > > Sorry I forgot to mention that the package IS an object ;) Pettiness says that you mean the package is a /class/ :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: references and objects

2003-11-16 Thread Hacksaw
>Pettiness says that you mean the package is a /class/ :) That's pedantism. ;-) BTW, mail to [EMAIL PROTECTED] bounced. -- Establish the principle. http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Help with UNIX commands

2003-11-16 Thread Rob Dixon
Wiggins D'Anconia wrote: > > Mame Mbodji wrote: > > I am researching some unix commands and I would like to know if someone > > knows where I can find them online. I just want to know what are they > > used for and if there are some available examples online.The commands > > are: snapshot and sdtpr

Re: Starting Perl

2003-11-16 Thread drieux
On Saturday, Nov 15, 2003, at 23:38 US/Pacific, R. Joseph Newton wrote: [..] The most recent comment seems to be about the organizational process involved with keeping files sorted by category. It is a fairly straightforward issue. It seemed a very cogent point. Nothing in the origin of the thre

selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread drieux
On Sunday, Nov 16, 2003, at 07:53 US/Pacific, Hacksaw wrote: [..] If you were never going to do anything else in the while loop, it could be this: while () { print EL $_; } I think select is one of the statements that you don't need for most small projects. I have never used it in my 6 or so years

Re: references and objects

2003-11-16 Thread Steve Grazzini
On Sun, Nov 16, 2003 at 11:42:48AM -0500, Hacksaw wrote: >> Pettiness says that you mean the package is a /class/ :) > > That's pedantism. ;-) It's "pedantry". :-) -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: mech-dump...

2003-11-16 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Vincent A. Primavera) writes: >Hello, >Using the mech-dump utility I get the error listed below when trying >to access this page. I do have the login information. Does anybody know >how I can supply it and get around this? >-- >T

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, drieux said: > select FILEHANDLE > select Returns the currently selected filehandle. Sets the > current default filehandle for output, if FILEHANDLE > is supplied. This has two effects: first, a "write" > or a "print" without a filehan

Re: Logging to a Server via ftp.

2003-11-16 Thread John
Yes, logging into. Have you got a relevant script? - Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Sunday, November 16, 2003 5:28 PM Subject: Re: Logging to a Server via ftp. > John wrote:

Re: first steps with perl, a log reader

2003-11-16 Thread Guardian Angel
On Sun, 2003-11-16 at 16:52, Rob Dixon wrote: > Hi Sander. First of all, I guess this will feel like I'm ripping > your code apart. Try to imagine me as your best-friend > cardboard-cutout programmer with nothing but your interests > at heart. :) I'll do my best to see you as my best-friend, while

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread drieux
On Sunday, Nov 16, 2003, at 10:41 US/Pacific, Jeff 'japhy' Pinyan wrote: [..] And yes, DO remember the caveat at the end of the select perldoc that notes: WARNING: One should not attempt to mix buffered I/O (like "read" or ) with "select", except as permitted

Re: first steps with perl, a log reader

2003-11-16 Thread Daniel Staal
--On Sunday, November 16, 2003 8:45 PM +0100 Guardian Angel <[EMAIL PROTECTED]> wrote: use strict; # Always use warnings; # Usually (same as -w qualifier but portable) i will do that, "use warnings;" gave me more (human readable) errors, so better to understand for me. Well, if it's human r

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Hacksaw
>So my intention was to finish off the general discussion >of 'do you really need select' with that simple reminder >that when one does need select, one also needs to do some >basic defensive coding one place or the other. This post goes a ways to showing why unthinking operator overloading is a

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, Hacksaw said: >The fact that select has two incompatible meanings in perl is a >mistake. If I were going to rename them, I'd call the default output >changing command defout or default_output. As for the C lib function, >I'd call it readydesc or ready_descriptors. I think 'select' is a

Re: Starting Perl

2003-11-16 Thread R. Joseph Newton
Rob Dixon wrote: > Joseph wrote: > > > > > I don't mind it for source files, but having to type "foo.pl" to run > > > the "foo" command strikes me as excessive user hostility. > > > > ..and so does double-clicking on the script icon? > > Which, to be fair, doesn't allow any command-line parameters

Re: Starting Perl

2003-11-16 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > "Randal L. Schwartz" wrote: > > > Rob> Perl modules are in *.pm. > > > Yes, this is enforced by Perl. > > ... Perl does use the extension > system for identifying modules under Windows. It looks specifically for files > with the .pm extension. > > I just checked. ..

Re: Help with UNIX commands

2003-11-16 Thread Mame Mbodji
Rob: Thank you for responding to my post! I just got back from a long week end. Did not check my email [EMAIL PROTECTED] wrote: Wiggins D'Anconia wrote: Mame Mbodji wrote: I am researching some unix commands and I would like to know if someone knows where I can find them online. I just wan

File upload script

2003-11-16 Thread perl
Can someone point the way to some file upload script for webserver on unix/linux? thanks - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: File upload script

2003-11-16 Thread Daniel Staal
--As off Sunday, November 16, 2003 5:17 PM -0800, [EMAIL PROTECTED] is alleged to have said: Can someone point the way to some file upload script for webserver on unix/linux? --As for the rest, it is mine. Single file, batch, automated, manual, FTP, RCP, email, SCP, CVS, SFTP, remote, local, we

Re: Parsing for base domain

2003-11-16 Thread R. Joseph Newton
drieux wrote: > But there is this minor little problem, the fly in the ointment > > nas.nasa.gov > > it happens to BE the domain name - yes it is in the 'nasa.gov' > name space - but it is it's own domain to which the 'host' > component would be the www as in: > > www.nas.nasa.gov

Re: references and objects

2003-11-16 Thread R. Joseph Newton
angie ahl wrote: > Hi everyone > > I'm failing to find something in the manuals (or at least the bit I'm > missing ;) > > I have an package called "Event" > > in it I have a subroutine called EventList > > sub EventList { > my ($class, %arg) = @_; > # load of code here > return ([EMAIL

GUI v. CLI was Re: Starting Perl

2003-11-16 Thread drieux
On Sunday, Nov 16, 2003, at 13:19 US/Pacific, R. Joseph Newton wrote: Rob Dixon wrote: Joseph wrote: I don't mind it for source files, but having to type "foo.pl" to run the "foo" command strikes me as excessive user hostility. ..and so does double-clicking on the script icon? Which, to be fair, do

Re: Logging to a Server via ftp.

2003-11-16 Thread Wiggins d'Anconia
John wrote: Yes, logging into. Have you got a relevant script? What part of the documentation don't you understand? Where have you hit snags? Have you looked at the section "Use Examples"? Gonna have to put some effort into this... http://danconia.org - Original Message - From: "Wi

Re: How do you dynamically assign array names?

2003-11-16 Thread R. Joseph Newton
Douglas Houston wrote: > On Fri, 14 Nov 2003, Jeff 'japhy' Pinyan wrote: > > > On Nov 14, Douglas Houston said: > > > > >I am trying to initialize a dynamically-named array, > > > > You need to explain WHY you want to do this. There doesn't seem to me to > > be a good reason. Use a hash of array

Re: How do you dynamically assign array names? [slightly OT: enabling folly]

2003-11-16 Thread R. Joseph Newton
Wiggins d Anconia wrote: > > Douglas Houston [mailto:[EMAIL PROTECTED] > > : > > : WHY do I need to explain why I want to do this? > > > > Because no one wants to give a loaded gun to > > someone who hasn't demonstrated a good grasp of > > gun safety. > > > > > > That is a very ironic respons

Re: How do you dynamically assign array names?

2003-11-16 Thread R. Joseph Newton
Steve Grazzini wrote: > use strict; > my $name = 'foo'; > > $::{$name} = [1,2,3]; # LHS is a glob > print "@{ $::{$name} }\n"; > > no strict 'vars'; > print "@foo\n"; Cool. The "Second Amendment" response ;-o) Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: How do you dynamically assign array names?

2003-11-16 Thread R. Joseph Newton
david wrote: > David wrote: > > >> this normally can't be done cleanly and is generally not recommanded > >> given there are other ways to accomplish bascially the same thing. > > Steve Grazzini wrote: > > > > > But why use the symbol table at all? That's more dangerous > didn't i already mentio

Re: Capturing system call output value

2003-11-16 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Thanks that help. but I notice there is a newline included in the variable > when using the ($name)=`uname -n`; > > Is this a normal thing that I should strip? > perldoc -f chomp Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

Re: text replacement+

2003-11-16 Thread R. Joseph Newton
Kiko Uehara wrote: > Hi everyone, > > I have a following data to analyze : > - > BlockA > color 0 0 0 > rcolor 1 1 1 > dcolor 2 2 2 > > BloackB > color 0 0 0 > rcolor 1 1 1 > dcolor 2 2 2 > (...and so on) > - > > I want to replace

Re: Getting the best answer(WAS: RE: How do you dynamically assign array names?)

2003-11-16 Thread R. Joseph Newton
Tim Johnson wrote: > -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > > How can anyone suggest what the 'alternatives' may be without an > > explanation of the problem? > > > > Rob > > When submitting a question to the list, try to answer these questions: > > What problem w

Re: What $| actually does?

2003-11-16 Thread R. Joseph Newton
John wrote: > Well, in the beginning of every script, the $|=1 should be placed. Am i > right? No. You are probably thinking of : use strict; use warnings; Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Logging to a Server via ftp.

2003-11-16 Thread R. Joseph Newton
John wrote: > Yes, logging into. > > Have you got a relevant script? You should probably check in with news://nntp.perl.org/perl.jobs and let people there know that you have a job available. This is a list for people who are interested inlearning to use Perl. Joseph -- To unsubscribe, e-mail

Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
Guardian Angel wrote: > > I was looking for the > and < operators. I had used them with backticks > (but gave a error message, because it was a "greater then" value, > because i left spaces like print $a > $b instead of print $a>$b > But now... i want to be more precise with my script. > So i

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
drieux wrote: > I on the other hand have had the unpleasantry of FORGETTING > that I was whacking new code in that was doing a 'select'. > > So one solution is to make sure that IF you do a select that > you put things back where you found them, eg: > > my $oldfh = select($newfh); >

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
drieux wrote: > yes, in the sense that it comes in the section about > > select RBITS,WBITS,EBITS,TIMEOUT > > and as long as the person stays safely with the 'simpler' > perl select, and does not wander off into having buffered > and unbuffered file handles, then clearly it is "out of co

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, R. Joseph Newton said: >sometimes. The perfect setup for the great Perl anonymous block: > >{ >$| = 1; > do stuff that really needs to be autoflushed >} # Get things back to normal I think you want a 'local' in front of that $| line. { local $| = 1; # ... }

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > ...or better yet, to redo your code a little, and write to and read > from explicitly-selected filehandles. Duh. That should have been "explicitly-speciifed". Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to pass multi array as args

2003-11-16 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > > sub mysub { > > my( $x, $y, $z ) = @_; > > Can I have three arrays instead? Sure, if you don't mind having all items from all lists offered as arguments laoded into the first array. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Passing and returning values from another script?

2003-11-16 Thread R. Joseph Newton
David Storrs wrote: > > my $output = join("",