[28602] in Perl-Users-Digest
Perl-Users Digest, Issue: 9966 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 14 11:05:55 2006
Date: Tue, 14 Nov 2006 08:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 14 Nov 2006 Volume: 10 Number: 9966
Today's topics:
Re: "Did not find leading dereferencer" - new findings anno4000@radom.zrz.tu-berlin.de
Re: "Did not find leading dereferencer" - new findings <hjp-usenet2@hjp.at>
Re: Call graph analysis of perl source? <roy@panix.com>
Re: Call graph analysis of perl source? <bugbear@trim_papermule.co.uk_trim>
Re: Call graph analysis of perl source? <bugbear@trim_papermule.co.uk_trim>
Re: Call graph analysis of perl source? xhoster@gmail.com
Re: compare two string and make some operation on it? <bol@adv.magwien.gv.at>
Re: compare two string and make some operation on it? <bol@adv.magwien.gv.at>
Re: compare two string and make some operation on it? <mritty@gmail.com>
Re: compare two string and make some operation on it? anno4000@radom.zrz.tu-berlin.de
Re: how do i update one section of a page leaving rest? <bol@adv.magwien.gv.at>
Re: how do i update one section of a page leaving rest? <bik.mido@tiscalinet.it>
Re: how do i update one section of a page leaving rest? <jurgenex@hotmail.com>
Re: I have no problems eating cereal...after it softens <bwilkins@gmail.com>
Re: Mail sending problem <ced@blv-sam-01.ca.boeing.com>
Perl Packager, pp, compilation mathieu.lory@gmail.com
Re: ppm question <sigzero@gmail.com>
Re: ppm question (reading news)
Re: ppm question <ced@blv-sam-01.ca.boeing.com>
Re: problems while compiling perl on solaris 10 <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Problems with Net::MySQL... <mark.clementsREMOVETHIS@wanadoo.fr>
Re: reverse chomp() <rvtol+news@isolution.nl>
Re: reverse chomp() <rvtol+news@isolution.nl>
Re: reverse chomp() <jurgenex@hotmail.com>
Re: Unix Scripting Education Survey anno4000@radom.zrz.tu-berlin.de
Re: What is more detailled than $^O ? <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Nov 2006 12:53:05 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <4rtshhFsr25cU2@mid.dfncis.de>
Ronny <ro.naldfi.scher@gmail.com> wrote in comp.lang.perl.misc:
> Peter J. Holzer schrieb:
> > On 2006-11-13 12:37, Ronny <ro.naldfi.scher@gmail.com> wrote:
> > > Peter J. Holzer schrieb:
> > >> > The use Switch was in the code only for historic reason, and I have
> > >> > removed it. I don't know of course if *this* was sufficient to make
> > >> > the error go away: After all, the removal of the statement made the
> > >> > code a little bit smaller, so the problem might simply have
> > >> > disappeared for *this* reason (removing a comment line instead of the
> > >> > use Switch would have had the same effect).
> > >> Possible, but unlikely. Unless you use another module which uses
> > >> Text::Balanced, you aren't calling Text::Balanced any more and hence
> > >> can't get any error messages from it any more.
> > > even
> > > when I do a "use Switch", I never actually *write* a switch statement.
> >
> > That's irrelevant. The Switch module can't know whether you use a switch
> > statement or not not before it has parsed your code.
>
> May main problem was seeing *where* (at compile time) Switch.pm would
> parse my code, since I thought such an attempt on parsing would have to
>
> be done within a BEGIN block, which is not present in Switch.pm.
But it is! Every use statement has an invisible BEGIN block around it.
As has been pointed out, Switch uses Filter::Util::Call.
Anno
------------------------------
Date: Tue, 14 Nov 2006 16:14:04 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <slrneljn9s.92f.hjp-usenet2@yoyo.hjp.at>
On 2006-11-14 10:42, Ronny <ro.naldfi.scher@gmail.com> wrote:
> Peter J. Holzer schrieb:
>> On 2006-11-13 12:37, Ronny <ro.naldfi.scher@gmail.com> wrote:
>> >
>
> The error seems to be triggered whenever some source filtering is
> active, but the problem is not necessarily, that the code is somehow
> to complicated to parse (as you suspected - or did I misunderstand you
> here?),
Perl code *is* complicated to parse. There is no question about that.
Feel free to write a Perl parser if you don't believe this.
> but is more likely related to a buffer overrun in the supporting C
> code
I doubt that.
> - simply because if removing "irrelevant" characters
> from a code (irrelevant in the sense of the parsing algorithm) makes a
> certain error go away, is very, very typical for buffer overrun.
I'd remove at least one "very" from that sentence.
Mysterious parsing errors are also quite typical for a whole range of
other errors.
>> > In addition, I would like to point out that I had the same error
>> > message a few months ago in a different context.
>>
>> Yes, I've remember the thread. You were directed towards Text::Balanced
>> by somebody at the time, but you ignored that advice.
>
> Yes, because another advice which told me to remove the prototype of a
> function definition, also made the error go away.
And that didn't strike you as strange? The prototype was valid although
useless, and the error message had quite obviously nothing to do with
it. I don't feel very confident about my code if bugs appear and
disappear for reasons which I don't understand and which don't seem to
have any connection to changes I make.
> (I wonder whether there is a simple way to find out what modules are -
> directly or indirectly - included in a program, and by whom .... kind
> of an "invocation graph").
You can get a list of all used modules from %INC, but I don't think
there is a reliable way to get a dependency graph. Searching for use in
all the source files (which you also get from %INC) is probably good
enough in most cases, though.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Tue, 14 Nov 2006 09:00:00 -0500
From: Roy Smith <roy@panix.com>
Subject: Re: Call graph analysis of perl source?
Message-Id: <roy-7F8B44.09000014112006@reader2.panix.com>
In article <45598d60$0$5069$ba4acef3@news.orange.fr>,
Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr> wrote:
> Roy Smith wrote:
> > I have been given the "interesting" task of figuring out and documenting
> > 16,000 lines perl. It's typical crud -- no comments, lots of global
> > variables, etc.
> >
> > After poking at it for a while, it's obvious that what I need to do is
> > build a call graph. Are there any tools to help me do this?
>
> Devel::Graph ? May be a little verbose for your needs.
Thanks for the pointer. I just looked at Devel::Graph, and I don't think
it's what I want. I meant "graph" in the data structure sense of the word,
not in the pretty pictures sense.
However, the docs for Devel::Graph contained a pointer to PPI, which does
look interesting.
------------------------------
Date: Tue, 14 Nov 2006 14:12:21 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Call graph analysis of perl source?
Message-Id: <4559cec6$0$8716$ed2619ec@ptn-nntp-reader02.plus.net>
Roy Smith wrote:
> In article <45598d60$0$5069$ba4acef3@news.orange.fr>,
> Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr> wrote:
>
>
>>Roy Smith wrote:
>>
>>>I have been given the "interesting" task of figuring out and documenting
>>>16,000 lines perl. It's typical crud -- no comments, lots of global
>>>variables, etc.
>>>
>>>After poking at it for a while, it's obvious that what I need to do is
>>>build a call graph. Are there any tools to help me do this?
>>
>>Devel::Graph ? May be a little verbose for your needs.
>
>
> Thanks for the pointer. I just looked at Devel::Graph, and I don't think
> it's what I want. I meant "graph" in the data structure sense of the word,
> not in the pretty pictures sense.
>
> However, the docs for Devel::Graph contained a pointer to PPI, which does
> look interesting.
You might find this tool useful as part of your work;
(I think it's extraordinary!)
http://www.graphviz.org/
The suite include graph manipulation as well as (useful...)
visualisation.
e.g.
http://www.graphviz.org/Gallery/undirected/softmaint.html
BugBear
------------------------------
Date: Tue, 14 Nov 2006 14:14:48 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Call graph analysis of perl source?
Message-Id: <4559cf58$0$8716$ed2619ec@ptn-nntp-reader02.plus.net>
Roy Smith wrote:
> In article <45598d60$0$5069$ba4acef3@news.orange.fr>,
> Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr> wrote:
>
>
>>Roy Smith wrote:
>>
>>>I have been given the "interesting" task of figuring out and documenting
>>>16,000 lines perl. It's typical crud -- no comments, lots of global
>>>variables, etc.
>>>
>>>After poking at it for a while, it's obvious that what I need to do is
>>>build a call graph. Are there any tools to help me do this?
http://lists.netisland.net/archives/phlpm/phlpm-2004/msg00024.html
BugBear
------------------------------
Date: 14 Nov 2006 15:14:00 GMT
From: xhoster@gmail.com
Subject: Re: Call graph analysis of perl source?
Message-Id: <20061114101400.837$o5@newsreader.com>
Roy Smith <roy@panix.com> wrote:
> I have been given the "interesting" task of figuring out and documenting
> 16,000 lines perl. It's typical crud -- no comments, lots of global
> variables, etc.
>
> After poking at it for a while, it's obvious that what I need to do is
> build a call graph. Are there any tools to help me do this?
dprofpp -T (and friends)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 14 Nov 2006 14:00:47 +0100
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: compare two string and make some operation on it?
Message-Id: <1163509251.119189@proxy.dienste.wien.at>
Paul Lalli:
>> Well, special inside of sort blocks, OK. But else (in this example)?
[...]
Well, you showed us that $a and $b are excluded from 'strict vars'.
Right, but nothing new here (in addition, within the sort block, they
are localized and aliased to the n'th and n+1'th argument of the sort
list for each n'th iteration over the list). So far, so well.
But what has this "speciality" to do with the example given by the
OP? Why do you not want to use $a and $b in examples like this
one?
Greetings, Ferry
--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at
------------------------------
Date: Tue, 14 Nov 2006 14:04:17 +0100
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: compare two string and make some operation on it?
Message-Id: <1163509457.677893@proxy.dienste.wien.at>
Anno:
> If the string compare operation involves sorting you can be in trouble.
I'm just curious to know which kind of sorting one may perform
in a simple string compare operation, as shown by the OP.
Of course, one can overload the 'eq' (and similar) operators and
do whatever-he-want in the overload code, but I think, this wasn't
the question here.
Greetings, Ferry
--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at
------------------------------
Date: 14 Nov 2006 06:02:37 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: compare two string and make some operation on it?
Message-Id: <1163512957.649494.251020@m7g2000cwm.googlegroups.com>
Ferry Bolhar wrote:
> Paul Lalli:
>
> >> Well, special inside of sort blocks, OK. But else (in this example)?
>
> [...]
>
> Well, you showed us that $a and $b are excluded from 'strict vars'.
> Right, but nothing new here (in addition, within the sort block, they
> are localized and aliased to the n'th and n+1'th argument of the sort
> list for each n'th iteration over the list). So far, so well.
>
> But what has this "speciality" to do with the example given by the
> OP? Why do you not want to use $a and $b in examples like this
> one?
If you're asking what's wrong with using $a and $b in that one
particular example, the answer is "nothing". What's wrong with using
$a and $b in examples is that it's too easy to form the habbit of using
them in "real" code. I believe Michele was cautioning the OP against
developing this habbit.
Paul Lalli
------------------------------
Date: 14 Nov 2006 14:03:23 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: compare two string and make some operation on it?
Message-Id: <4ru0lbFsud1hU1@mid.dfncis.de>
Ferry Bolhar <bol@adv.magwien.gv.at> wrote in comp.lang.perl.misc:
> Anno:
>
> > If the string compare operation involves sorting you can be in trouble.
>
> I'm just curious to know which kind of sorting one may perform
> in a simple string compare operation, as shown by the OP.
The "specification" was
$a= "a...my....";
$b= "..mom....w";
$result="a.momy...w"; # operation is "OK"
Whatever that means exactly, it's more than a simple string compare.
More generally, one string operation that may involve sorting is checking
for anagrams.
Anno
------------------------------
Date: Tue, 14 Nov 2006 14:21:05 +0100
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <1163510466.149010@proxy.dienste.wien.at>
Gavino:
>>Remember to vote republican.I will remember. I won't do it. I couldn't
anyway. So, it doesn't make
>> a difference.
>
> oh what little country are you from?
Perhaps from one of those little 'countries' called
Europe or Asia? Just to name some few.
Greetings, Ferry
--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at
------------------------------
Date: Tue, 14 Nov 2006 14:57:16 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <anijl2lnc8gl0k30efofn5afkkghlqq6rp@4ax.com>
On Tue, 14 Nov 2006 14:21:05 +0100, "Ferry Bolhar"
<bol@adv.magwien.gv.at> wrote:
>> oh what little country are you from?
>
>Perhaps from one of those little 'countries' called
>Europe or Asia? Just to name some few.
Well, Europe and Asia are *not* countries. Which is probably why you
used quotes. Whatever, do you really think those were remarks
deserving an answer?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Tue, 14 Nov 2006 15:06:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <4Yk6h.6855$bj1.2844@trndny05>
gavino wrote:
> George Bush: fixed clinton inflation, ficed 9-11, freed two countries,
> vote republican. Europe can copy the USA but has a long way to go
> until its living standard or schools catch up to usa.
I have to grant you that much: the Department of Truth is very successful
indeed. You seem to be a prime example of its effectiveness.
jue
------------------------------
Date: 14 Nov 2006 07:25:27 -0800
From: "Brian" <bwilkins@gmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1163517927.462082.53900@f16g2000cwb.googlegroups.com>
Dave Weaver wrote:
> On 25 Oct 2006 03:09:29 -0700, Brian Wilkins <bwilkins@gmail.com> wrote:
> > OBE = Overcome By Events.
> >
> > And yes it was stated untested. I guess you were too busy sitting on
> > your high horse to notice this line:
> >
> > "Like so (caution not tested): "
>
> I missed that statement, and I hereby apologise for that, but there is
> no need for you to resort to personal comments ("high horse", "get
> over yourself"...).
>
> I merely commented on posted code. If you don't want comments, don't
> post code.
>
> If code that is posted in a public forum such as this has problems, it
> is good for those problems to be pointed out in the same public forum
> so that people who don't know Perl so well can won't be mislead into
> thinking it's perfectly acceptable code, and then go and use it
> themselves.
>
> > But hey, we can't all be perfect like you, right?
>
> I never claimed I or my code was perfect. In fact I'd love you (or
> anyone else) to comment on my code and point out problems with it.
> This is how the learning process works.
>
> This is now way OT.
Your comments were degrading and were not toward the true spirit of
Perl. Your attitude is reminiscent of many cocky Open Source folks. I
hope you had fun at picking apart the crappy code that I admittedly
wrote. Your comments, while technically correct, were out of context
and you should learn a better way to constructively criticize rather
than pick apart code that was admittedly not tested.
------------------------------
Date: Tue, 14 Nov 2006 13:32:16 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Mail sending problem
Message-Id: <J8q2xt.DMz@news.boeing.com>
Markusin wrote:
> Hi
>
> I am trying to send a mail with perl, using as MTA ms exchange. On that
> server I need to authenticate. I wrote a small programm with following code:
>
> ######################### Begin #######################################
>
>...
> my $mailer = Mail::Mailer->new($type, @args) or die "Kann kein neues
> Mail::Mailer-Objekt erzeugen: $!\n";
>
>...
> On executing that script I receive following error message:
>
> vajolet ~ # /home/markusin/scripts/mymailsender.pl
> Invalid argument at /usr/lib/perl5/vendor_perl/5.8.8/Mail/Mailer.pm line
> 269.
>
No idea but you might see if debug provides clues. Per Mail::Mailer
docs: The "Debug" options enables debugging output from "Net::SMTP".
eg, Mail::Mailer->new(... Debug => 1 )
--
Charles DeRykus
------------------------------
Date: 14 Nov 2006 07:45:40 -0800
From: mathieu.lory@gmail.com
Subject: Perl Packager, pp, compilation
Message-Id: <1163519140.107715.277590@b28g2000cwb.googlegroups.com>
Hello,
I developped a Perl application and I would like to use it under
different computers (and differents OS) whose haven't Perl on it.
So, I want to compile my script.
I saw "Perl Packager" sur CPAN :
http://search.cpan.org/~autrijus/PAR-0.85/script/pp
I can use it locally, the binary works well on my computer, but not on
other computers.
This is the error message when I run it on other computer :
Can't load
'/tmp/par-mathieu/cache-708ca5057424e91f75390798270f708076161471/e86591d6.s=
o'
for module Gtk2::MozEmbed: libgtkembedmoz.so: Ne peut ouvrir le fichier
d'objet partag=E9: Aucun fichier ou r=E9pertoire de ce type at
/usr/lib/perl/5.8/DynaLoader.pm line 225.
at /usr/share/perl5/PAR/Heavy.pm line 107
Compilation failed in require at script/script.pl line 5.,
But, with pp command, I've added the libgtkembedmoz.so to the .PAR file
(with --addlist parameter)
I also use these depedencies :
Mozilla::DOM
Gtk2::MozEmbed
Please, could you help me compiling my script ?
------------------------------
Date: 14 Nov 2006 04:55:55 -0800
From: "Robert Hicks" <sigzero@gmail.com>
Subject: Re: ppm question
Message-Id: <1163508954.943064.88260@f16g2000cwb.googlegroups.com>
John Goche wrote:
> Hello,
>
> I have ppm installed and would like to know whether
> the FreezeThaw module is installed. What command
> can I issue to determine whether this is the case?
>
> Thanks,
>
> JG
ppm> query *
Maybe...
------------------------------
Date: Tue, 14 Nov 2006 13:01:21 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: ppm question
Message-Id: <B6j6h.6080$l25.1999@newsread4.news.pas.earthlink.net>
On 11/14/2006 04:37 AM, John Goche wrote:
> Hello,
>
> I have ppm installed and would like to know whether
> the FreezeThaw module is installed. What command
> can I issue to determine whether this is the case?
>
> Thanks,
>
> JG
>
In a command prompt, type this:
perl -MFreezeThaw -e 1
If you get no error, the module FreezeThaw is installed.
--
paduille.4060.mumia.w@earthlink.net
------------------------------
Date: Tue, 14 Nov 2006 13:47:21 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: ppm question
Message-Id: <J8q3Mx.E2n@news.boeing.com>
John Goche wrote:
> Hello,
>
> I have ppm installed and would like to know whether
> the FreezeThaw module is installed. What command
> can I issue to determine whether this is the case?
perl -MFreezeThaw -e 1
or, to see if installed and its version number as well:
perl -M"FreezeThaw 9999"
--
Charles DeRykus
------------------------------
Date: Tue, 14 Nov 2006 14:02:35 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: problems while compiling perl on solaris 10
Message-Id: <4559be69$0$27403$ba4acef3@news.orange.fr>
ashish wrote:
> Hi,
>
> When I try to compile perl on Solaris 10, I get the following error
> message :
>
You probably have good reason for wanting to compile perl from scratch,
but for the record recent (7+?) versions of Solaris come with perl on
the release CDs.
If you need a more recent version, ready-to-install packages can be
found at http://www.sunfreeware.com . You can also download compilers here.
Mark
------------------------------
Date: Tue, 14 Nov 2006 14:07:26 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Problems with Net::MySQL...
Message-Id: <4559bf8c$0$27403$ba4acef3@news.orange.fr>
chriswaltham@gmail.com wrote:
> Michael wrote:
>> On Nov 13, 4:07 pm, chriswalt...@gmail.com wrote:
>>> Well I see it, but I don't believe it!
>>>
>>> I removed Net::MySQL 0.09 and replaced it with Net::MySQL 0.08. And
>>> everything works now.
>> Heh. Would you believe that was going to be the very next thing I
>> suggested? ;-) Anyway, I'm just glad you got it going finally. I hate
>> to hear of anyone trying to move to the Most Sweet Mac platform and
>> having problems.
>>
>> Regards,
>> Michael
>
> Thanks again for your help, Michael. Yep, I'm a big Mac fan, so it was
> great to get this one solved! I was beginning to tear my hair out. Now
> I just have to make sure it works against perl-5.8.6, as well as the
> webserver built into OS X Server (apache 2.x?).
>
> I'll try the script you pasted with both Net::MySQL 0.08 and 0.09, and
> send both to the maintainer. I think it's a bug somewhere.
> Interestingly enough, the script failed completely when connecting to a
> 4.x or 5.0 MySQL server, which limits where we can go in the future...
>
Does this bug seem relevant to the original problem?
#20160: Cannot connect to a Mysql 3.23.47 in Net::MySQL 0.09
https://rt.cpan.org/Ticket/Display.html?id=20160
There is a comment:
You need to keep working with version 0.08.
0.09 is updated using the new algorithme which is needed from mysql4.1
onwards.
Mark
------------------------------
Date: Tue, 14 Nov 2006 13:06:16 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: reverse chomp()
Message-Id: <ejcf9m.oo.1@news.isolution.nl>
koneruarjun schreef:
> EZP:
>> How can i make " max" into "max"? (i need to cut the spaces
>> from the begining of the word.
> s/^\s+//g
ITYM: s/^\s+//
Consider: s/^[[:blank:]]+//
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Tue, 14 Nov 2006 13:10:04 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: reverse chomp()
Message-Id: <ejcf9p.oo.1@news.isolution.nl>
ikeon schreef:
> EZP:
>> How can i make " max" into "max"? (i need to cut the spaces
>> from the begining of the word.
> You can try regex:
>
> $test = " max";
> $test =~ s/^\s*(\w*)/$1/g;
> print "$test\n";
Why would you do anything if there was no whitespace?
Why limit to \w, why not \S?
Why the g-modifier?
Consider: s/^[[:blank:]]+//
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Tue, 14 Nov 2006 15:12:50 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: reverse chomp()
Message-Id: <S1l6h.1483$ZN1.789@trndny03>
EZP wrote:
Subject: "reverse chomp()"
You just add the newline back. If you are asking about a whole array then I
think you will have to loop through the array using 'for' or 'map' or
similar. At least I am not aware of an append that operates on a whole
array.
> when i have a value like "max ", the chomp command will cut off
> the spaces to "max".
Well, no, chomp() doesn't do that.
> How can i make " max" into "max"? (i need to cut the spaces from
> the begining of the word.
Your Question is Asked Frequently:
"How do I strip blank space from the beginning/end of a string?"
jue
------------------------------
Date: 14 Nov 2006 12:43:16 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Unix Scripting Education Survey
Message-Id: <4rtrv4Fsr25cU1@mid.dfncis.de>
Justin C <justin.0611@purestblue.com> wrote in comp.lang.perl.misc:
> In article <1163422504.234888.118920@k70g2000cwa.googlegroups.com>,
> octomancer@blueyonder.co.uk wrote:
>
> > Justin C wrote:
> > > In article <1163289401.939625.199500@m7g2000cwm.googlegroups.com>,
> > > "AndrewS" <pillyponka@gmail.com> wrote:
> > > > Survey: http://www.surveymonkey.com/s.asp?u=743662789831
> > > *and* you expect me to visit "surveymonkey"?
> >
> > It seems (from the quotes around the name) that you have decided that
> > surveymonkey.com is not worth visiting based on the domain. In fact,
> > Surveymonkey is a perfectly respectable site which has been offering a
> > do-it-yourself survey toolkit for years, in the same vein as Zoomerang,
> > SurveyShack, ConfirmIt and many others.
> >
> > > Do we *look* like idiots here?
> >
> > More often than is necessary, unfortunately.
>
> LOL, TY for the reality check.
...though the question remains how "professional", "online surveys" and
"quickly and easily" (all from the second sentence of surverymonkey's
blurb) go together with "respectable".
Anno
------------------------------
Date: Tue, 14 Nov 2006 15:53:21 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: What is more detailled than $^O ?
Message-Id: <slrneljm30.92f.hjp-usenet2@yoyo.hjp.at>
On 2006-11-13 18:40, Eric Schwartz <emschwar@pobox.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>> On 2006-11-06 23:24, Eric Schwartz <emschwar@pobox.com> wrote:
>> > If one is writing an installer, it might be useful to know if one is
>> > to use yum, apt-get, or yast to install any dependencies,
>>
>> So test for the availability of these tools.
>
> This doesn't necessarily give you what you need. For instance, RHEL3
> may need packages a-1.3.rpm, b-2.4.rpm, and so on, but RHEL4 might
> need a-1.9.rpm, and b-3.7.rpm.
First you ware talking about packaging tools, now you are talking about
specific packages. This is exactly the confusion I want to avoid.
If you want to know which tools to use, check for the tools. If you want
to know about the packages, check the packages.
>> A stock redhat system hasn't any of these tools, but the sysadmin
>> might have installed yum or apt (most of my redhat systems have
>> apt). it might even be possible to deinstall yast on a suse system.
>
> Right-- which means that testing for the tools may not tell you want
> you want to know, because, depending on the ordering of the check, you
> may end up deciding you're on the wrong sort of system.
That's what I'm talking about: CHECK WHAT YOU NEED TO KNOW. Don't check
something else and then draw conclusions.
I remember very well the #ifdef jungles of C programs in the
1990's: They started simple: Often there was a BSD and SysV-way to do
something, so programmers started with
#ifdef bsd
do_it_the_bsd_way()
#else
do_it_the_sysv_way()
#endif
But of course many Unixes were a mixture, so that quickly became
#ifdef bsd
#ifdef foonix
do_it_the_sysv_way();
#else
do_it_the_bsd_way();
#endif
#else
#ifdef barnix
do_it_the_bsd_way();
#elsif gazonkux
do_it_the_sysv_way_except_with_a_workaround_for_a_bug();
#else
do_it_the_sysv_way()
#endif
#endif
and then barnix switched to sysvish behaviour in version 5, so this
became
#ifdef bsd
#ifdef foonix
do_it_the_sysv_way();
#else
do_it_the_bsd_way();
#endif
#else
#ifdef barnix
#if barnix > 1000
do_it_the_sysv_way();
#else
do_it_the_bsd_way();
#endif
#elsif gazonkux
do_it_the_sysv_way_except_with_a_workaround_for_a_bug();
#else
do_it_the_sysv_way()
#endif
#endif
and so on: For a dozen Unix variants with lots of versions, and usually
not in a clean tree like I've shown above, but with lots of && and ||
and sections which applied to several variants, etc. An absolutely
unmaintainable mess.
Later people started to test for specific features, like
#include "config.h"
#if HAVE_SYSVISH_GADGET
do_it_with_sysvish_gadget();
#elsif HAVE_BSDISH_GADGET
do_it_with_bsdish_gadget();
#else
#error
#end
and either let the sysadmin edit the config.h or use a script to create
it automatically, by actually testing whether
do_it_with_sysvish_gadget() and do_it_with_bsdish_gadget() are working.
>> So as a hint for the user that's helpful ("I can't find libfoo,
>> since you are on a Redhat system, it is probably included in the
>> foo2-devel package", or something like that), but the same
>> information could just be contained in the README without any real
>> loss of functionality.
>
> I disagree; being forced to handle something manually which could be
> handled automatically counts as a real loss of functionality in my
> book.
I would strongly object to a package which installs other packages
during the build process (actually, it can't do that since I don't
normally build stuff as root). Automatic resolving of dependencies
belongs into the packaging system.
> A suggestion such as you make is nice if you're trying to make your
> installer forward-compatible with distros you don't know about when
> the installer is written, but if you can know the answer, why not use
> that information?
Writing an installer for linux is an error. I curse every vendor who
provides their own installer instead of using the package management
system of the distribution.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9966
***************************************