Please help me to understand this:
$ perl -e 'exit(10) if "aaa"=~/a{,2}/;'
$ echo $?
$ 10
Thanks
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
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;
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
$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
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
. 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/
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
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
Any idea?
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
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
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
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
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
!
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
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
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/
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
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
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/
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
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
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
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/
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
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/
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
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
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
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
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
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
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
=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
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
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
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
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]
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
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
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
$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
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
),
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
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
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
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,
47 matches
Mail list logo