comp.lang.perl.misc
  Home FAQ Contact Sign in
Your Ad Here
comp.lang.perl.misc only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 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
  Process to fix a broken CPAN module?         


Author: google
Date: May 5, 2008 23:43

I have found a major flaw in a CPAN package. The package is
File::Binary and it has big endian and little endian unpack-ing
backwards. Likewise, all the test files are reversed so that the
tests all pass!

Why do I believe this is true?

From the perl manual on pack:
n,N unpacks a 16 or 32 bit integer in "network" or big endian order
v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order

From the code:
if ($endian == $BIG_ENDIAN) {
$self->{_ui16} = 'v';
$self->{_ui32} = 'V';
} else {
$self->{_ui16} = 'n';
$self->{_ui32} = 'N';
}

When I 'od -x' the test files, they are clearly reversed:
Show full article (1.51Kb)
2 Comments
  Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)         


Author: tadmc
Date: May 5, 2008 23:10

Outline
Before posting to comp.lang.perl.misc
Must
- Check the Perl Frequently Asked Questions (FAQ)
- Check the other standard Perl docs (*.pod)
Really Really Should
- Lurk for a while before posting
- Search a Usenet archive
If You Like
- Check Other Resources
Posting to comp.lang.perl.misc
Is there a better place to ask your question?
- Question should be about Perl, not about the application area
How to participate (post) in the clpmisc community
- Carefully choose the contents of your Subject header
- Use an effective followup style
- Speak Perl rather than English, when possible
- Ask perl to help you
- Do not re-type Perl code
- Provide enough information ...
Show full article (16.63Kb)
no comments
  perl GD Image resolution problem         


Author: Zhiliang Hu
Date: May 5, 2008 20:28

I use GD::Image to create figures. Here is an example:
http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png

For publication purposes we need high resolution pictures. I am
seeking expert advice as how can I improve the resolution?

Thanks in advance!

Zhiliang
6 Comments
  Identification of which line causing regex problem         


Author: Ela
Date: May 5, 2008 18:44

Dear all,

I'm modifying a system (totally more than 100000-lines for tens of files)
written by others and would like to identify which line leads to the
following problem.

Invalid [] range "l-c" in regex; marked by
-- HERE in m/^3-oxoacyl-[acyl-c
<-- HERE arrier protein] reductase fabg1$/

Unfortunately the error message does not tell me which line of which file
leads to the problem. Could anybody advise?
12 Comments
  Some sort of scoping problem         


Author: Mintcake
Date: May 5, 2008 18:04

This is *not* a trivial problem. If you know Perl well, please take a
bit of time to look at this.

I have the following code in a file Foo.pm

package Foo;

my @xyzzy = (1,2,3);

sub new {
my $self = bless {}, shift;
$self->ini('xyzzy');
print \@xyzzy, ' ', scalar @xyzzy;
print $self->{xyzzy}, ' ', scalar @{$self->{xyzzy}};
}

sub ini {
my ($self, $field) = @_;
eval "\$self->{$field} = \\\@$field";
}

1;

__END__

My main program is simply this:

#!/usr/local/bin/perl -l
Show full article (1.38Kb)
7 Comments
  FAQ 4.26 How do I reformat a paragraph?         


Author: PerlFAQ Server
Date: May 5, 2008 18:03

This is an excerpt from the latest version perlfaq4.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 .

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

4.26: How do I reformat a paragraph?

Use "Text::Wrap" (part of the standard Perl distribution):

use Text::Wrap;
print wrap("\t", ' ', @paragraphs);

The paragraphs you give to "Text::Wrap" should not contain embedded
newlines. "Text::Wrap" doesn't justify the lines (flush-right).

Or use the CPAN module "Text::Autoformat". Formatting files can be
easily done by making a shell alias, like so:

alias fmt="perl -i -MText::Autoformat -n0777 \
-e 'print autoformat $_, {all=>1}' $*"

See the documentation for "Text::Autoformat" to appreciate its many
capabilities.

--------------------------------------------------------------------
Show full article (1.63Kb)
no comments
  maximum hash/array keys/values         


Author: Slickuser
Date: May 5, 2008 17:04

What's the maximum hash/array in Perl can hold for keys and values?

Thanks.
4 Comments
  WriteExcel->sheets() fails to get the worksheets         


Author: Anand
Date: May 5, 2008 16:36

I am trying to read an excel file usign the writeexcel. Following is
the code-snippet:
my $workbook = Spreadsheet::WriteExcel->new('Temp.xls');

print "Cannot create Temp.xls: $!\n" if (not defined $workbook);

foreach $worksheet ($workbook->sheets()) {
print "Worksheet Name is: ".$worksheet->get_name()."\n";
}

The file Temp.xls is already existing in the directory. I want to
further modify the worksheets. However, the sheets() method itself is
not working.
What might be the reason? I'm using perl 5.8

Thanks,
Anand.
3 Comments
  RXParse 1.2         


Author: sln
Date: May 5, 2008 15:24

RXParse 1.2 parse/edit/filter module
Webmasters please adhere to the copyright notice at the top of the listing.

After a 1-1/2 year hiatus, I am revisiting the development of this code with
special attention towards implementation of parse and edit as you go.
There are many excellent xml query tools out there like Xpath and Xslt so
this will not be the focus for RXParse. There are many writers out there
as well, but that is not going to be the focus.

The power of RXParse is going to reside in it's ability to do dynamic inline
editing from SAX without the need of caching nodes and re-writing xml.
RXParse like all other SAX parsers, can work on the largest xml files, using
a very small footprint.

Note that it is not the intention of RXParse to be fully itterationally-compliant
with external substitutions. As such, it works on the 'face' of an xml document.
As such, ATTLIST, ELEMENT and DOCTYPE are not processed beyond thier face identities.
They are handled on face value only; ie: no itterative process is involeved.
All the face xml types are handled in a parsing sence.
Show full article (29.21Kb)
no comments
Your Ad Here
  FAQ 4.5 How do I convert between numeric representations/bases/radixes?         


Author: PerlFAQ Server
Date: May 5, 2008 12:03

This is an excerpt from the latest version perlfaq4.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 .

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

4.5: How do I convert between numeric representations/bases/radixes?

As always with Perl there is more than one way to do it. Below are a few
examples of approaches to making common conversions between number
representations. This is intended to be representational rather than
exhaustive.

Some of the examples later in perlfaq4 use the "Bit::Vector" module from
CPAN. The reason you might choose "Bit::Vector" over the perl built in
functions is that it works with numbers of ANY size, that it is
optimized for speed on some operations, and for at least some
programmers the notation might be familiar.

How do I convert hexadecimal into decimal
Using perl's built in conversion of "0x" notation:

$dec = 0xDEADBEEF;
Show full article (5.00Kb)
no comments
1 2