Re: PAUSE bug leads to LWP bug

2002-03-08 Thread Gisle Aas

Dan Kogai <[EMAIL PROTECTED]> writes:

>   or any whitespace will do.  I am not sure if I should call this a
> bug because this is a kind of nice.  But it is certainly undocumented
> and definitely confusing.

perldoc URI

   $uri = URI->new( $str, [$scheme] )
   This class method constructs a new URI object.  The
   string representation of a URI is given as argument
   together with an optional scheme specification.  ComĀ­
   mon URI wrappers like "" and <>, as well as leading
   and trailing white space, are automatically removed
   from the $str argument before it is processed further.





Re: Patch for LWP Makefile.PL

2003-10-15 Thread Gisle Aas
Ken Williams <[EMAIL PROTECTED]> writes:

> There's still a flaw with the conflict-detection in LWP's Makefile.PL
> that prevents /usr/bin/head from being overwritten by HEAD on Mac OS
> X. The problem is that MakeMaker uses $Config{installscript} as the
> installation location for EXE_FILES items, not $Config{sitebin} as was
> assumed in the code.  Therefore the conflict never gets detected when
> those two paths are different.
> 
> The patch below is against LWP 5.69.

Applied.

Regards,
Gisle


> =
> --- Makefile.PL-orig  Fri Jul 11 10:03:30 2003
> +++ Makefile.PL   Fri Jul 11 10:08:46 2003
> @@ -87,7 +87,7 @@
>   print < 
>   This package comes with some sample programs that I can try
> -to install in $Config{sitebin}.
> +to install in $Config{installscript}.
> 
>  Note that you can avoid these questions by passing
>  the '-n' option to 'Makefile.PL'.
> @@ -108,7 +108,7 @@
>   The lwp-request program will use the name it is invoked with to
>   determine what HTTP method to use.  I can set up alias for the most
>   common HTTP methods.  These alias are also installed in
> -$Config{sitebin}.
> +$Config{installscript}.
> 
>   EOT
>   my @tmp;
> @@ -116,7 +116,7 @@
>   my $default = "y";
>   # check that we don't overwrite something unrelated with
>   # the current defaults.
> - if (open(PROG, "<$Config{sitebin}/$alias")) {
> + if (open(PROG, "<$Config{installscript}/$alias")) {
>   $default = "n";
>   while () {
>   if (/lwp-request/) {
> =


Re: CamelBones on Intel? Maybe not.

2005-06-07 Thread Gisle Aas
Sherm Pendley <[EMAIL PROTECTED]> writes:

> To most developers using Cocoa or Carbon, building a "fat" binary is
> painless - it's a matter of checking the right box in Xcode. The
> problem I'm facing is that for CamelBones, because of the way Perl
> builds its modules, the transition will be far more painful than it
> will be for most apps.

Why would it be painful to compile perl and its modules as a fat
binaries?

I see that perl's hints/darwin.sh override the $archname with this
comment:

  # Since we can build fat, the archname doesn't need the processor type
  archname='darwin';

Has anybody ever tried to build a fat perl?

--Gisle


Re: HTTP::Recorder dying

2005-08-22 Thread Gisle Aas
Paul Fons <[EMAIL PROTECTED]> writes:

> I am trying to automate a web page interaction and to figure out the
> initial interaction sequence, I have installed HTTP::Recorder and
> HTTP::Proxy, but the recorder fails to follow the login-in button due
> to a missing method called "query_param".  Any advice here?

Try to add the statement 'use URI::QueryParam' to your program.

Regards,
Gisle


Re: CPAN

2005-10-29 Thread Gisle Aas
Dave Linton <[EMAIL PROTECTED]> writes:

> On 29 Oct 2005, at 15:45, Jeff Lowrey wrote:
> 
> > What you should do is run CPAN (sudo cpan), and type "Install
> > HTML::Parser".
> >
> > And then post the output from that here.
> 
> Thanks Jeff
> 
> cpan tells me (after reporting various ftp transfers etc):
> 
> HTML::Parser is up to date.

Run "force install HTML::Parser" from the cpan shell then.  This will
reinstall the module even if it is believed to be up to data.  The
reason CPAN was fooled is probably that you copied the Parser.pm into
the perl tree in your first attempt.

Regards,
Gisle


> Running the validator still gives me:
> 
> Can't locate loadable object for module HTML::Parser in @INC (@INC
> contains: /System/Library/Perl/5.8.1/darwin-thread-multi-2level
> /System/Library/Perl/5.8.1
> /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1
> /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level
> /Network/Library/Perl/5.8.1 /Network/Library/Perl) at
> /Library/WebServer/Documents/validator/htdocs/check line 48
> Compilation failed in require at
> /Library/WebServer/Documents/validator/htdocs/check line 48.
> BEGIN failed--compilation aborted at
> /Library/WebServer/Documents/validator/htdocs/check line 48.


Re: Character Encodings

2005-11-25 Thread Gisle Aas
[EMAIL PROTECTED] writes:

> Thanks for that very detailed answer, but let me reduce my question to this:
> 
> #!/usr/bin/perl
> 
> $str = 'it's a smart quote';
> if ($str =~ m/\x{2019}/){
>print "found"
> } else {
>print "not found"
> }
> 
> BBEdit confirms that the third char in 'it's a smart quote' is 2019.

What does ord(substr($str, 2, 1)) print then?

--Gisle


Re: Character Encodings

2005-11-25 Thread Gisle Aas
John Delacour <[EMAIL PROTECTED]> writes:

> "use utf8" does nothing.

It's supposed to.  If it doesn't make the source interpreted as UTF-8
then it's a bug.

...and it works for me (perl 5.8.7).

--Gisle


Re: Upgrading Perl 5.8.8

2006-09-26 Thread Gisle Aas
Robert Hicks <[EMAIL PROTECTED]> writes:

> I know that Tiger comes with 5.8.6 but I would like to get 5.8.8 up
> and running.
> 
> I am just wondering if I should:
> 
> a) download and compile Perl myself and replace the Tiger version
> b) use macports (aka darwinports) to install 5.8.8 in /opt
> 
> What did you do?

I installed ActivePerl :)

  http://downloads.activestate.com/ActivePerl/MacOSX/5.8/

-- 
Gisle Aas


Re: encode qp a Unicode string

2006-10-07 Thread Gisle Aas
Nobumi Iyanaga <[EMAIL PROTECTED]> writes:

> What am I doing wrong?

You did not read 'perldoc MIME::QuotedPrint' to the end :)

|Perl v5.8 and better allow extended Unicode characters in strings.  Such 
strings
|cannot be encoded directly, as the quoted-printable encoding is only 
defined for
|single-byte characters.  The solution is to use the Encode module to 
select the byte
|encoding you want.  For example:
|
|use MIME::QuotedPrint qw(encode_qp);
|use Encode qw(encode);
|
|$encoded = encode_qp(encode("UTF-8", "\x{}\n"));
|print $encoded;

Regards,
Gisle