Re: Where is the error

2010-03-25 Thread Uri Guttman
> "HP" == Harry Putnam writes: HP> open(SENDMAIL,"|$sendmail $recip") or die "Can't open <$sendmail>: $!"; HP> while () { what is that line supposed to do? it reads from the SENDMAIL handle which is opened for WRITING. why do you think you need that or even to loop over that h

Where is the error

2010-03-25 Thread Harry Putnam
Back again apparently due to blindness. The code looks terrible, partly because I just modified a piece of code from a much larger script, to work standalone. Any remaining slop is just poor skill. I'm having trouble spotting why this code doesn't mail any of what is supposed to get mailed, ins

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Shawn H Corey
On Thu, 25 Mar 2010 19:54:48 +0200 Shlomi Fish wrote: > Well, this is a bike shed argument. I find using "shift;" instead of > "shift(@_);" when inside subroutines to be faster to write, more > concise and more idiomatic. shift has this magic for a reason. I'm > unlikely to use shift the other wa

Re: Getting garbage fast

2010-03-25 Thread Jay Savage
On Wed, Mar 24, 2010 at 5:15 AM, Philip Potter wrote: > On 24 March 2010 00:56, Eric Veith1 wrote: >> Sam wrote on 03/23/2010 11:18:11 PM: >>> Could you use a file of random data? You can create one of those really >>> easy: dd if=/dev/urandom of=ranfile bs= >> >> Theoretically, yes, of cour

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Shlomi Fish
On Thursday 25 Mar 2010 18:52:09 Shawn H Corey wrote: > On Thu, 25 Mar 2010 17:13:53 +0200 > > Shlomi Fish wrote: > > sub display_page > > { > > > > my $a_server = shift; > > my $a_pass = shift; > > . > > . > > . > > > > } > > }}} > > > > (shift is short for << shift(@_) >>

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Shawn H Corey
On Thu, 25 Mar 2010 17:13:53 +0200 Shlomi Fish wrote: > sub display_page > { > my $a_server = shift; > my $a_pass = shift; > . > . > . > } > }}} > > (shift is short for << shift(@_) >> ) If you're going to use shift, name the array. my $var; sub foo { $var = shi

Re: reutun undef

2010-03-25 Thread Uri Guttman
> "JP" == Jeff Peng writes: JP> Thanks all. JP> for "return ()", does it mean return an empty list, or return with no argument? return ; and return() are the same thing. whether it returns an empty list or undef is determined by the caller's context. uri -- Uri Guttman -- u...@

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Shlomi Fish
On Thursday 25 Mar 2010 16:04:01 Pry, Jeffrey wrote: > That was exactly what I was looking for! Thank you so much! > > - Jeffrey Kevin Pry > > -Original Message- > From: Gorrebeeck, Robert [mailto:gorrebeec...@cvty.com] > Sent: Thursday, March 25, 2010 10:01 AM > To: Pry, Jeffrey > Subjec

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Damon Allen Davison
On Thu, Mar 25, 2010 at 1:54 PM, Pry, Jeffrey wrote: > sub displayPage($) { > >my($server) = shift; >print $server; > } > Hi, I'd repeat the advice about staying away from prototypes, i.e. the '($)' business after your subroutine name. Perl is very good at figuring out wh

Re: Subroutines With Multiple Parameters

2010-03-25 Thread Shawn H Corey
On Thu, 25 Mar 2010 09:54:13 -0400 "Pry, Jeffrey" wrote: > Hey, > > I have a subroutine > > sub displayPage($) { > > my($server) = shift; > print $server; > } > > Which I can call using displayPage("servername"); > > My question is lets say I wanted to pass a password

RE: Subroutines With Multiple Parameters

2010-03-25 Thread Pry, Jeffrey
That was exactly what I was looking for! Thank you so much! - Jeffrey Kevin Pry -Original Message- From: Gorrebeeck, Robert [mailto:gorrebeec...@cvty.com] Sent: Thursday, March 25, 2010 10:01 AM To: Pry, Jeffrey Subject: RE: Subroutines With Multiple Parameters Jeffery When you call you

Subroutines With Multiple Parameters

2010-03-25 Thread Pry, Jeffrey
Hey, I have a subroutine sub displayPage($) { my($server) = shift; print $server; } Which I can call using displayPage("servername"); My question is lets say I wanted to pass a password as well. So I would like to call it as displayPage("servername","mypassword"); How

Re: good books for novice perl beginners

2010-03-25 Thread Shlomi Fish
On Wednesday 24 Mar 2010 20:16:40 NAKO wrote: > Hello All, > > Can you please recommend some good books for novice beginners? Thanks > > NAKO You can find a definitive list (and many other resources) on the Perl Beginners' Site: http://perl-begin.org/ Regards, Shlomi Fish -- --

Re: perl system return 256

2010-03-25 Thread syd_p
On 20 Mar, 22:43, rvtol+use...@isolution.nl ("Dr.Ruud") wrote: > syd_p wrote: > > On 18 Mar, 23:10, rvtol+use...@isolution.nl ("Dr.Ruud") wrote: > >> syd_p wrote: > >>> The embedded system call fails ie  returns 256 [i caught the code with > >>> a $ret = system (" /usr/bin/cat /tmp/TT.sql | /tmp/TT

Re: Object Oriented

2010-03-25 Thread Jeremiah Foster
On Mar 24, 2010, at 1:42 PM, Pry, Jeffrey wrote: > Does the moose page provide an OOP conceptual overview as well; if not does > anyone know where to find one? Not really. Moose is built upon Class::MOP which is a tool to manipulate object systems. Moose then goes on to build a complete, alter

Re: good books for novice perl beginners

2010-03-25 Thread Philip Potter
On 24 March 2010 18:16, NAKO wrote: > Hello All, > > Can you please recommend some good books for novice beginners? Thanks http://learn.perl.org/books.html is a good start. The rest of the http://learn.perl.org/ website is worth a look too, which is why it's linked in the footers of this mailing

Re: Object Oriented

2010-03-25 Thread Rene Schickbauer
Randal L. Schwartz wrote: "Steve" == Steve Bertrand writes: Steve> Also, quite a few years ago, I found "Learning Perl Ojbects, References Steve> and Modules" by Randal Schwartz to be quite a good primer and well worth Steve> the money. The new title of that ("new" being relative here, as in

good books for novice perl beginners

2010-03-25 Thread NAKO
Hello All, Can you please recommend some good books for novice beginners? Thanks NAKO -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Getting garbage fast

2010-03-25 Thread Rene Schickbauer
Hi! Theoretically, yes, of course I could just try to create an arbitrary sized file from /dev/urandom via dd. I hoped there would be an equally both fast and elegant solution possible as with the C approach (malloc without init). Bob's idea of just reading and piping files from /bin or /usr/

Re: reutun undef

2010-03-25 Thread Jeff Peng
Thanks all. for "return ()", does it mean return an empty list, or return with no argument? -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/