regex

2024-01-22 Thread Jorge Almeida
Please help me to understand this: $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' $ echo $? $ 10 Thanks Jorge Almeida

symlink to "pack"

2019-09-07 Thread Jorge Almeida
t; pointing to a 2-byte string. Yes, it would be a broken symlink. (Yes, this is how I want it). Symlink() can create broken links, the problem is the target. What to do? (And why doesn't it work?) TIA Jorge Almeida -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: unexpected escaping

2016-01-29 Thread Jorge Almeida
On Fri, Jan 29, 2016 at 2:48 AM, Charles DeRykus <dery...@gmail.com> wrote: > On Fri, Jan 29, 2016 at 12:39 AM, Jorge Almeida <jjalme...@gmail.com> wrote: >> Can someone help me to understand this? >> >> #!/usr/bin/perl >> use strict; >> use warnings;

unexpected escaping

2016-01-29 Thread Jorge Almeida
Can someone help me to understand this? #!/usr/bin/perl use strict; use warnings; my $s='\\n'; print $s; Output: \n Expected output: \\n TIA Jorge Almeida -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

multiplier in replacement string

2014-02-05 Thread Jorge Almeida
$s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb $s=ab; $n=2; $s=~s/a/Ax$n/; # doesn't work, of course; $s is Ax2b Is it possible at all? Thanks Jorge Almeida -- To unsubscribe, e-mail: beginners

Re: multiplier in replacement string

2014-02-05 Thread Jorge Almeida
On Wed, Feb 5, 2014 at 8:11 PM, Uri Guttman u...@stemsystems.com wrote: On 02/05/2014 02:52 PM, Jorge Almeida wrote: $s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb you need the /e modifier

Re: How to get rid of underline in Term::Readline::GNU's prompt?

2009-05-05 Thread Jorge Almeida
. I also googled and searched CPAN but failed to get the answer. Did anyone here hit this before? $self-{'term'}-Attribs-ornaments(0); HTH. Jorge Almeida -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Segfault with Term::ReadLine::GNU

2008-11-04 Thread Jorge Almeida
to reinstall all the system, for reasons unrelated to Perl, so I can't say which versions I had before (which worked without a flaw). I have several applications depending on Term::ReadLine::GNU that just went dead... Any workaround? Thanks... -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Define NULL value in Perl

2008-07-09 Thread Jorge Almeida
that you get it with an escaped zero: $ perl -e '$s=\0;print $s,X\n;' X ~ $ perl -e '$s=\0;if($s=~/\0/){print yes\n;}' yes ~ $ perl -e '$s=;if($s=~/\0/){print yes\n;}' ~ -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

vim--Term::Readline::Gnu problem

2007-08-08 Thread Jorge Almeida
Any idea? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: customizing eof chatacter

2007-08-06 Thread Jorge Almeida
On Mon, 6 Aug 2007, Ken Foskey wrote: On Sun, 2007-08-05 at 18:26 +0100, Jorge Almeida wrote: It sounds like you want something similar to parameter handling, generally this works on escalating files. eg /etc/myprog overridden by ~/.myprog overrridden by a specific options file and so

customizing eof chatacter

2007-08-05 Thread Jorge Almeida
file, I would need a way to divide the file into chunks, so that each chunk would be treated as the whole STDIN each time @arr=STDIN or open(F,do-something|) appears in the program. Any suggestion? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, Mumia W. wrote: On 08/05/2007 07:21 AM, Jorge Almeida wrote: open(F,do-something|); while(F){...} and later open(G,do-something-else|) while(G){...} What do F and G have to do with STDIN? Everything... The code while(F){...} does not read from

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, John W. Krahn wrote: Jorge Almeida wrote: Is there some variable that will do for a file what $/ does for a record? Note that reading STDIN line by line and checking for a character won't do the job, because somewhere in the program I need something like open

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
! 8 for (@chunk){ print H $_;} 9 while(H){ 10 # do the real work now... 11 } The problem, of course, starts with line 7... I took a look at open(W,|-) and open(R,-|). No good, the program is too complex to deal gracefully with forking... -- Jorge

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, Mr. Shawn H. Corey wrote: See `perldoc perlfaq8` and search for How can I open a pipe both to and from a command? Thank you. I'll have to decide whether using IPC::Open2 is safe enough... -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

regexp problem

2007-06-14 Thread Jorge Almeida
then, but that is not the point. I could also substitute line 5 by '$s=~s/\D+//;' and it would also work... -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: regexp problem

2007-06-14 Thread Jorge Almeida
On Thu, 14 Jun 2007, Martin Barth wrote: On Thu, 14 Jun 2007 11:04:51 +0100 (WEST) Jorge Almeida [EMAIL PROTECTED] wrote: I'm missing something about Perl's regexp: 1 #!/usr/bin/perl -w 2 use strict; 3 my $s=STDIN; 4 $s=~s/\D*//; 5 $s=~s/\D*//; 6 print $s\n; When input

Re: regexp problem

2007-06-14 Thread Jorge Almeida
On Thu, 14 Jun 2007, Xavier Noria wrote: On Jun 14, 2007, at 12:10 PM, Martin Barth wrote: On Thu, 14 Jun 2007 11:04:51 +0100 (WEST) Jorge Almeida [EMAIL PROTECTED] wrote: I'm missing something about Perl's regexp: 1 #!/usr/bin/perl -w 2 use strict; 3 my $s=STDIN; 4 $s=~s

What happened to Getopt::Std ?

2007-06-13 Thread Jorge Almeida
http://search.cpan.org/search?m=moduleq=getopts=21 -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

slurp hash from file

2007-02-27 Thread Jorge Almeida
as a single string, split the string on /\n\n/, etc., because I know the hash values will not contain empty lines. But this leaves an uncomfortable feeling, since the original file contents are already as we would write them in the main program... Any idea? -- Jorge Almeida -- To unsubscribe, e-mail

Re: slurp hash from file

2007-02-27 Thread Jorge Almeida
On Tue, 27 Feb 2007, Adriano Ferreira wrote: On 2/27/07, Jorge Almeida [EMAIL PROTECTED] wrote: Let's say your data is in the file data.pl. Then my %hash = do data.pl; my $hash_ref = \%hash; Great! Thanks. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED

find user name

2007-02-11 Thread Jorge Almeida
Is there some efficient way to get a user/group name out of a numerical uid/gid (in Linux)? Something like $username=getusername($uid) (Of course, one can parse /etc/passwd, build a hash, etc. Is there something like this ready to use?) -- Jorge Almeida -- To unsubscribe, e-mail

installing question

2007-01-09 Thread Jorge Almeida
by creating a symlink /usr/local/perl to /usr/local/opt/perl, but I would like to know what went wrong.) -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: installing question

2007-01-09 Thread Jorge Almeida
On Tue, 9 Jan 2007, Arvind Autar wrote: gentoo is a bad distrobution you should remove it and install a sane distrobution. I will follow your suggestion, of course. What brand of Windows do you favor? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: %Re: installing question

2007-01-09 Thread Jorge Almeida
apologize if my comment offended someone. My despise for Windows doesn't extend to people using it, and certainly not to those who are also Perl users. Cheers. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: % installing question

2007-01-09 Thread Jorge Almeida
mentioned is either something very obvious for people who usually install from source or else some detail in the developers league. The symlink workaround does the job, but I still would like to know whether I did something wrong... Cheers. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: my, my...

2006-12-17 Thread Jorge Almeida
On Sun, 17 Dec 2006, Jeff Pang wrote: There is a good article about Perl's variable scope. I think you maybe need to take some time to read it seriously: http://perl.plover.com/FAQs/Namespaces.html.en Good link. Thanks. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED

my, my...

2006-12-15 Thread Jorge Almeida
expect if line 4 had our instead of my. What am I missing? TIA. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: my, my...

2006-12-15 Thread Jorge Almeida
strict. I always use my or our, so I hadn't encounter this behaviour yet. Thank you. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

locked memory?

2006-09-30 Thread Jorge Almeida
Is there some way to keep a string in RAM, not allowing it to go to swap? Just like gnupg does with passphrases, and for similar reasons. (Linux only, no portability required!) -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: locked memory?

2006-09-30 Thread Jorge Almeida
On Sat, 30 Sep 2006, Tom Phoenix wrote: On 9/30/06, Jorge Almeida [EMAIL PROTECTED] wrote: Is there some way to keep a string in RAM, not allowing it to go to swap? Just like gnupg does with passphrases, and for similar reasons. (Linux only, no portability required!) Not in pure Perl

Re: Standard input Question

2006-09-26 Thread Jorge Almeida
On Tue, 26 Sep 2006, elite elite wrote: If i going to write a script with a standard input how would it look like?My perl book don't talk about it. Craig What book? And what part thereof did you read? (Besides the cover, that is...) -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL

Re: using CTRL-C to abort a routine?

2006-07-05 Thread Jorge Almeida
=1; }; while(something){ return if $abort; # do your job... } Thank you. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first

using CTRL-C to abort a routine?

2006-07-04 Thread Jorge Almeida
of (??) would exit the program, which is not what I want. Is this possible? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

eval problem

2006-06-27 Thread Jorge Almeida
around everything since open till close OUT. No joy. What is happening? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: eval problem

2006-06-27 Thread Jorge Almeida
On Tue, 27 Jun 2006, John W. Krahn wrote: Jorge Almeida wrote: What is happening? When find dies a SIGPIPE signal is sent to the parent process which kills it. Thank you. Putting `$SIG{'PIPE'}=IGNORE;' in the beginning of my program solves my problem. Jorge -- To unsubscribe, e-mail

RE: eval problem

2006-06-27 Thread Jorge Almeida
On Tue, 27 Jun 2006, Smith, Derek wrote: So could this `$SIG{'PIPE'}=IGNORE;' be considered a global similar to $ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin); Yes, %SIG is a global hash. Jorge -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Term::Readline

2006-06-16 Thread Jorge Almeida
Anyone knows some tutorial about using Term::Readline::Gnu? Or some article, somewhere? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

module for killing?

2006-05-09 Thread Jorge Almeida
clumsy. -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: module for killing?

2006-05-09 Thread Jorge Almeida
On Tue, 9 May 2006, zentara wrote: On Tue, 9 May 2006 09:57:29 +0100 (WEST), [EMAIL PROTECTED] (Jorge Almeida) wrote: Is there any Perl module to find and kill unix processes (pgrep, kill, pkill...). I need to kill all processes descending from a given process (children, grandchildren, etc

rounding in perl?

2005-07-12 Thread Jorge Almeida
$a;' 11.4 -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: rounding in perl?

2005-07-12 Thread Jorge Almeida
rounding is being used by Perl, but to instead implement the rounding function you need yourself. Yes, I read that yesterday. Hope there is an easier solution... -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org

Re: rounding in perl?

2005-07-12 Thread Jorge Almeida
), 0, $decimals+length(int($number))+1); } Yes! :):):) I still get 12.449 -- 12.5 but this is acceptable. Many thanks, Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http

Re: rounding in perl?

2005-07-12 Thread Jorge Almeida
Thanks to everyone for the help provided. I already have two working solutions. :) -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

WTH is Perlmonth?

2004-07-26 Thread Jorge Almeida
didn't knew this site. The question is: has it been hijacked? -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: WTH is Perlmonth?

2004-07-26 Thread Jorge Almeida
On Mon, 26 Jul 2004, Jenda Krynicky wrote: I think it simply died and these worms are feasting on the dead flesh :-( A pox on all of them... At least they do not try to install their silly useless page as my browser's homepage like most of these guys do. Is that possible at all?! Spooky... Cheers,