Re: Scalar References - oxymoron?

2017-04-04 Thread Peter Scott
ou want something light and immutable. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=9780133036268 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Forking as another user

2016-03-13 Thread Peter Scott
r while loop, only one client can connect at a time. > > What modification can prevent zombies yet allow multiple concurrent > clients to attach? You need the WNOHANG option on your wait() to make it nonblocking. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ ht

Re: Operand evaluation order

2014-03-17 Thread Peter Scott
r, is 4, 4, and 5. This leads me to believe that > operand evaluation is either non-deterministic and compiler-dependent, > or it's simply broken. Kudos for the curiosity. Did you have any other reason for wanting to know how this worked in Perl? -- Peter Scott http:/

Re: question about perl 6 sigils

2013-09-29 Thread Peter Scott
use of $ for scalar elements. Damian and Larry determined that they could remove this small speed bump without any damage to the language. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.oreillyschool.com/certificates/perl-programming.php http://www.informit.co

Re: Who instantiated an object

2013-05-31 Thread Peter Scott
lly considered a bad practice now. See http://search.cpan.org/~petdance/Perl-Critic-Bangs-1.08/lib/Perl/Critic/ Policy/Bangs/ProhibitRefProtoOrProto.pm and near the end of http:// www.stonehenge.com/merlyn/UnixReview/col52.html. -- Peter Scott http://www.perlmedic.com/ http://www.perlde

Re: hash issue

2013-04-19 Thread Peter Scott
e is specific code in the internals to make it safe: https:// groups.google.com/forum/?hl=en&fromgroups=#!topic/comp.lang.perl.moderated/ _J9aO8pdAVc -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http:

Re: Proposed correction for my long script

2012-09-16 Thread Peter Scott
nstall your own timeout: alarm $MAX_PERMISSIBLE_RUN_TIME; $SIG{ALRM} = sub { die "Exceeded $MAX_PERMISSIBLE_RUN_TIME timeout" }; -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillysch

Re: My script is OUT OF CONTROL!

2012-09-13 Thread Peter Scott
mess of HTML back that'll be tedious to validate. This is the point at which you learn about separation of responsibilities and the Model-View-Controller pattern if you want to improve how you do this in the future.) -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged

Re: Using different libraries dynamically

2012-09-12 Thread Peter Scott
to switch which path to fetch. Something like (pseudo code, untested): use MyEnv; # Sets $MyEnv::Env_Type BEGIN { require lib; lib->import( $MyEnv::Env eq 'dev' ? '/path/to/dev' : '/path/to/prod' ); } -- Peter Scott http://www.perlmedic.com/ http://www.per

Re: parsing multiple logins logs (create a unique hash name for every user)

2012-09-10 Thread Peter Scott
{ $hash{$outer_key} } ) { print "\t$inner_key: $hash{$outer_key}{$inner_key}\n"; } } -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-programming.php

Re: Perl Code

2012-08-31 Thread Peter Scott
On Sat, 01 Sep 2012 04:05:31 +, Peter Scott wrote: > On 2012-08-29, at 12:46 PM, Ashwin Rao T wrote: >> 1)Check if IP address is in the range 172.125.1.0 and 172.125.25.0 >> using only return functions & regular expressions in Perl. > > /\b172\.125\.(\d+)\.((?>\d

Re: Perl Code

2012-08-31 Thread Peter Scott
)|| ($1==25 && $2==0) ? "" : "(*FAIL)"})/ and say "Strictly correct answer that shows instructor didn't think about the question" Do let us know what grade that gets you :-) -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.

Re: Unblessed reference problem

2012-05-20 Thread Peter Scott
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > Note that I think I saw a way to return the flattened array in Moose, > but I don't remember the specifics. auto_deref => 1 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.info

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Peter Scott
ou don't find the methods you're looking for in the class itself, try superclasses. This is one case where the structured nature of documentation in more rigid languages has an edge over Perl. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://ww

Re: Using the ternary operator to concat a string not working like I think?

2012-04-07 Thread Peter Scott
the worst" or $test{two} .= " is the best"; print for values %test' first is the worst second % perl -le '%test = qw(one third two second); $test{one} eq "first" and $test{one} .= " is the worst" or $test{two} .= " is the best"; print

Re: Why do I get a warning?

2012-03-25 Thread Peter Scott
On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: > no one uses braces for single scalar handles in general. I do. Ever since Damian recommended it (Perl Best Practices, page 217). One of those numerous times I didn't agree with him until I tried it, then found he was right. -

Re: Transitioning from BASH to Perl

2012-03-18 Thread Peter Scott
tutorials/books > which deals with this kind of approach? Tim Maher's "Minimal Perl" was designed for your kind of requirement: http://www.amazon.com/Minimal-Perl-UNIX-Linux-People/dp/1932394508 . -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/

Re: run command from perl

2012-03-03 Thread Peter Scott
On Fri, 02 Mar 2012 21:31:50 +0100, Manfred Lotz wrote: > Another question I have: Where do I find what '-|' means? I mean the > minus before the pipe char. perldoc -f open -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/p

Re: run command from perl

2012-03-01 Thread Peter Scott
s the code ok, or could it be improved, or has it even flaws? It doesn't have flaws. You could do it without the module with a piped open: sub run_cmd { my $cmd = shift; open my $fh, '-|', "$cmd 2>&1" or die "open: $!"; print while <$fh>

Re: How to compile just the current perl module, ignoring all the other included modules

2012-01-25 Thread Peter Scott
e post details. It sounds like some module is doing ridiculous computations in its main code instead of being encapsulated in subroutines. It should be tracked down and shot^Wrefactored. That's likely to cause all kinds of problems, so working around it like you're trying isn't

Re: Difference between <> and grep EXPR, <>

2012-01-19 Thread Peter Scott
value*... Because grep is defined to return the number of elements in scalar context. Keep reading perldoc -f grep one more sentence: In scalar context, returns the number of times the expression was true. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www

Re: Regex : Extract data between { } spanning in multplie lines

2011-12-26 Thread Peter Scott
{.*$/m' file.txt I can extract > data by grouping after \{ in regex but how to span over multiple lines > and make this work. Need pointers. May I suggest http://search.cpan.org/dist/Text-Balanced/ for this type of endeavor. -- Peter Scott http://www.perlmedic.com/ http://www

Re: FW: Perl to python converter

2011-12-26 Thread Peter Scott
ienced Perl programmer that you find on somewhere like Perlmonks, and advertise that you have XML/XSLT experience to bring to the party. On this list, your options are more or less limited to asking how you can become a better Perl programmer. -- Peter Scott http://www.perlmedic.co

Re: ipc question

2011-12-15 Thread Peter Scott
nt a named pipe. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-programming.php -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-ma

Re: File health check on *nix system using stat

2011-12-12 Thread Peter Scott
s you don't come away thinking that this is really how you would test to see if you could read a file. I see people using access checks all the time when they should simply be testing that they can open() the file instead. -- Peter Scott http://www.perlmedic.com/ http://www.perldeb

Re: File health check on *nix system using stat

2011-12-10 Thread Peter Scott
to the code context, here > it is saying the file is NOT ok What is the program trying to accomplish? What does "ok" mean for a file in the context of this exercise? The empirical derivation from the code doesn't seem useful. -- Peter Scott http://www.perlmedic.com/

Re: Simulate `sh -x'

2011-12-03 Thread Peter Scott
On Jun 24 2002, 4:44 am, davidtg-perl-beginn...@justpickone.org (David T- G) wrote: > ...and then Peter Scott said... > % >% Would you like tracing that goes off when you go into a function? Suppose > % >% if you gave a numeric argument to 't' it would trace up to that d

Re: Make a script to run multiple scripts

2011-12-03 Thread Peter Scott
erl script to run multiple scripts. I could just add to this file as > needed if more scripts are created. What is the best way to do this? Consider spawning code rather than programs and using Parallel::ForkManager: http://search.cpan.org/~dlux/Parallel-ForkManager-0.7.9/lib/Parallel/ ForkM

Re: passing arguments to perl function with - in the string

2011-11-29 Thread Peter Scott
rnal help. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-programming.php -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: be

Re: Perl module for Gmail

2011-11-29 Thread Peter Scott
ad and leave them on the server. > > those emails must be stored "appended" in a file on the local hard > drive. I do this with Net::IMAP::Client. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=01370012

Re: Fwd: RE: overriding a custom compiled perl binary

2011-11-16 Thread Peter Scott
@INC compiled in as long placeholder strings that their installation tool then modified for the local installation. So theoretically you could edit the binary to replace the paths with anything the same length or shorter. As if you weren't out on a long enough limb already. -- Pete

Re: Taint mode CGI problem

2011-11-11 Thread Peter Scott
eferer: http://frodo/crap.html"; perldoc perlsec. You haven't untainted $search. Consider embedding the LDAP search functionality in your CGI, or better yet, abstracting it to a common module used by both search.pl and your, er, crap.pl. Code duplication is so enervating. -- Peter

Re: bootstrap.pl for setting up my machine

2011-11-01 Thread Peter Scott
e to interface with the program. E.g. if > there are multiple flavors for some package, `pkg_add` might prompt me > which one to install. system() will still let *you* interface with pkg_add. Do you want your program to be able to interface with pkg_add instead? -- Peter Scott http://ww

Re: Help with Getopt::Std

2011-10-22 Thread Peter Scott
ary tree, from one point of view anyway. There's even a program a2p that comes with perl (http:// perldoc.perl.org/a2p.html) for making transitioning automatic, if not easier. Post what you're having trouble with here and we can help. -- Peter Scott http://www.perlmedic.com/ htt

Re: Updating Perl without admin

2011-10-13 Thread Peter Scott
get. Is there a work around? Install one or both to a directory you can write to and put it in your path. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-pro

Re: How to put an AND in a regex?

2011-10-13 Thread Peter Scott
want. So I need something that does the equivalent > of "Don't match this AND don't match this". Is this possible in a if > loop, or should I use something else? Am I missing something about why this approach won't work for you: if ( ! /\A[[:uppe

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Peter Scott
impacts your application noticeably? Because programmer time is, in the absence of proof of anything else, the most precious resource, and so anything that takes longer than typing use CGI; is overkill. Especially if it requires downloading something not in core. -- Peter S

Re: running perl script from inside another script & collecting output in array

2011-09-15 Thread Peter Scott
lledscript.pl"; > } > > issue is, the called script prints some filenames after completion to > STDOUT. how can i collect them into an array variable? You would be better off calling it with backticks. Otherwise you have to try fragile techniques such as tying fi

Re: how to calculate the uncover region

2011-09-13 Thread Peter Scott
Here's an approach: $ cat differ #!/usr/local/bin/perl use strict; use warnings; use Set::IntSpan; # http://search.cpan.org/perldoc?Set%3A%3AIntSpan my ($diff, @sets) = map { Set::IntSpan->new( $_ ) } qw(1-100 1-20 2-28 50-100 5-38); $diff -= $_ for @sets;

Re: Accessing IMap accounts messages via Perl.

2011-09-03 Thread Peter Scott
On Sat, 03 Sep 2011 13:39:47 +0200, werner wrote: > Am 03.09.11 13:31, schrieb Sean Murphy: >> All. >> >> How can I access my IMap messages from Google via Perll. I wish to >> extract the message body only. > how about Mail::IMAPClient? Or Net::IMAP::C

Re: unit test case for this perl code

2011-09-03 Thread Peter Scott
here do they send their results? Without knowing those things any well-meaning answers you could get here would probably lead you in the wrong direction. Tell us what you find out. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/p

Re: regex negative looking up a backtrace

2011-08-26 Thread Peter Scott
aining candidate /x ? "$1\[$2\]${^POSTMATCH}" : "FAIL: $_"; } %proggie ab[t]able zzab[t]able FAIL: abcabc [z]bbb abcdefabcdef[g] [q] FAIL: qqq -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=013700

Re: How to grab last element of array from split with no temporary variables?

2011-08-14 Thread Peter Scott
On Thu, 11 Aug 2011 23:30:32 -0700, John W. Krahn wrote: > Peter Scott wrote: >> On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote: >>> Is there a way to do it with less typing? How can I do it without >>> creating a temporary variable "@p"? Thanks, sieg

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread Peter Scott
ry variable "@p"? Thanks, > siegfried > > find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_, > "./$p[$#p].txt" } ' Try this: find /xyz -type f -print0 | perl -F/ -0lane 'rename $_,"$F[-1].txt" or warn $!'

Re: Choosing between look up tables

2011-07-09 Thread Peter Scott
in a single file if there's not much of it, multiple files if you want to partition responsibility for updating new product types, or a database if it's really dynamic. Don't create reams of code that initializes arrays to literal lists, it's excruciating to read. -- P

Re: discover all packages subclassing some other package

2011-06-11 Thread Peter Scott
ate the ->ALL_PACKAGES<- list? Class::Inspector->subclasses. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: beginners-unsubs

Re: timestamp with milisecond

2011-06-03 Thread Peter Scott
ng. Like so: $ perl -MPOSIX=strftime -MTime::HiRes=time -le '$t = time; $s=sprintf "% 06.3f", $t-int($t/60)*60; print strftime "%H:%M:$s %d:%m:%Y", localtime $t' 20:38:44.551 03:06:2011 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http:

Re: how to do absolute redirect in perl

2011-06-02 Thread Peter Scott
{absolute => 1}); > does not work someone please help Please provide a complete script of under 20 lines that we can run, tell us what output you see from running it, and what output you think you should see instead. -- Peter Scott http://www.perlmedic.com/ http://www.perlde

Re: Ten Years of Considerate Help

2011-05-31 Thread Peter Scott
uest a thread be closed, there isn't a response of, "So who put you in charge... oh yeah." This doesn't have to be difficult. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschoo

Re: Remove all HTML tags

2011-05-21 Thread Peter Scott
g is called for based on specific knowledge of the page. Although if all you want the text content for is further machine processing like checksums, concordance, or indexing, then this is fine. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit

Re: [OT] Good Perl ISP's

2011-05-21 Thread Peter Scott
ajor modules too, although I'm not sure exactly which ones right now. And cpan ExtUtils::MakeMaker won't help since core comes before site in @INC. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 ht

Re: Rounding Date/Time

2011-05-06 Thread Peter Scott
enerate a time that didn't exist in your locale, e.g. 2am on a day that the clocks advanced. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscr

Re: special method name start with "_"

2011-04-28 Thread Peter Scott
wrapper around it. Perl provides enough flexibility to do all kinds of things. See http://search.cpan.org/perldoc?MooseX::Privacy. (That's Moose-X, not Moo-Sex.) Class::Std can do this too. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informi

Re: Fwd: how to parse complex table

2011-04-24 Thread Peter Scott
ore the while loop now and you've gotten rid of some more duplication and unnecessarily wide scoping. > Many thanks again! Must've spent ~ 4 days on this. I've been flirting > with Perl less than a year, it's so seductive I find myself debating > whether to go bac

Re: Ten Years of Considerate Help

2011-04-23 Thread Peter Scott
out, someone can be in the right tail in one discipline, like bioinformatics, and in the middle in another - like Perl. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/per

Re: Creating web pages using Perl.

2011-04-23 Thread Peter Scott
functions or methods with the same names as the elements. It was very popular at one time although templating makes a lot more sense. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool

Re: sample distribution

2011-04-19 Thread Peter Scott
gotten with a solution? Or if you're just posing a question as a challenge for people to exercise their brains, this would be better off in the Perl Quiz-of-the-Week list (which hasn't seen any traffic in aeons). -- Peter Scott http://www.perlmedic.com/ http://www.perlde

Nature of this list

2011-04-19 Thread Peter Scott
that mode after a while but this one at least had a good run and I'll be sorry if I end up leaving it too. Andy Lester had a good article about this: http://perlbuzz.com/2010/11/ think-for-perls-sake.html. But judging from the responses it seems he and I may be in a m

Re: format output from system command

2011-04-16 Thread Peter Scott
tic is based on), I'd hope you'd follow the one that says to not create bareword filehandles. I adopted the PBP recommendation to always wrap the lexical filehandle in curlies when using it as the indirect object, and I like the result a lot. -- Peter Scott http://

Re: Alternative to goto

2011-04-16 Thread Peter Scott
e about what would be at best milliseconds of execution speed more than maintainability? Seems like you'd be better off programming in assembler if that's your priority. Execution speed hasn't been a primary concern since the '70s, if it was even one then. -- Peter Sc

Re: Alternative to goto

2011-04-14 Thread Peter Scott
s thread and I'm just curious. If goto is so > bad, why did they add it to Perl? Perl's goto is pretty old. Larry was feeling permissive and in a frame of mind to make BASIC programmers happy. He regrets it. The perldoc for goto says he has never found a reason to us

Re: Alternative to goto

2011-04-14 Thread Peter Scott
means, as I have had no problem > writing a 'goto' targetting such labels. I wonder if this is a mistake > in the documentation, or it is simply saying that such a goto is > deprecated? Mistake by the look of it. To the discoverer go the rights of perlbug :) -- Peter Scott http://

Re: Calling subroutines with the & sigil

2011-04-14 Thread Peter Scott
like it's a built-in function. However, just so it makes more > sense to me and to be on the safe side, I've renamed it "if_routine". -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274

Re: Alternative to goto

2011-04-14 Thread Peter Scott
GOTO than without it. Shorter, maybe; faster, maybe, but not clearer. Even if I ever did, it would be the exception that proved an unusually universal rule. Any possible justification for a GOTO would be so arcane that it is counterproductive to suggest it at all in a beginner's group.

Re: Calling subroutines with the & sigil

2011-04-13 Thread Peter Scott
e profiled it to find out where the bottleneck is (hint: it's not likely to be in subroutine call overhead). -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To u

Re: Alternative to goto

2011-04-13 Thread Peter Scott
DF . I have never, ever, seen a situation where the use of goto would have resulted in clearer code. Considering it has always indicated to me that the person considering it has not understood the problem properly or modeled its solution well. Goto simply is not part of the vocabulary of clear coding

Re: perl dd

2011-04-02 Thread Peter Scott
SV = IV(0x8a367c4) at 0x8a367c8 REFCNT = 2 FLAGS = (IOK,READONLY,pIOK) IV = 10 SV = NV(0x8a4aef0) at 0x8a367d8 REFCNT = 2 FLAGS = (NOK,READONLY,pNOK) NV = 100 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/p

Re: perl dd

2011-03-31 Thread Peter Scott
ture your intention even better :-) -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional command

Re: shift oo

2011-03-23 Thread Peter Scott
On Tue, 22 Mar 2011 13:41:59 -0700, Randal L. Schwartz wrote: >>>>>> "Peter" == Peter Scott writes: > >>> my $s = Streamer->new; >>> my $app = sub { >>> return sub { >>> $s->open_fh; >>> my $writer = shift->( &

Re: sub routine

2011-03-19 Thread Peter Scott
here to teach you how to solve problems, not solve them for you. You might still get solutions - like you did here - but things will go better when you ask for learning instead. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/pr

Re: shift oo

2011-03-19 Thread Peter Scott
subroutine for this code to work. It is not therefore an object (technically, it could be - it could be blessed - but that is beside the point, nothing in this code expects it to be an object). You need to be very conversant with code references and functional programming to be comfortable

Re: MRF-ERROR: Is a directory

2011-03-17 Thread Peter Scott
d you write the program you posted or did someone else? Do you understand it? -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: beginners-unsub

Re: How does the function loading works in Perl

2011-03-02 Thread Peter Scott
e never seen it used in practice. There are a fair number of modules on CPAN using it. And in the core: POSIX, for instance. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/cour

Re: x,y axis graph

2011-02-16 Thread Peter Scott
n: http://search.cpan.org/~dmaki/Google-Chart-0.05014/lib/Google/Chart.pm -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: beginners-unsubscr...

Re: understanding the ||= operator

2011-02-13 Thread Peter Scott
eems to happen either way: $ perl -E 'tie $x, "F"; tie $y, "F"; say "Orcish:"; $x ||= $y; say "Unwrapped:"; $x = $x || $y; say "Done"; sub F::TIESCALAR{ bless [], "F" }; sub F::AUTOLOAD{ say $F::AUTOLOAD } ' Orcish:

Re: Dereference Links

2011-01-23 Thread Peter Scott
updated since 2001. You'll have a much easier time using WWW::Mechanize and many more people will be in a position to help you. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.co

Re: Function to print Object properties

2011-01-06 Thread Peter Scott
$fob = {}; $fob = bless {}, "HASH"; for instance. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: beginners-unsubsc

Re: advangtes of Perl on various languages

2011-01-06 Thread Peter Scott
y interfaces? All of those possibilities and more would have radically different answers and you have not provided any information to differentiate between them. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?is

Re: advangtes of Perl on various languages

2011-01-03 Thread Peter Scott
else? If you're asking in regard to your own career path then we'd need to know a lot more about what your priorities and background are. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.or

Re: 1st line of perl script

2011-01-03 Thread Peter Scott
On Tue, 04 Jan 2011 01:09:56 -0500, George Worroll wrote: > On Windows, that line is just a comment. Neither the operating system > nor the interpreter does anything with it. Not quite. Any options on the line (e.g., -T) will be activated. -- Peter Scott http://www.perlmedic.com/

Re: perl training material and excercises for freshers

2011-01-03 Thread Peter Scott
se send me good suggestions also for training. Web-based training with instructor feedback at the O'Reilly School of Technology: http://www.oreillyschool.com/courses/perl1/ -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Peter Scott
ta http form submission with a file-upload part and > hoping that Perl is seeing the same thing. True, it won't be easy, but if you can come up with a test for whatever bug you are experiencing, it will be invaluable for saving time later. -- Peter Scott http://www.perlmedic.com/

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Peter Scott
nvoke the debugger in this situation. Rather than retype it, I googled and found it in a Perl Journal article saved at http:// www.foo.be/docs/tpj/issues/vol4_3/tpj0403-0008.html . -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/sto

Re: Monitoring ssh connectivity to a server using perl !

2010-11-23 Thread Peter Scott
ning to port 22: perl -MNet::Ping -le '$p=Net::Ping->new; $p->port_number(22); $p->ping (localhost) or warn "SSH down"' -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreill

Re: Email Filter Script

2010-10-22 Thread Peter Scott
messages, but in the > process it severely alters the messages in the following ways: Can you create a redirection rule instead? http://office.microsoft.com/en-us/outlook-help/automatically-forward- messages-to-another-e-mail-account-HA001150201.aspx -- Peter Scott http://www.perlmedic.com/

Re: perl for systemadministration

2010-10-20 Thread Peter Scott
On Wed, 20 Oct 2010 17:09:17 +0530, Jyoti wrote: > I need your help. Please tell me a good book for perl for system > administration. "Perl for System Administration" -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/p

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Peter Scott
ace. This is analogous to asking your auto mechanic what the feeding habits of emus are because you used your car to drive to the zoo. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.co

Re: How can I open a remote ssh session with perl

2010-08-28 Thread Peter Scott
psuedo terminal. I do not want to execute command on server > it should be examined via my script and then it should get executed . > Let me know if this is possible using perl or I have to use any other > scripting language like python. Yes, the documentation for Net::SSH::Perl explains ho

Re: How can I open a remote ssh session with perl

2010-08-27 Thread Peter Scott
x27;re not going to run top -cd2 this way, that's an interactive program that won't terminate without user input. Neither will iostat 1 terminate; but iostat 1 10 works fine, just got to wait 10 seconds. I don't see anything in your pstree output that looks trunc

Re: How can I open a remote ssh session with perl

2010-08-26 Thread Peter Scott
a server and credentials of my own and it worked fine with several commands including pstree. So you have some problem specific to your configuration that needs debugging. Either the module isn't built right, you have the wrong credentials, you aren't connecting, or the remote

Re: How can I open a remote ssh session with perl

2010-08-24 Thread Peter Scott
SSH::Perl . -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl1/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...

Re: Perl obfuscator

2010-08-23 Thread Peter Scott
rs, that I know of, work by encoding the text > somehow, not by modifying what perl sees. http://www.stunnix.com/prod/po/overview.shtml : Now, I haven't used it. But it does claim to be an exception to your rule. The users manual has a section on what to do about symbolic name construction

Re: Perl obfuscator

2010-08-21 Thread Peter Scott
er can make, trying to understand and change a large body of code that has the worst names possible may not be impossible, but still is excruciating. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=013700127

Re: How to become a perl architect !

2010-07-02 Thread Peter Scott
On Fri, 02 Jul 2010 23:00:48 +0530, Amit Saxena wrote: > On Fri, Jul 2, 2010 at 9:41 PM, Peter Scott wrote: > >> On Fri, 02 Jul 2010 09:34:05 +, Amit Saxena wrote: >> > I have around 6+ years of IT experience as a software development >> > mailing in scr

Re: How to become a perl architect !

2010-07-02 Thread Peter Scott
rt. Also please tell me any resources > which could help me. I have been developing in Perl for 20 years and doing enterprise architecture for 10 years. But I have no idea what a "Perl architect" is. Please explain in more detail. -- Peter Scott http://www.perlmedic.com/

Re: Conditionally use

2010-06-14 Thread Peter Scott
On Mon, 14 Jun 2010 11:23:34 -0700, kenTk wrote: > How can I conditionally use a module? perldoc if -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl1/ --

Re: When to use anonymous references

2010-05-01 Thread Peter Scott
On Wed, 28 Apr 2010 01:16:16 -0400, Uri Guttman wrote: >>>>>> "PS" == Peter Scott writes: > > PS> On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote: > >> I've just realised I almost never use named arrays or hashes > >> any

Re: When to use anonymous references

2010-04-27 Thread Peter Scott
s? I create arrays and hashes by default, not references to anonymous versions. I'd sooner not be putting arrows in unnecessarily. I can always enreference an aggregate in the call to a sub. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.inform

Re: about dispatch tables

2010-04-24 Thread Peter Scott
ference to a subroutine that does what you want, including passing arguments to the subroutine you thought you wanted to call in the first place: $code = sub { whatever( $arg1, $arg2 ) }; -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/stor

Re: free memory

2010-04-13 Thread Peter Scott
have enough entries that memory is a problem then I think you have two reasons already for migrating to a database. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl1/

  1   2   3   4   5   6   7   8   9   10   >