Re: Upgrade from Debian 11 to Debian 12 Broke Perl.

2024-03-11 Thread John SJ Anderson
> Can't locate warnings/unused.pm in @INC (you may need to install the > warnings::unused module) (@INC contains: /etc/perl > /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 > /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 > /usr/lib/x86_64-linux-gnu/perl-base /u

Re: Knowledge for a basic programmer and advanced programmer

2024-01-05 Thread John SJ Anderson
> If you are coding you should be backing up every > 10 minutes or more often. And you should store > a "historical" full copy of the code every 30 minutes > or more often and save them for days. No, you shouldn’t, because it is no longer 1985. You should learn how to use version control; the

Re: Modules

2023-10-24 Thread John Harris Gmail
What modules and/or libraries are you using? Before you code do you block diagram and flowchart your programs? On Tue, Oct 24, 2023, 12:06 PM Levi Elias Nystad-Johansen via beginners < beginners@perl.org> wrote: > I use modules for complex things that I might get wrong. To re-use other > people's

Re: Tool for develop in Perl

2023-10-23 Thread John Tebbe
I use this, it an old one but it meets my needs: https://sourceforge.net/projects/open-perl-ide/ On 10/23/2023 6:55 AM, Ruprecht Helms wrote: An Alternative for VIM or Emacs is the Nano-Editor. Maybe the IDE Eclipse is able to assist you in developing perl-code. But like to use Eclipse for

Re: escape character in regex

2022-10-10 Thread John W. Krahn
"; $str="hello/world/buddy"; @list=split/$delimiter/,$str;print "@list"' hello world buddy Am I right? thank you. "/" is NOT a special charater in a regular expression. It is just that in Perl the default delimiter for some operators is "/"

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread John W. Krahn
$fh>; }; my %count = do {     my %res;     open my $fh, '<:mmap', 'words.txt' or die $!;     map { $res{$_}++ unless $stopwords{$_}; } split /\n/, <$fh>;     %res; }; my $i=0; for (sort {$count{$b} <=> $count{$a}} keys %count) {     if ($i <

Re: A Philosophical Point To Be Made: The Truth

2021-10-26 Thread John SJ Anderson
This is off-topic for this mailing list; please take this discussion elsewhere. thanks, john, list mom. > On Oct 26, 2021, at 03:06, Shlomi Fish wrote: > > Hi Brandon! > >> On Sun, 17 Oct 2021 01:15:13 -0400 >> Brandon McCaig wrote: >> >> Hello All, &

Re: memory mapped file example

2020-10-03 Thread John W. Krahn
find out what the file name is and determine what format the data is stored in that file. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Wide character in print at HTML::TreeBuilder::XPath function

2020-01-26 Thread John SJ Anderson
gible-unicode> is a really good investment in reducing future frustrations when working with Unicode in Perl. chrs, john.

Re: question about perl script

2019-10-30 Thread John W. Krahn
7;<', $ARGV[ 1 ] or die "Cannot open '$ARGV[1]' because: $!"; open my $SELEC, '>', $ARGV[ 2 ] or die "Cannot open '$ARGV[2]' because: $!"; my %pair; while ( <$NAME> ) { my ( $name ) = split /\t/; $pair{ $name }++; } while (

Re: Help me with a regex problem

2019-10-25 Thread John W. Krahn
Perhaps if you could describe the problem better? John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perl script question

2019-10-10 Thread John W. Krahn
~ s/\.fa\z/.txt/r or next; 0 == system './usearch', '-ublast', "$dir/$file", '-db', 'sine.fa', '-evalue', '1e-5', '-userout', $file_name, '-strand', 'both'

Re: perl script question

2019-10-10 Thread John W. Krahn
== system './usearch', '-ublast', "$dir/$file", '-db', 'sine.fa', '-evalue', '1e-5', '-userout', $file_name, '-strand', 'both', '-userfields', 'query+qlo+qhi+ql+qs+qstrand+target+tlo+thi+tl' or die "system ./usearch failed: $?"; } John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: symlink to "pack"

2019-09-09 Thread John W. Krahn
On 2019-09-08 12:20 p.m., Jorge Almeida wrote: On Sun, Sep 8, 2019 at 8:08 PM John W. Krahn wrote: On 2019-09-07 1:25 p.m., Jorge Almeida wrote: On Unix/Linux a character in a file name can be any character except a slash '/' character because that is used to separate path elem

Re: symlink to "pack"

2019-09-08 Thread John W. Krahn
arate path elements, or a null "\0" character because that is what the C language uses to signify the end of a string. So your Perl string "\0\f" is read by C as a zero length string. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: ActiveState unauthorized license claims?

2019-05-31 Thread John SJ Anderson
uestion. https://lists.perl.org/list/perl5-porters.html <https://lists.perl.org/list/perl5-porters.html> chrs, john.

Re: What are the environmental variables used by Perl?

2019-05-30 Thread John SJ Anderson
> > Do you know if there is a list of environmental variables anywhere? I think maybe this is what you’re looking for? https://perldoc.pl/perlrun#ENVIRONMENT

Re: Syntax "||" before sub

2018-11-22 Thread John W. Krahn
he C programming language and it is slightly more efficient when compiled to machine code. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Code Assistance Pls

2018-11-21 Thread John W. Krahn
ber whose first digit is 1. You need to either use anchors: if ( /^file-id \b$i\b/ ) { Or capture the number and do numerical comparison: if ( /^file-id (\d+)/ && $1 == $i ) { John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

RE: XML::LibXML and comments

2018-09-11 Thread John Cortland Morgan
Hi Lawrence, Works great, thanks! Never thought of appending the comment directly to the $doc, just assumed I Needed to set the root first. Regards, John From: Lawrence Statton Sent: Monday, September 10, 2018 9:44 PM To: beginners@perl.org Subject: Re: XML::LibXML and comments On Sep

XML::LibXML and comments

2018-09-10 Thread John Cortland Morgan
= XML::LibXML::Document->new( "1.0", "UTF-8"); My $root = XML::LibXML::Comment->new( "test comment" ); $dom->setDocumentElement($root); Any help would be greatly appreciated. I'm kinda stuck with using XML::LibXML though. John -- To unsubscribe, e-ma

RE: Eclipse/Epic/PadWalker for Perl

2018-07-31 Thread John Cortland Morgan
Padwalker needs to be installed befor EPIC, so EPIC knows that it is there. Try to remove EPIC and reinstall. Regards From: Lauren C. Sent: Tuesday, July 31, 2018 3:27 AM To: James Kerwin ; beginners@perl.org Subject: Re: Eclipse/Epic/PadWalker for Perl [OT] maybe you want to change IDE to vi/v

Re: help with a stat script

2018-07-12 Thread John W. Krahn
cters followed by a '/' character and store the match in the $3 variable. This matches the "/2018/07/06/antique-internet/" portion of your string. \s+} And finally, match one or more whitespace characters so that the previous non-greedy pattern will match correctly

Re: Removing a Pattern using a Regular Expression

2018-06-14 Thread John W. Krahn
r class followed by the "'" character. The character class says to match one character that is either 'A' or 'B' or 'D' or 'E' or 'F' or 'G' or 'H' or 'I' or 'L' or 'M' or 'N' or 'S'. You probably need to use quotemeta: $subject =~ s/'\Q$remove\E'//; John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: project euler #8

2018-06-07 Thread John SJ Anderson
Hi Shlomi. A reminder that sometimes when somebody does something, you can just ignore the email and _not_ reply to it. Thanks, John the list mom. -- John Anderson // j...@genehack.org > On Jun 7, 2018, at 08:58, Shlomi Fish wrote: > > Hi, > > why did you resurrect a

Re: project euler #8

2018-06-06 Thread John W. Krahn
On Tue, 2017-05-16 at 14:01 +0800, derr...@thecopes.me wrote: I am working on problem #8 of the euler project. see below. > > > > The four adjacent digits in the 1000-digit number that have the > greatest product are 9 × 9 × 8 × 9 = 5832. > > 73167176531330624919225119674426574742355349194934

Re: CPAN will shutdown

2018-05-22 Thread John SJ Anderson
nity looks like. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: regex with HEX ascii chars

2018-04-13 Thread John W. Krahn
On Thu, 2018-04-12 at 17:26 +0100, Gary Stainburn wrote: > I have a text file (created by  pdftotext) that I've imported into my > script. > > It contains ASCII characters 251 for crosses and 252 for ticks. ASCII defines 128 characters so those characters are not ASCI

Re: [^/]* Is Not Working

2018-03-17 Thread John SJ Anderson
n your working example — is a better approach. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: compute depth of word in line

2018-03-10 Thread John W. Krahn
h++; >   } > >   return $depth; > } That function could be simplified to: sub get_depth { my $string = shift; $string =~ s/^\s+//;     $string =~ s/\s+$//; my $depth = $string =~ s/\s+/ /g; return $depth; } John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Find::Perl find not returning

2017-12-13 Thread John W. Krahn
gt; Any ideas what is happening here The wanted function does return, but it does not return to your process. It is called inside a loop in the File::Find code and when it returns the loop continues until all the files are found. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Using Pack and Unpack

2017-12-06 Thread John W. Krahn
per; $Data::Dumper::Useqq = 1; my $txstart = pack 'h*', 'fefe5a95'; print Dumper $txstart; John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Use of uninitialized value for perl

2017-11-05 Thread John W. Krahn
for the work is to get the number for each line such as: > 1 for first line and > 2 for second lin When using a while ( <> ) loop the current line number can be found in the $. variable: $ perldoc -v $. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl invocations

2017-10-29 Thread John W. Krahn
On Sun, 2017-07-02 at 11:16 -0400, Shawn H Corey wrote: > On Sun, 2 Jul 2017 14:29:25 +0200 > Eric de Hont wrote: > > > What it boils down to: use warnings as well as -w works, but -w is  > > considered old fashioned. > > The problem with -w is that it can't be turned off. $ perl -le' use warni

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-01 Thread John Harris
What are these emails really about? On Jul 1, 2017 2:42 PM, "Chas. Owens" wrote: > > > On Sat, Jul 1, 2017, 12:44 Shlomi Fish wrote: > >> Hi Shawn! >> >> On Sat, 1 Jul 2017 11:32:30 -0400 >> Shawn H Corey wrote: >> >> > !!$i which is !(!(0)) which is !(1) which is 0 >> > >> >> I suspect !1 ret

Re: dangerous perl (Re: is this reasonably save?)

2017-05-26 Thread John SJ Anderson
Take. It. Off. The. List. I've asked nicely. Now I'm telling you. Take it off the list. John List moderator. -- John Anderson // j...@genehack.org > On May 26, 2017, at 19:09, Kent Fredric wrote: > >> On 27 May 2017 at 00:01, lee wrote: >> You have a var

Re: dangerous perl (Re: is this reasonably save?)

2017-05-25 Thread John SJ Anderson
Folks, this has passed the event horizon of what’s appropriate for the Beginners list a good while back. If y’all wanna continue this conversation, please kindly do so outside the bounds of this mailing list. thanks, john, the resident list mom. > On 25May2017, at 10:52, Uri Guttman wr

Re: WWW::Mechanize requires wget

2017-04-04 Thread John SJ Anderson
> On 4Apr2017, at 11:13, SSC_perl wrote: > >> On Apr 4, 2017, at 10:59 AM, John SJ Anderson wrote: >> >> I’m not sure what was behind the resolution of your problem, but I can >> assure you I’m typing this on a Macintosh without wget installed, and >

Re: WWW::Mechanize requires wget

2017-04-04 Thread John SJ Anderson
ehind the resolution of your problem, but I can assure you I’m typing this on a Macintosh without wget installed, and WWW::Mechanize works just fine. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: search and replace

2016-06-29 Thread John SJ Anderson
n a cross-platform way super easy. thanks, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to install WWW::Salesforce::Simple on a Mac? cpanm refuses to install Crypt::SSLeay

2016-04-15 Thread John SJ Anderson
ndency is because the Salesforce module needs to talk HTTPS, which needs Crypt::SSLeay. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Storing Output file.

2016-02-01 Thread John SJ Anderson
l from this mailing list. john, perl-beginners list mom. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: converting Genbank format in gff format

2015-08-18 Thread John SJ Anderson
, perl can convert anything into anything. that is true > for most if not all languages. do you have more questions? > > Wow, Uri, do you suppose Perl could convert your smug condescending answer into something useful? Geez. john. -- *John Anderson* • j...@genehack.org • *@genehack* • www.genehack.org Suck it up, buttercup.

Re: reading from socket

2015-08-11 Thread John SJ Anderson
t; } > > } > > > > I’m obviously doing this wrong :( Can anyone perhaps show me the light? > > Don't you need to put $bytesRead into $buffer at some point? j. -- *John Anderson* • j...@genehack.org • *@genehack* • www.genehack.org Suck it up, buttercup.

Re: reading from socket

2015-08-11 Thread John SJ Anderson
On Tue, Aug 11, 2015 at 6:58 AM, John SJ Anderson wrote: > On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe wrote: > >> >> >> my $numBytesToRead = 512; >> >> my $buffer; >> >> while ($bytesRead = read($TCPSocket, $buffer, $numBytesToRead)) { >>

Re: Compilation fails with Padre (a Perl IDE) on RHEL-based distros (CentOS, etc.)

2015-05-26 Thread John SJ Anderson
On Tue, May 26, 2015 at 8:53 AM, someone called wrote: > ATTENTION: It apperars 'g++' is not a working compiler, please make > sure all necessary packages are installed. > > that is your problem. For whatever reason, g++ (the GNU C++ compiler) is not installed properly, or is not being foun

Re: Perlists groupware service

2015-04-15 Thread John SJ Anderson
I don't see any indication that web site is at all affiliated with this mailing list. What leads you to think we can answer your question? On Wed, Apr 15, 2015 at 2:59 AM, Masayoshi Fujimoto < m.fujim...@rocketmail.com> wrote: > Hi. > How should I delete my email address from the following websit

Re: Doubt

2015-03-29 Thread John SJ Anderson
Please show exactly what commands you ran and what output you got. In what you're reporting, there's a typo, and it's not clear if that's a copy-paste error or a problem in the actual command. chrs, john. On Mon, Mar 30, 2015 at 1:16 AM, Frank Vino wrote: > When i try t

Re: Why doesn't this script error?

2015-03-14 Thread John SJ Anderson
Try again with 'use strict' and 'use warnings' turned on. On Sat, Mar 14, 2015 at 1:40 PM, Sherman Willden wrote: > I am new to Eclipse and Epic so I wrote the below script which I thought > would error but it runs. Why? > > #!/usr/bin/perl > > use 5.18.2; > > print "Hello World \n"; > > print t

Re: Re[2]: Need something like macro

2015-03-09 Thread John SJ Anderson
On Mon, Mar 9, 2015 at 12:48 PM, Артём Варнайский wrote: Execution time of inline variant approximately 17.6ms, subroutine solution > slower about 26%. My script is captcha generator. Random sign used very > often during execution. I think 26% is a lot enough in this case. > > And the average lat

Re: Looping regexes against a list

2015-01-19 Thread John Mason
a user, there should be checking/limits on what input is allowed . John

Re: How does opendir/readdir process files

2015-01-14 Thread John SJ Anderson
f your post may be excellent, but I couldn't say, as I stopped reading immediately after reading that. john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: How does opendir/readdir process files

2015-01-08 Thread John SJ Anderson
On Thu, Jan 8, 2015 at 5:52 PM, Harry Putnam wrote: > Opening a directory and readdir with a grep in there to find specific > filenames, how does that process collect the files? See http://www.perlmonks.org/?node_id=533744 tl;dr: it depends on your OS. > I mean will the generated @ar of files

Re: Unable to install Net::IP

2014-12-02 Thread John SJ Anderson
L && make', and see what the output of that is. I suspect make is giving an error that's getting eaten by the cpan client, for whatever reason. (Aside: doing the make as root is not the best idea. (Least privilege)++) chrs, john. On Tue, Dec 2, 2014 at 2:17 PM, wrote: &

Re: At wits end CG::unescape

2014-11-25 Thread John SJ Anderson
er putting in some debug print() statements into that cgiapp_get_query() routine, or using the debugger to stop execution inside there and looking at what that call from CGI->new() is actually returning. chrs, john. On Tue, Nov 25, 2014 at 7:56 AM, Patton, Billy N wrote: > OS : mac 1

Re: CGI::Application::Plugin::TT

2014-11-12 Thread John SJ Anderson
On Wed, Nov 12, 2014 at 4:54 AM, Patton, Billy N wrote: > I’ve , mistakenly, updated to Mac OS 10.10 Yosemite. > That completely caused my app to fail in Apache 2.4. > Looks like it might be a version problem for TT.pm TT.pm is really 'Template.pm'. Are you sure the Perl you're using has it insta

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-03 Thread John SJ Anderson
rks and you're happy, don't worry about it.) chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Interactive perl based application who works as per schedule

2014-10-09 Thread John SJ Anderson
has been changed, and reloads it. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Problem with regex

2014-10-06 Thread John Delacour
> On 6 Oct 2014, at 18:57, punit jain wrote: > > Thanks Paul. However I think I couldnot explain the problem. > > The issue is when I have mailid's as well as a part of input stream. > > Input stream ---> $str="ldap:///uid=user1,ou=People,o=test.com > ,a...@test.com

Re: [ANN] SurfShop 1.6.1 Shopping Cart Released

2014-09-21 Thread John W. Krahn
ib.pm:2119: $count = 1 unless ($count); ss_files/SSLib.pm:2447: $item->{'unitprice'} = $price unless $item->{'unitprice'}; ss_files/SSLib.pm:2486: $item->{'optionprice'} = $addtl unless ($item->

Re: Any project like Ipython/Bpython in Perl.

2014-09-15 Thread John SJ Anderson
On Mon, Sep 15, 2014 at 5:19 AM, Sam wrote: > If you are just looking for a REPL, look at: > https://metacpan.org/pod/Devel::REPL IMO, Reply is a little nicer - https://metacpan.org/pod/distribution/Reply/bin/reply j. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional co

Re: returning arrays

2014-09-09 Thread John SJ Anderson
ally pretty ephemeral -- but if you want it to stick around, you can put it in an array variable. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: [ANN] SurfShop 1.6.1 Shopping Cart Released

2014-09-07 Thread John SJ Anderson
Hi - This is a list for people starting to learn Perl, or with Perl questions. It's not a list for announcing software written in Perl, so your post here is off topic. thanks, john. On Sat, Sep 6, 2014 at 5:55 PM, SSC_perl wrote: > Sorry for a repost so soon, but if you do

Re: cygwin64 perl blead YAML and JSON backend chicken and egg.

2014-09-07 Thread John SJ Anderson
Hi Dave - I really don't think Perl beginners is the best place to be asking this question. Have you considered trying something like http://code.activestate.com/lists/perl-win32-users/ ? That seems like a more likely place to connect with somebody who can help you. chrs, john. On Mon,

Re: return the list content

2014-08-18 Thread John SJ Anderson
values are usually fairly confusing to use, so consider not doing this. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Suddenly.... Part 2

2014-07-31 Thread John W. Krahn
chomp; $ofile[$indexb++] .= $_; That would be better as: push @ofile, $_; } close FHIN; To see what was put into ofile, a line at a time, I used foreach (@ofile) { print "$_\n"; } Is that correct? That is correct. John -- Any intelligent fool can

Re: Why Does the Following Not Work?

2014-07-30 Thread John SJ Anderson
> die("***YOU MUST HAVE A DESTINATION ADDRESS/NETWORK address.\n") > if (@destinations); Don't you mean 'if !@destinations' or 'unless @destinations' here? That test is for whether @destinations has any entries. % perl -E 'my @x=(); say "lives" if (@x)' % perl -E 'my @x=(1); say "dies" if (@x)'

Re: Apologetic request for simple one-off script

2014-07-14 Thread John SJ Anderson
You were asked to take this off list once. I'm now telling you, in my official capacity as list moderator: further discussion of this is off-topic and does not belong on this list. Let it go. thanks, john. On Mon, Jul 14, 2014 at 7:18 AM, John Delacour wrote: > > On 14 Jul 201

Re: Apologetic request for simple one-off script

2014-07-14 Thread John Delacour
On 14 Jul 2014, at 14:11, Shlomi Fish wrote: >> perldoc -f open > This is irrelevant. Two-args open is dangerous - always use three-args open: > > * http://perl-begin.org/tutorials/bad-elements/#open-function-style Who wrote that? Ah...a certain Shlomi Fish. open my $fh, "< $path"; # with o

Re: Apologetic request for simple one-off script

2014-07-14 Thread John SJ Anderson
Hi. List Mom here. Please take this off list, it's not on-topic. John: Thank you for answering the OP's question. However, Shlomi is right, the two argument form of open() is something that the general Perl community considers to be a deprecated style that should not be used with new

Re: Apologetic request for simple one-off script

2014-07-14 Thread John Delacour
On 14 Jul 2014, at 05:39, Shlomi Fish wrote: > don't use two-args open perldoc -f open In the one- and two-argument forms of the call, the mode and filename should be concatenated (in that order), preferably separated by white space. You can--but shouldn't--

Re: Apologetic request for simple one-off script

2014-07-13 Thread John Delacour
On 13 Jul 2014, at 23:48, ESChamp wrote: > John Delacour has written on 7/13/2014 5:31 PM: >> >> On 13 Jul 2014, at 21:43, ESChamp wrote: >> >>> ...lastname firstname other other other ... emailaddress >>> >>> I wish to write a new file that c

Re: Apologetic request for simple one-off script

2014-07-13 Thread John Delacour
On 13 Jul 2014, at 21:43, ESChamp wrote: > ...lastname firstname other other other ... emailaddress > > I wish to write a new file that contains only the emailaddress field > contents. Here’s an easily-understood way of doing it: #!/usr/bin/perl use strict; while (){ chomp; @_ = split / /

Re: Creating a hash of arrays from

2014-07-09 Thread John SJ Anderson
On Wed, Jul 9, 2014 at 6:59 PM, SSC_perl wrote: > If someone could explain what I'm doing wrong, I'd appreciate it. I > just can't see it. You're looping over the entries in the array, not the entries in the hash. > foreach my $state (sort keys %entries) { > say "The Zip Codes of $

Re: want to write to file in different format

2014-07-07 Thread John Delacour
On 7 Jul 2014, at 09:18, Sunita Pradhan wrote: > I have a file of contents: > --- > 1 6 > 2 7 > 3 8 > 4 9 > 5 10 > -- > I want a file with content: > > 1 2 3 4 5 > 6 7 8 9 10 Try this: #!/usr/local/bin/perl use strict; my (@col1, @col2); while () { chomp; my @words = spli

Re: one line script for word count

2014-06-30 Thread John Delacour
On 30 Jun 2014, at 20:05, Jim Gibson wrote: > Try this: > > $c = () = $line =~ /\b$w\b/g; Or, slightly less obscure: #!/usr/bin/perl use strict; my $line = "one potato two potato three potato four"; my @hits = $line =~ /potato/g; print scalar @hits; # => 3 #JD -- To unsubscribe, e-ma

Re: CGI script produces blank screen

2014-06-27 Thread John SJ Anderson
On Fri, Jun 27, 2014 at 7:34 PM, SSC_perl wrote: > Any input would be greatly appreciated! Look in the web server error log. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: uninitialized error for hash printing

2014-06-22 Thread John Delacour
On 22 Jun 2014, at 21:01, Sunita Pradhan wrote: > I have following code for printing a simple hash. > > #!/usr/bin/perl -w > %hash = ("abc" => 123, "dfg" => 456, "xsd" => 34); > foreach $k (keys %hash){ > print "key $k:: value $hash{$k}\n"; > } > -- > Use of uninitialized

Re: Install Alien SVN::Core

2014-06-15 Thread John SJ Anderson
On Sun, Jun 15, 2014 at 11:36 AM, Tim Dunphy wrote: > Ok! Well if I do a which on that program: > > [root@uszmpaplp005lc apr-util-1.5.3]# which apu-1-config > /usr/bin/apu-1-config > > It's found. Yay! That's finding the system one, not the one you just installed under /usr/local/apr/bin. > But

Re: perlbrew error

2014-06-15 Thread John SJ Anderson
On Sun, Jun 15, 2014 at 10:31 AM, Subinoy Biswas wrote: > Hi, > I am having a trouble installing any module with cpanm in perlbrew > perl-5.20.0 in an test1 local lib. Below I am pasting the verbose. Please > help me to solve this issue So, you need to install Tie::Hash::Indexed: > Can't locate

Re: Install Alien SVN::Core

2014-06-15 Thread John SJ Anderson
On Sun, Jun 15, 2014 at 10:39 AM, Tim Dunphy wrote: > Hi John, > > -- > /usr/bin/install -c -m 644 aprutil.exp /usr/local/apr/lib > /usr/bin/install -c -m 755 apu-config.out /usr/local/apr/bin/apu-1-config > >

Re: Install Alien SVN::Core

2014-06-15 Thread John SJ Anderson
On Fri, Jun 13, 2014 at 3:45 PM, Tim Dunphy wrote: > How can I specify apr-util to this perl module when apr-util 1.5.1 is > already installed. Can you confirm that 'which apr-util' shows that the command is actually in your $PATH? j. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

Re: Running module using cpan.

2014-06-10 Thread John SJ Anderson
dexed at all on MetaCPAN, which is generally indicative of problems. My advice would be to contact the person who submitted that ticket, and take them up on their offer to help you. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to create a text progress status line that updates on the same line in Perl?

2014-06-10 Thread John SJ Anderson
e. 8^) chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: regular expression

2014-05-06 Thread John SJ Anderson
On Tue, May 6, 2014 at 10:30 PM, Danny Wong (dannwong) wrote: > Both string are possible outputs, so I want to be able to grep for the > username only. Well, if the username will always be either the only thing between 'by' and 'on', or in parens if it's not... #! /usr/bin/env perl use strict;

Re: regular expression

2014-05-06 Thread John SJ Anderson
On Tue, May 6, 2014 at 10:19 PM, Danny Wong (dannwong) wrote: > What is a regular expression where I can extract ³danwong² from either > string (one string have () parentheses and the other doesn¹t have > parentheses)? I'm not entirely sure what you're trying to accomplish, but perhaps something

Re: small puzzle

2014-04-25 Thread John SJ Anderson
*puts on List Mom hat* Okay, we're done here. The original question was asked and answered (a couple times). Let's move on and get back to dealing with Perl questions, not personalities. thanks, john. *takes List Mom hat back off* -- To unsubscribe, e-mail: beginners-unsubscr...@pe

Re: small puzzle

2014-04-25 Thread John SJ Anderson
this point would be that when you're trying to do two things, it's perfectly okay to use two lines of code to do it. (It's even okay sometimes when you're only trying to do one thing!) Perl doesn't charge you by the lines of code you use, so doing this: my $re = shift;

Re: small puzzle

2014-04-24 Thread John SJ Anderson
On Thu, Apr 24, 2014 at 8:40 PM, Harry Putnam wrote: > my $dir2sr = @{[shift]}; This shifts an element off @ARGV, makes an array reference containing a single element (the value that was just shifted off), then deferences that arrayref to create an array (which still contains a single element, t

Re: Where's this documented?

2014-03-20 Thread John W. Krahn
;_. perldoc perldata perldoc perlmod perldoc perlref John -- Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. -- Albert Einstein -- To unsubscribe, e-mail: beginners-unsubscr...@per

Re: Where's this documented?

2014-03-18 Thread John W. Krahn
only has to look up the file information once now: John -- Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. -- Albert Einstein -- To unsubscribe, e-mail: beginners-unsubscr

Re: Turn part of a string into a single newline

2014-02-14 Thread John W. Krahn
s/N+/\n/g; Or just: $joinedDNA =~ tr/N/\n/s; The statement: $joinedDNA =~ s/\R//g; removes all newlines. John -- Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. -- Alber

Re: Test::More is_deeply failed data

2014-02-11 Thread John SJ Anderson
On Tue, Feb 11, 2014 at 10:17 AM, shawn wilson wrote: > Is there a way to see the data difference when is_deeply fails? So, with this code: #! perl use Test::More; my $a = { foo => {bar => { baz => 'bargle' }}}; my $b = { foo => {baz => { bar => 'bargle' }}}; is_deeply( $a , $b ); done_testi

Re: constant in object

2014-02-10 Thread John SJ Anderson
On Mon, Feb 10, 2014 at 10:07 PM, shawn wilson wrote: > which I still don't see why this is bad? In "classic" object-oriented programming, object constructors -- which is what new() is in your class -- are always class methods. Calling 'new()' as an object method doesn't make any sense. Further

Re: Package version numbers

2014-01-14 Thread John SJ Anderson
> Thanks for the test, John. In the book's example, they have: > > use v5.10; > > so I thought I was new enough, but maybe not. http://use.perl.org/use.perl.org/articles/10/04/13/1953252.shtml also notes it as a new feature in 5.12. I'm sure the authors regret th

Re: Package version numbers

2014-01-14 Thread John SJ Anderson
. What am I doing wrong? I'm not sure exactly when that syntax was added, but for what it's worth, it fails with 5.10.1 here too. Perl 5.12.5, on the other hand, works. You may just need to upgrade. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Recursive Validation Function

2014-01-02 Thread John Aten
: Andy Bach > Date: September 2, 2013 8:43:59 PM CDT > To: John Aten > Cc: "beginners@perl.org" > Subject: Re: Recursive Validation Function > > > > > On Monday, September 2, 2013, John Aten wrote: > my $valid_token = validate_tokens($token); >

Re: DBD::Pg::st execute failed: execute called with an unbound placeholder

2013-12-11 Thread John SJ Anderson
On Wed, Dec 11, 2013 at 1:56 AM, Lars Noodén wrote: > my $sth = $dbh->prepare("delete from sessions where \ > current_timestamp - time > interval ?"); > > $sth->execute( $interval ); > > > What mistake is there causing the error? I can use a similar line with > a placeholder for a SELECT sql s

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-19 Thread John W. Krahn
SSC_perl wrote: Hi John, Hello, Thanks for getting back to me with your findings. I really appreciate it. I've gone through everything, made the changes that I could, and I have some questions to some of your remarks. You are using the value from readdir() without prependin

Re: Need explanation of expression

2013-11-18 Thread John SJ Anderson
On Mon, Nov 18, 2013 at 12:34 PM, John W. Krahn wrote: >> Also, is there something in the perl man pages about it? > > > Yes. You probably want perlop? Specifically, http://perldoc.perl.org/perlop.html#Conditional-Operator '?:' is otherwise known as the 

  1   2   3   4   5   6   7   8   9   10   >