comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
November 2006
motuwethfrsasuw
  12345 44
6789101112 45
13141516171819 46
20212223242526 47
27282930    48
2006
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: how to do this with RE?         


Author: Steve K.
Date: Nov 30, 2006 23:22

Tad McClellan wrote:
> Arthur gmail.com> wrote:
>
>
>> $foo is a string with leading spaces of variable number, like
>>
>> " Willy"
>
>
> That is a pretty long-winded way of saying:
>
> $foo = " Willy";
>
> Have you seen the Posting Guidelines that are posted here frequently?

I don't see them at all in my spool. I'm not sure when the last time it
was posted (haven't seen them in a while come to think of it), it's also
possible others my not be seeing it too. But then again, you and others
have been told this before by others.
no comments
  Re: using DateTime object         


Author: Steve K.
Date: Nov 30, 2006 23:00

Sherm Pendley wrote:
> Are you saying that you didn't copy-and-paste your real code, as the
> group guidelines suggest you do? Why not? You *have* read the
> guidelines, haven't you?

This common short sightedness keeps coming back again and again around
here. I have looked and looked and I don't see any posting for a
guideline in the correct listing for this group from my news server.

If he is news to this group, I think it is a little unfair to expect him
to have read something he may not have any knowledge about.

It's like expecting someone who enters a building to read the directory,
when the directory is down a couple of hallways, constantly changing
it's location (just like you never really know where and if you'll have
the guideline posting, if it's still being posted, in your spool.)

I could understand this sort of attitude on a medium such as a web forum
where FAQs are either global fixed links at the top of the of the board,
or as "pinned" FAQ postings for a given forum.

But in a medium such as NNTP where such postings are hit and miss, it's
just plain asinine to think everyone automatically knows of and even is
able to see them.
no comments
  Add a #include line to all c/c++ plus files         


Author: RedDevilDan
Date: Nov 30, 2006 22:42

I am new to Perl. In linux/unix, is there anyway to add the #include
line to all *.c or *.cpp files automatically?

I have a large project which contains thousands of .c or .cpp source
files. However, I decided to #include a common header file into all
source files in order to config them globally. Is there anyway to do
that easily?
4 Comments
  regex question         


Author: googler
Date: Nov 30, 2006 21:21

Hi all,

Say I have a variable $str as below.
$str = "a_long_object_name";

I want to transform $str to something like "aLongObjectName". How can
this be done using regular expression? There can be any number of
constituent words in the original string, each of them separated by an
underscore character.

Thank you.
5 Comments
  exec dynamic script, capture output, but see vars of caller?         


Author:
Date: Nov 30, 2006 20:06

Hello, I've been tasked with writing a Perl program that generates
another Perl script on the fly (by parsing a file, whose name is passed
to the base script, that is basically a Perl program interweaved in a
document, where the Perl code it inside special tokens (sorta kinda like
how php looks like sitting among html markup.))

I can very easily parse the page using a couple of s/// statements and
such (god I love Perl's native RegEx :-) ) as needed and either execute
with an eval() or dump the code into a file and execute it that.

Now an additional requirement has been tasked on me. The parsed code
needs to be able to 'see' global variables defined in the base script
(most of which comes from a use'ed package lib.)

I thought maybe I have solved this by simply dumping the parsed code
into a file and using it with require, which /does/ work until there's
an error in the code.
Show full article (1.48Kb)
1 Comment
  Re: how to do this with RE?         


Author: Andrew DeFaria
Date: Nov 30, 2006 20:01

Arthur wrote:
> In fact I wasn't trying to move Willy to the right. Some of the
> postings on my web forum are written as poems, with some lines like
> that, so I just want to display the lines as intended. (Trailing
> spaces cause problems if replaced with   because very long lines
> don't wrap properly.)


--

Andrew DeFaria <http://defaria.com>
All women are idiots... and I married their queen.

Arthur wrote:
In
fact I wasn't trying to move Willy to the right. Some of the postings
on my web forum are written as poems, with some lines like that, so I
just want to display the lines as intended. (Trailing spaces cause
problems if replaced with   because very long lines don't wrap
properly.)
Show full article (0.80Kb)
2 Comments
  CPAN modules in commercial programs         


Author: Shiraz
Date: Nov 30, 2006 19:25

can anyone point me to a resource or explain the requirements or
conditions that exists if one wants to use a module from CPAN in a
commercial software that i am going to sell.
1 Comment
  Re: it just wouldn't compile         


Author: Ben Morrow
Date: Nov 30, 2006 18:23

Quoth "Paul Lalli" gmail.com>:
> tamiry wrote:
>> I had some code in a module that won't compile. i narrowed down the
>> code to the miimu that won't compile. It looks like the division sign
>> confuses the switch statement. I'll be happy if someone could point the
>> problem(s).
>
> Switch.pm is probably the buggiest standard module out there. It uses
> Source Filtering to rearrange your code, and it pretty frequently
> doesn't get it right. I've encountered similar problems to yours in
> the past. I have no advice to offer you other than "get rid of Switch,
> and write the if/elsif's yourself".

Or perhaps 'wait for 5.10, and use given/when'...

Ben

--
Although few may originate a policy, we are all able to judge it.
Pericles of Athens, c.430 B.C.
benmorrow@tiscali.co.uk
no comments
  Re: CGI parsing         


Author: Ben Morrow
Date: Nov 30, 2006 18:19

Quoth Gunnar Hjalmarsson :
> Ben Morrow wrote:
>> If you can do it *correctly* more efficiently than CGI.pm can,
>
> Of course I can; just did.
> http://groups.google.com/group/comp.lang.perl.misc/msg/827b6bb5568885f3
>
> I.e. it does *correctly* what it's supposed to do. (It's not supposed to
> handle e.g. multivalue fields or file uploads.)

I'm not really competent to judge whether it's correct, not having read
the CGI spec recently; as for 'more efficient', did you benchmark it?
Can we see the results?
>> then by all means please release your code as CGI::VeryEfficient or
>> something, and then the rest of us can get the benefit as well.
>
> Since there already are alternative CGI parsing modules, there is no
> need to release another one.
Show full article (1.86Kb)
1 Comment
  FAQ 3.14 How can I use X or Tk with Perl?         


Author: PerlFAQ Server
Date: Nov 30, 2006 18:03

This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

3.14: How can I use X or Tk with Perl?

The Tk.pm module is a completely Perl-based, object-oriented interface
to the Tk toolkit that doesn't force you to use Tcl just to get at Tk.
Sx is an interface to the Athena Widget set. Both are available from
CPAN. See the directory
http://www.cpan.org/modules/by-category/08_User_Interfaces/

Invaluable for Perl/Tk programming are the Perl/Tk FAQ at
http://phaseit.net/claird/comp.lang.perl.tk/ptkFAQ.html , the Perl/Tk
Reference Guide available at
http://www.cpan.org/authors/Stephen_O_Lidie/ , and the online manpages
at http://www-users.cs.umn.edu/%%7Eamundson/perl/perltk/toc.html .

--------------------------------------------------------------------
Show full article (1.71Kb)
no comments
1 2 3 4 5 6 7 8 9