Please help me to understand this:
$ perl -e 'exit(10) if "aaa"=~/a{,2}/;'
$ echo $?
$ 10
Thanks
Jorge Almeida
d "foo" 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...@per
On Fri, Jan 29, 2016 at 2:48 AM, Charles DeRykus wrote:
> On Fri, Jan 29, 2016 at 12:39 AM, Jorge Almeida wrote:
>> Can someone help me to understand this?
>>
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>> my $s='\\n';
>> print $
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...@per
On Wed, Feb 5, 2014 at 8:11 PM, Uri Guttman 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
>> multipli
$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="A"x$n."b"; # $s is "AAb"
$s="ab";
$n=2;
$s=~s/a/Ax$n/; # doesn't work, of course; $s is Ax2b
Is it po
al. 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/
o difference).
I had 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 unsubscri
guess 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";}'
~
--
Jorg
gives way to a unique line:
^[[?1034h
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 on
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]
w this
doesn't work!
8 for (@chunk){ print H $_;}
9 while(){
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
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
On Sun, 5 Aug 2007, Mumia W. wrote:
On 08/05/2007 07:21 AM, Jorge Almeida wrote:
open(F,"do-something|");
while(){...}
and later
open(G,"do-something-else|")
while(){...}
What do F and G have to do with STDIN?
Everything...
The code "while()
put is redirected from some
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= or
open(F,"do-something|") appears in the program.
Any suggestion?
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
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 stri
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=;
4 $s=~s/\D*//;
5 $s=~s/\D*//;
6 print "
x27;$s=~s/\D*//g;' and comment out line 5. It will
work 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/
http://search.cpan.org/search?m=module&q=getopt&s=21
????
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
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
aa',
b => 'aa &&\
bbb',
I could then slurp the file 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 ar
On Sun, 11 Feb 2007, Peter Scott wrote:
On Sun, 11 Feb 2007 13:42:39 +, Jorge Almeida wrote:
Is there some efficient way to get a user/group name out of a numerical
uid/gid (in Linux)?
Why, yes. perldoc -f getpwuid, perldoc -f getgrgid.
Thank you.
--
Jorge Almeida
--
To unsubscribe
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
. The problem I 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: [
ll, I 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/
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
hich. (I know I can solve the problem 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 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
se. I didn't know that you could do that
when using 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>
ogram is:
27
Just what I would 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>
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 pur
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]
<h
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: [
abort=0;
$SIG{'INT'}=sub{
$SIG{'INT'}='IGNORE';
$abort=1;
};
while(){
return if $abort;
# do your job...
}
Thank you.
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
tine(), but what can the latter do to
exit myroutine? Putting exit in place 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>
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
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.
Jo
t;" is there to check). I
tried using a unique "eval" 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>
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>
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
seems 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>
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>
t;0." . "0" x $decimals . "5"),
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,
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.
("%.1f", $a); print $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>
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,
rlmonth.com/
I 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>
48 matches
Mail list logo