First line of input file not accessible.

2024-07-17 Thread Peter West via beginners
5 Scratch AppTest1-S1 test-bsq9w2vg2...@example.com 00DHF00RGNG2A4 Active2024-07-18 $ What happened to line 1? — Peter West p...@pbw.id.au `“Mary.” She turned and said to him in Aramaic, “Rabboni!”` -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

On Windows 7: Strawberry Perl Portable + Glade + GTK ?

2017-12-13 Thread Peter Schmitz
r changed to: (perl.exe:4036): libglade-WARNING **: unknown attribute `swapped' for . (perl.exe:4036): libglade-WARNING **: unknown attribute `swapped' for . (perl.exe:4036): libglade-WARNING **: unknown attribute `swapped' for . Any advice or suitable Perl using Glade examples would be much appreciated. Thanks very much! -- Peter

On Windows 7: Strawberry Perl Portable + Glade + GTK ?

2017-12-06 Thread Peter Schmitz
ssary, but I would prefer to avoid that if possible and to just get some appropriate GTK binaries, plus some set up guidance. I need to avoid impact to C:, so e.g., installing MSYS2 is not feasible in this situation. Thanks very much for any help. - Peter

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: Installing Net::SFTP

2017-03-20 Thread Peter Ezetta
Hi Uday, If you are using the package manager, you can run sudo yum install perl-Net-SFTP Regards, Peter On Mar 14, 2017, at 11:22 PM, Uday Vernekar mailto:vernekaru...@gmail.com>> wrote: Hello, Need some help on installing Net::SFTP perl module on RHEL. please guide. With Regards

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

Suddenly.... Part 2

2014-07-30 Thread Peter Holsberg
I think I've isolated the section that is not doing what I want. open (FHIN, "$recapfile") or die $!; my $indexb; ## for the recapfile array my $ofile; # Create new array containing all the lines of recapfile up to # the string RESULTS OF BOARD 1 XYZZY: while () {

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: Invoking a script in Windows 7

2014-03-09 Thread Peter Holsberg
Thank you. I will join the cygwin ML and ask there. On 3/8/2014 9:23 PM, Matt McAdory wrote: This isn't a perl programming issue, but a cygwin/windoze environmental execution issue. Please use the appropriate list to seek further assistance. http://cygwin.com/lists.html -- To unsubscribe, e-ma

Re: String in Array

2014-02-20 Thread Peter Gordon
"$name found"; } # Check "abc". unless ( grep { /$name1/ } @alarm ) {     say "$name1 not found"; } else {     say "$name1 found"; } [OUTPUT] ab found abc found -- Peter Gordon, pete...@netspace.net.au on 02/21/2014 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: String in Array

2014-02-20 Thread Peter Gordon
NOT 'do this'. >What >have I got wrong? > Use word boundaries #!/usr/bin/perl -w use 5.14.0;   my @alarm = ("xyz", "abc"); my $name = "ab"; unless (grep {/\b$name\b/} @alarm) { print "Not in array!\n" } -- Peter Gordon, pete...@netspace.net.au

Re: Help with a RE

2014-01-09 Thread Peter Gordon
more efficient than my RE. Thanks -- Peter Gordon, pete...@netspace.net.au on 01/09/2014 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Help with a RE

2014-01-08 Thread Peter Gordon
On Thu, 9 Jan 2014 10:57:00 GMT, Peter Gordon wrote: >I'm trying do write a one line RE to strip sequence numbers off >filenames.  The filename can may have: >No sequence numbers >or >Start with a variable number of digits, >Followed by an optional character between

Help with a RE

2014-01-08 Thread Peter Gordon
@ar ) { my $oldname = my $newname = $_; if( $newname =~ s/^\d+(.*)/$1/ ) { $newname =~ s/(?:[a-c])*(?:[-_])?(.*)/$1/; } say "$oldname\t\t$newname"; } -- Peter Gordon, pete...@netspace.net.au on 01/09/2014 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Regrex Question

2013-11-25 Thread Peter Gordon
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >Thunder Rain Internet Publishing >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- My attempt: #! /usr/bin/perl -w use 5.14.0; use strict; while( <> ) { if ( /(?:.*?)(\w+ \d+, \d+) at .*$/ ) { print "$1\n";

Re: Can't find perldoc in Cygwin

2013-11-17 Thread Peter Gordon
On Mon, 18 Nov 2013 00:35:17 -0500, Peter Holsberg wrote: >Peter Gordon  wrote: >>>On 11/18/2013 10:45 AM, Juan Wei wrote: >> >>>I have the Cywin version of perl installed on a Windows 7 >>>computer, and it does not have a perldoc executable. >>> >&

Re: Can't find perldoc in Cygwin

2013-11-17 Thread Peter Holsberg
Peter Gordon wrote: >>On 11/18/2013 10:45 AM, Juan Wei wrote: > >> I have the Cywin version of perl installed on a Windows 7 >> computer, and it does not have a perldoc executable. >> >> How can I get perldoc functionality? >> >Open a bash window &

Re: Can't find perldoc in Cygwin

2013-11-17 Thread Peter Gordon
>On 11/18/2013 10:45 AM, Juan Wei wrote: > I have the Cywin version of perl installed on a Windows 7 > computer, and it does not have a perldoc executable. > > How can I get perldoc functionality? > Open a bash window & type perldoc -h This should give you the documentatio

Re: Mojolicious::Lite and Net::Stripe

2013-10-03 Thread Peter Ezetta
I actually just discovered with the help of a few folks in IRC that this seems to work fine with JSON::XS installed, but not JSON::PP. I'm just going to run with JSON::XS for now, and open a ticket for the module maintainer. Thank you much for your response. Peter On Oct 3, 2013, at 3:

Mojolicious::Lite and Net::Stripe

2013-10-03 Thread Peter Ezetta
hu Oct 3 12:10:08 2013] [error] Attribute (paid) does not pass the type constraint because: Validation failed for 'Maybe[Bool]' with value JSON::PP::Boolean=SCALAR(0x7ffae4ced778) at constructor Net::Stripe::Charge::new (defined at /Users/peter/perl5/perlbrew/perls/perl-5.18.1/

Re: Need help with a programming problem

2013-10-02 Thread Peter Holsberg
Uri Guttman has written on 10/2/2013 8:39 PM: > On 10/02/2013 08:02 PM, Peter Holsberg wrote: >> Let me start over. >> >> The file I want to modify has a 6-digit filename and an extension htm. >> For example, 131002.htm > > i figured that was the case. you shoul

Re: Need help with a programming problem

2013-10-02 Thread Peter Holsberg
Let me start over. The file I want to modify has a 6-digit filename and an extension htm. For example, 131002.htm I'm working in Windows, with Strawberry perl, with Randall L. Schwartz's "Learning Perl", copyright 1993. I also have "Perl 5 Pocket Reference", 1998 and copies of "Programming Perl"

Re: Need help with a programming problem

2013-10-02 Thread Peter Holsberg
Shawn H Corey has written on 10/2/2013 2:29 PM: > On Wed, 02 Oct 2013 13:57:36 -0400 > Peter Holsberg wrote: > >> I was so upset that I deleted it all! It seems to me that >> it should be fairly straightforward, but at 79, the old synapses >> aren't firi

Re: Need help with a programming problem

2013-10-02 Thread Peter Holsberg
John SJ Anderson has written on 10/2/2013 1:45 PM: > On Wed, Oct 2, 2013 at 10:22 AM, Peter Holsberg > wrote: >> Hi, >> >> I have tried to do this for hours but it looks like it is just too >> difficult for me. > > You should maybe show the code you have,

Need help with a programming problem

2013-10-02 Thread Peter Holsberg
Hi, I have tried to do this for hours but it looks like it is just too difficult for me. I would like a script to open a file in the current directory and edit it. The file's name is \d{6}.htm The script then needs to search for a line that begins: Finally, it should jump to the line and r

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: checking for file existence

2013-09-25 Thread Peter Ezetta
Hi Renato, Welcome to Perl and to the list! I took a quick run through your code, and it's working fine for me. Are you calling it with "perl script.pl "? The behavior you describe almost sounds like you are not providing the argument when you call the script. Hope this was

Re: Always use strict

2013-08-05 Thread Peter Gordon
A_Value"; # No error produced. #!/usr/bin/perl use strict; $var = "A_Value" # Output # Global symbol "$var" requires explicit package name at ./t line 4. # Execution of ./t aborted due to compilation errors. #!/usr/bin/perl use 5.12.0; $var = "Avalue"; # Outpu

Re: Always use strict

2013-08-05 Thread Peter Gordon
to compilation errors. #!/usr/bin/perl use 5.12.0; $var = "Avalue"; # Output # Global symbol "$var" requires explicit package name at ./t line 4. # Execution of ./t aborted due to compilation errors. -- Peter Gordon, pete...@netspace.net.au on 08/06/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Always use strict

2013-08-05 Thread Peter Gordon
tions/use.html Does it mean that: use 5.12.0; automatically turns on "use strict;" ? -- Peter Gordon, pete...@netspace.net.au on 08/06/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: using join

2013-08-04 Thread Peter Gordon
$_]", @fruits; to the clipboard & entered it in a text editor, that I realised that the '' after "join" are two single quotes and not one double quote. -- Peter Gordon, pete...@netspace.net.au on 08/04/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: using join

2013-08-04 Thread Peter Gordon
eed the join if you are just printing it but i put >it there so you can use the same concept if you are going to >save the string. my $str = join (map "[$_]", @fruits); say $str; This code outputs a blank line & I can't see how to produce a string of the required output u

Re: module installation dir, site_perl, and perl -V:sitelib

2013-07-26 Thread Peter Gordon
lib? > On the off chance that you don't know about PERL5LIB, check http://preview.tinyurl.com/c2h35h6 (You can control the directories which are in @INC) -- Peter Gordon, pete...@netspace.net.au on 07/26/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Handling special characters in peoples names in XML

2013-06-25 Thread Peter Gordon
ther find out the encoding &/or change it to utf8. If you have a file with mixed encodings, you have my sympathies. -- Peter Gordon, pete...@netspace.net.au on 06/26/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perl hash loop: keys() vs values()

2013-06-15 Thread Peter Gordon
someone explain this please? > > Read http://www.tizag.com/perlT/perlhashes.php particularly the section on sort by keys & by values. This should give you a good understanding of the how to use them. -- Peter Gordon, pete...@netspace.net.au on 06/16/2013 -- To unsubscribe, e-mail: beginne

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

2013-05-19 Thread Peter Gordon
On Sun, 19 May 2013 09:16:33 -0700, John SJ Anderson wrote: >Our FAQ has a list of recommended resources: http://www.perl.org/learn/faq/beginners.html#books Heck, that list is dated.  Learning Perl is now in it's 6 th edition.   -- Peter Gordon, pete...@netspace.net.au on 05/20/2013

Re: map problems

2013-05-16 Thread Peter Gordon
,cn=xxx,dc=domain,dc=tld cn=group2,cn=xxx,d=domain group1 -- Peter Gordon, pete...@netspace.net.au on 05/17/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: module versions

2013-05-15 Thread Peter Eztta
How about using ExtUtils::MakeMaker or Module::Build and checking for the required version at build time? I suppose this doesn't address the desire to use a different version if the one you're looking for isn't present though... Regards, Peter H. Ezetta On Wed, May 15, 201

Re: How do I update CPAN?

2013-05-14 Thread Peter Eztta
>From within the CPAN shell (i.e. issue the cpan command from the commandline) >issue the two commands listed below: install CPAN Once that's done reload CPAN The rest should happen automagically for you. Thanks, Peter H. Ezetta On Tue, May 14, 2013 at 03:05:59PM -0700, Sher

RE: problem with File::Util::readlimit

2013-05-08 Thread Peter Ezetta
u out any. Regards, Peter From: fluca1...@gmail.com [fluca1...@gmail.com] On Behalf Of Luca Ferrari [fluca1...@infinito.it] Sent: Wednesday, May 08, 2013 9:49 AM To: beginners@perl.org Subject: problem with File::Util::readlimit Hello, I'm encountering a pro

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

Help in Perl

2012-05-07 Thread S Peter
Hi   I am S. Peter, a beginner in Perl program, working in XML files. I have a xml files with the following coding.   "$N$"   I require a small script in perl to open any xml file and just copy and write only the command starts with " in a new file.    If a xml file consists of

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: Introduction and Perl 5 References

2012-02-29 Thread peter lanting
> Date: Mon, 27 Feb 2012 20:02:49 -0500 > From: ekimduna...@gmail.com > To: beginners@perl.org > Subject: Introduction and Perl 5 References > > While I'm posting, I may as well > ask a question related to Perl. Would anyone mind explaining references > to me like I was five years old? I read

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: help me with a parsing script please

2011-05-12 Thread Peter Lanting
On Thu, May 12, 2011 at 11:23 AM, Nathalie Conte wrote: HI, I have this file format chrstartendstrand x 12241 x24481 1100124-1 1124148-1 Basically I would like to create a new file by grouping the start of the first line (12) with the

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

  1   2   3   4   5   6   7   8   9   10   >