[23349] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5568 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 26 09:05:57 2003

Date: Fri, 26 Sep 2003 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 26 Sep 2003     Volume: 10 Number: 5568

Today's topics:
    Re: 1) How to debug CGI.pm cookies 2) Template.pm with  <konny@waitrose.com>
    Re: choose from duplicate hash keys <kuujinbo@hotmail.com>
    Re: choose from duplicate hash keys (Anno Siegel)
    Re: choose from duplicate hash keys (Anno Siegel)
    Re: choose from duplicate hash keys <kuujinbo@hotmail.com>
    Re: Evals, quotes and backslashes problem <stefan@unfunked.org>
        Has anyone in here used the GD module on Windows? <someone@somewhere.com>
    Re: Has anyone in here used the GD module on Windows? <ian@WINDOZEdigiserv.net>
    Re: Has anyone in here used the GD module on Windows? <lambik@kieffer.nl>
    Re: Has anyone in here used the GD module on Windows? <someone@somewhere.com>
    Re: Has anyone in here used the GD module on Windows? <someone@somewhere.com>
        Is there a quick way to check if a scalar contains non- <someone@microsoft.com>
    Re: Is there a quick way to check if a scalar contains  (Anno Siegel)
    Re: Is there a quick way to check if a scalar contains  <noreply@gunnar.cc>
    Re: Mapping characters in a string (Anno Siegel)
        newbie question <nospam@nospam.gov>
    Re: newbie question (Anno Siegel)
    Re: newbie question <nospam@nospam.gov>
    Re: newbie question (Anno Siegel)
    Re: packages (Anno Siegel)
        Perl_init_i18nl10n gives a core dump on HP-UX 64 bit en (Nipun Sharma)
    Re: regexp question + html::parser question on the side gisle@activestate.com
    Re: XS/XSUB FAQs? Tutorials? (Anno Siegel)
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 26 Sep 2003 11:26:50 +0100
From: Mr I <konny@waitrose.com>
Subject: Re: 1) How to debug CGI.pm cookies 2) Template.pm with CGI.pm
Message-Id: <eugd41-ouq.ln1@sam.amaretti.net>

Mr I wrote:


>> There's very little that's Perl-specific in any of this.  Most of this
>> discussion would seem to me to be better at home on the group
>>  comp.infosystems.www.authoring.cgi
> 
> Partly agree. All seem to have focused on the least of my  problems that 
> is only the 1st part of my question (see title).
> 
> I was hoping someone would say something like "yes silly use 
> CGI::DisplayCookie" or "its in perldoc ..."  but alias....

Took my own advice :(

2) Template.pm with CGI.pm
original post stated problem / solution. Stopped passing the complex 
data structure CGI and send just the value name pair using CGI's Vars() 
as stated in perldoc CGI in section "FETCHING THE PARAMETER LIST AS A HASH:"

:(

Thanks to all for help.
K



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

Date: Fri, 26 Sep 2003 18:49:04 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: choose from duplicate hash keys
Message-Id: <bl125n$6rm$1@pin3.tky.plala.or.jp>

JohnWalter wrote:

> JohnWalter wrote:
> 
>> Hello
>>
>>
>> in a data file with rows and columns, I need to see which lines are 
>> repeated and get to choose which one of those repeated lines to keep 
>> and delete the rest with their rows from the file.
>> the first column is a uniqe data so it can be considerd a key.
>>
>> can some one give me a hint
>>
>> I am thinking this way
>>
>> open DATA, $file or die $!;
>> while (<DATA>) {
>>     my ($key, @value) = split;
>>     $table{$key}++;
>> }
>> then I am not thinkg right.. what is the value for each key? how can 
>> this be done. print a list of duplicate and get to choose which to 
>> keep and delete the rest.
>>
>> thanks alot
> 
> steps:
> #loop into the file and build a hash with duplicate keys
> open DATA, $from_file or die $!;
> my %duple;
> while (<DATA>) {
>   my ($key, @value) = split;
>   $duple{$key}++;
> }
> 
> #loop into the file and build ARRAY of arrays of those duplicate lines.
> for my $k ( keys %duple ) {
>   if ($duple{$k} > 1) {
>     while (<DATA>) {
>       if ($k = shift ( split )) {
>     my @duple_line = build ARRAY of arrays here.. heeeelp :)
> }
> 
> 
> #foreach ARRAY print arrays with numbers to choose which to keep.
> 
> this is over my head. but I love the challenge
> 

You can do that in one step. If the key *doesn't* exist, make its value 
an anonymous array. If it *does* exist, push the new value into the 
anonymous array:

while (<FH>) {
# assuming the 'key' has no internal whitespace
   my ($key, $value) = split(/\s+/, $_, 2);
   if (! exists $table{$key}) {
     $table{$key} = [ $value ];
   } else {
     push @{ $table{$key} }, $value;
   }
}



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

Date: 26 Sep 2003 10:11:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: choose from duplicate hash keys
Message-Id: <bl13cj$shb$4@mamenchi.zrz.TU-Berlin.DE>

ko  <kuujinbo@hotmail.com> wrote in comp.lang.perl.misc:
> JohnWalter wrote:

[...]

> You can do that in one step. If the key *doesn't* exist, make its value 
> an anonymous array. If it *does* exist, push the new value into the 
> anonymous array:
> 
> while (<FH>) {
> # assuming the 'key' has no internal whitespace
>    my ($key, $value) = split(/\s+/, $_, 2);
>    if (! exists $table{$key}) {
>      $table{$key} = [ $value ];
>    } else {
>      push @{ $table{$key} }, $value;
>    }
> }
> 

You don't need an "if"-branch in the loop body.  Perl's autovivification
creates an arrayref when one is needed:

while (<FH>) {
# assuming the 'key' has no internal whitespace
    my ($key, $value) = split(/\s+/, $_, 2);
    push @{ $table{$key} }, $value;
}

Anno


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

Date: 26 Sep 2003 10:12:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: choose from duplicate hash keys
Message-Id: <bl13e1$shb$5@mamenchi.zrz.TU-Berlin.DE>

JohnWalter  <phddas@yahoo.com> wrote in comp.lang.perl.misc:
> Hello
> 
> 
> in a data file with rows and columns, I need to see which lines are 
> repeated and get to choose which one of those repeated lines to keep and 
> delete the rest with their rows from the file.
> the first column is a uniqe data so it can be considerd a key.
> 
> can some one give me a hint
> 
> I am thinking this way
> 
> open DATA, $file or die $!;
> while (<DATA>) {
> 	my ($key, @value) = split;
> 	$table{$key}++;
> }
> then I am not thinkg right.. what is the value for each key? how can 

The number of times each key is encountered.  Are you using the "++"
operator without knowing what it does?

> this be done. print a list of duplicate and get to choose which to keep 
> and delete the rest.

Collect the values in an arrayref for every key.  In a second pass
you can select one value for every key. Untested:

    while ( <DATA> ) {
        my ( $key, @value) = split;
        push @{ $table{ $key}}, \ @value;
    }

    for ( keys %table ) {
        my $sel = select( @{ $table{ $_}});
        # do something with $sel
    }

Here "select()" is a routine that expects a number of array(ref)s
like @value and returns one of them.

Anno


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

Date: Fri, 26 Sep 2003 19:32:50 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: choose from duplicate hash keys
Message-Id: <bl14nm$953$1@pin3.tky.plala.or.jp>

Anno Siegel wrote:

[snip]
> You don't need an "if"-branch in the loop body.  Perl's autovivification
> creates an arrayref when one is needed:
> 
> while (<FH>) {
> # assuming the 'key' has no internal whitespace
>     my ($key, $value) = split(/\s+/, $_, 2);
>     push @{ $table{$key} }, $value;
> }
> 
> Anno

Thanks!



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

Date: Fri, 26 Sep 2003 11:21:51 +0100
From: Stefan <stefan@unfunked.org>
Subject: Re: Evals, quotes and backslashes problem
Message-Id: <bl1400$j3r$1@newsg3.svr.pol.co.uk>

Paul Burton wrote:
> I've got some code similar to this:
> $a='$b="a_string"';
> eval($a);
> print $b;
> 
> For the above, this simply prints out "a_string".
> 
> Of course, I actually want something a little more interesting than 
> a_string. The output I actually want is the following string:
> \$a_var

I think you want:

$a = '$b="\\\\\\$a_var"';

Remember that because you have two sets of quotes, the string is 
subjected to two levels of interpolation once it has been eval()ed.

After the line above, $a contains:

$b="\\\$a_var"

Then, when this value is eval()ed, $b becomes

\$a_var

See?


Stefan



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

Date: Fri, 26 Sep 2003 11:40:22 +0100
From: "Bigus" <someone@somewhere.com>
Subject: Has anyone in here used the GD module on Windows?
Message-Id: <bl1530$17ac@newton.cc.rl.ac.uk>

Hi

This is not really a Perl question.. that is, I managed to (finally) find a
Perl 5.8 version of GD that you can install using PPM, and I can create
graphs where the output is straight to the web browser and it works very
nicely :-)

However, I want to write the image to a file (pref jpg but png would do if
it's easier). The GD manual (http://www.boutell.com/gd/manual2.0.15.html)
gives links to 2 sites for the PNG libraries and 1 for jpg. However, as far
as I can see, all of the downloads require compiling and I haven't any
experience at all with C Programming. I found one section of supposed
binaries (for zlib IIRC) but the instructions still mentioned something
about including some .h file and didn't tell you what you were supposed to
do with the other files.

Is there a convenient installer anywhere that will just install all the
necessary files to give GD the support it needs to creates image files?

Thanks
Bigus




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

Date: Fri, 26 Sep 2003 10:49:41 GMT
From: "Ian.H" <ian@WINDOZEdigiserv.net>
Subject: Re: Has anyone in here used the GD module on Windows?
Message-Id: <pan.2003.09.26.10.50.36.877278@hybris.digiserv.net>

On Fri, 26 Sep 2003 12:40:22 +0100, Bigus wrote:

> Hi
> 
> This is not really a Perl question.. that is, I managed to (finally) find
> a Perl 5.8 version of GD that you can install using PPM, and I can create
> graphs where the output is straight to the web browser and it works very
> nicely :-)
> 
> However, I want to write the image to a file (pref jpg but png would do if
> it's easier). The GD manual (http://www.boutell.com/gd/manual2.0.15.html)
> gives links to 2 sites for the PNG libraries and 1 for jpg. However, as
> far as I can see, all of the downloads require compiling and I haven't any
> experience at all with C Programming. I found one section of supposed
> binaries (for zlib IIRC) but the instructions still mentioned something
> about including some .h file and didn't tell you what you were supposed to
> do with the other files.
> 
> Is there a convenient installer anywhere that will just install all the
> necessary files to give GD the support it needs to creates image files?
> 
> Thanks
> Bigus


Bigus,

I didn't have a problem. I used PPM to 'install GD' and everything was
installed for me.. no extra libraries required etc.


   <URL:http://tk.digiserv.net/webana/>


has a link at the bottom where you can download that script if you desire
for an example of some Perl->GD code. The image produced is a PNG file,
but this could be replaced with a jpeg call rather than png.

The script was actually developed on windoze (2k) but will happily run on
both windoze and Unix with no mods required. Feel free to use the code for
whatever to help you out if it's of any use =)



Regards,

  Ian

-- 
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.



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

Date: Fri, 26 Sep 2003 14:31:21 +0200
From: "Lambik69" <lambik@kieffer.nl>
Subject: Re: Has anyone in here used the GD module on Windows?
Message-Id: <bl1bo5$6t0td$1@ID-146686.news.uni-berlin.de>

"Ian.H" <ian@WINDOZEdigiserv.net> schreef in bericht
news:pan.2003.09.26.10.50.36.877278@hybris.digiserv.net...
> On Fri, 26 Sep 2003 12:40:22 +0100, Bigus wrote:
>
> I didn't have a problem. I used PPM to 'install GD' and everything was
> installed for me.. no extra libraries required etc.

oh...I get:

C:\WINDOWS>ppm install GD
Error: PPD for 'GD.ppd' could not be found.
C:\WINDOWS>

On 5.6 however it works fine.


>
> Regards,
>
>   Ian
>
> -- 
> Ian.H [Design & Development]
> digiServ Network - Web solutions
> www.digiserv.net | irc.digiserv.net | forum.digiserv.net
> Programming, Web design, development & hosting.
>




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

Date: Fri, 26 Sep 2003 13:35:07 +0100
From: "Bigus" <someone@somewhere.com>
Subject: Re: Has anyone in here used the GD module on Windows?
Message-Id: <bl1bq1$ifu@newton.cc.rl.ac.uk>

"Ian.H" <ian@WINDOZEdigiserv.net> wrote in message
news:pan.2003.09.26.10.50.36.877278@hybris.digiserv.net...
> On Fri, 26 Sep 2003 12:40:22 +0100, Bigus wrote:
>
> > Hi
> >
> > This is not really a Perl question.. that is, I managed to (finally)
find
> > a Perl 5.8 version of GD that you can install using PPM, and I can
create
> > graphs where the output is straight to the web browser and it works very
> > nicely :-)
> >
> > However, I want to write the image to a file (pref jpg but png would do
if
> > it's easier). The GD manual
(http://www.boutell.com/gd/manual2.0.15.html)
> > gives links to 2 sites for the PNG libraries and 1 for jpg. However, as
> > far as I can see, all of the downloads require compiling and I haven't
any
> > experience at all with C Programming. I found one section of supposed
> > binaries (for zlib IIRC) but the instructions still mentioned something
> > about including some .h file and didn't tell you what you were supposed
to
> > do with the other files.
> >
> > Is there a convenient installer anywhere that will just install all the
> > necessary files to give GD the support it needs to creates image files?
> >
> > Thanks
> > Bigus
>
>
> Bigus,
>
> I didn't have a problem. I used PPM to 'install GD' and everything was
> installed for me.. no extra libraries required etc.
>
>    <URL:http://tk.digiserv.net/webana/>
>
> has a link at the bottom where you can download that script if you desire
> for an example of some Perl->GD code. The image produced is a PNG file,
> but this could be replaced with a jpeg call rather than png.
>
> The script was actually developed on windoze (2k) but will happily run on
> both windoze and Unix with no mods required. Feel free to use the code for
> whatever to help you out if it's of any use =)

Hi Ian

Thanks for that.. I must confess that PNG generation does actually work. I
was trying to create jpg's and it comes up with:

Can't locate object method "jpg" via package "GD::Image"

in the Apache error log. I didn't actually try PNG because I assumed that
since the boutell.com instructions mentioned installing supporting libraries
for PNG and JPG, and JPG wasn't working, that neither would PNG. It does,
which I guess will do.. I'd still prefer jpgs though, since browser support
is supposed to be better.

Regards

Bigus




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

Date: Fri, 26 Sep 2003 13:41:38 +0100
From: "Bigus" <someone@somewhere.com>
Subject: Re: Has anyone in here used the GD module on Windows?
Message-Id: <bl1c64$icc@newton.cc.rl.ac.uk>


"Lambik69" <lambik@kieffer.nl> wrote in message
news:bl1bo5$6t0td$1@ID-146686.news.uni-berlin.de...
> "Ian.H" <ian@WINDOZEdigiserv.net> schreef in bericht
> news:pan.2003.09.26.10.50.36.877278@hybris.digiserv.net...
> > On Fri, 26 Sep 2003 12:40:22 +0100, Bigus wrote:
> >
> > I didn't have a problem. I used PPM to 'install GD' and everything was
> > installed for me.. no extra libraries required etc.
>
> oh...I get:
>
> C:\WINDOWS>ppm install GD
> Error: PPD for 'GD.ppd' could not be found.
> C:\WINDOWS>
>
> On 5.6 however it works fine.

Yeah, on 5.8 I found a repository with some updated modules. At the ppm>
command prompt you type:

  rep add winnipeg http://theoryx5.uwinnipeg.ca/ppms

Then, "search GD" will reveal ver 2.07 of GD :-)

Bigus




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

Date: Fri, 26 Sep 2003 10:11:23 GMT
From: "John Smith" <someone@microsoft.com>
Subject: Is there a quick way to check if a scalar contains non-alpha-numeric characters?
Message-Id: <fhUcb.15700$Ej.2225557@ursa-nb00s0.nbnet.nb.ca>

Hi all,

I want to ensure that a variable does not contain spaces, and other
non-alpha-numeric characters such as !#$%^&*()-=+, etc... Basically, this
variable is a username that someone is sending to me and will only be 4 to
10 characters long. It must only contain numbers and letters, otherwise I
will reject it.

Is there a quick way to do this or must I create a loop and check every
letter?

Thanks for all,

Guy Doucet




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

Date: 26 Sep 2003 10:15:50 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is there a quick way to check if a scalar contains non-alpha-numeric characters?
Message-Id: <bl13km$shb$6@mamenchi.zrz.TU-Berlin.DE>

John Smith <someone@microsoft.com> wrote in comp.lang.perl.misc:
> Hi all,
> 
> I want to ensure that a variable does not contain spaces, and other
> non-alpha-numeric characters such as !#$%^&*()-=+, etc... Basically, this
> variable is a username that someone is sending to me and will only be 4 to
> 10 characters long. It must only contain numbers and letters, otherwise I
> will reject it.
> 
> Is there a quick way to do this or must I create a loop and check every
> letter?

No.  A regular expression (or a tr///) and a call to length() should do.

What have you tried so far?

We are happy to help with code, but not happy to write solutions from
scratch.

Anno


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

Date: Fri, 26 Sep 2003 12:23:52 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Is there a quick way to check if a scalar contains non-alpha-numeric characters?
Message-Id: <bl145a$6sr9d$1@ID-184292.news.uni-berlin.de>

John Smith wrote:
> I want to ensure that a variable does not contain spaces, and other
> non-alpha-numeric characters such as !#$%^&*()-=+, etc...
> Basically, this variable is a username that someone is sending to
> me and will only be 4 to 10 characters long. It must only contain
> numbers and letters, otherwise I will reject it.
> 
> Is there a quick way to do this or must I create a loop and check
> every letter?

That is easily done with a regular expression.

     perldoc perlre

     http://www.perldoc.com/perl5.8.0/pod/perlre.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: 26 Sep 2003 12:13:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Mapping characters in a string
Message-Id: <bl1ah7$5nb$1@mamenchi.zrz.TU-Berlin.DE>

Uri Guttman  <uri@stemsystems.com> wrote in comp.lang.perl.misc:
> >>>>> "AvC" == Alfred von Campe <alfred@110.net> writes:
> 
>   AvC> Uri Guttman <uri@stemsystems.com> wrote:
>   >> you should have stated that with the original problem. note that you got
>   >> two answers (abigail's any my slightly incorrect one) but do you
>   >> understand how they work? please don't cut and paste them and not know
>   >> why they work. that would be antithetical to this group's goals
> 
>   AvC> Mea culpa (on the original problem statement).  I did use Abigail's
>   AvC> solution and modified it slightly.  I didn't understand it at first,
>   AvC> but I do now (after disecting it from right to left).
> 
> then show us your modifications. anything generally interesting? or was
> is just to your taste?

If efficiency is any concern, the tr/// solution I posted is faster
by a factor of 7.  That is calling tr/// through string-eval each time.
If the tr/// is precompiled, it is about 130 times as fast.  So there's
room for improvement, if needed.

Anno


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

Date: Fri, 26 Sep 2003 13:26:03 +0100
From: kaptain kernel <nospam@nospam.gov>
Subject: newbie question
Message-Id: <3f74305b$0$24121$afc38c87@news.easynet.co.uk>

sorry , i'm new to perl.

i'm trying to decipher some perl code at work, and i was wondering what does
this mean:

$myvariable=100*


doe this mean multiple myvariable by 100?


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

Date: 26 Sep 2003 12:28:20 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: newbie question
Message-Id: <bl1bd4$5nb$2@mamenchi.zrz.TU-Berlin.DE>

kaptain kernel  <nospam@nospam.gov> wrote in comp.lang.perl.misc:
> sorry , i'm new to perl.
> 
> i'm trying to decipher some perl code at work, and i was wondering what does
> this mean:
> 
> $myvariable=100*
> 
> 
> doe this mean multiple myvariable by 100?

No.  It's not Perl.  Copy and paste the actual code.

Anno


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

Date: Fri, 26 Sep 2003 13:53:29 +0100
From: kaptain kernel <nospam@nospam.gov>
Subject: Re: newbie question
Message-Id: <3f7436c9$0$24114$afc38c87@news.easynet.co.uk>

Anno Siegel wrote:

> kaptain kernel  <nospam@nospam.gov> wrote in comp.lang.perl.misc:
>> sorry , i'm new to perl.
>> 
>> i'm trying to decipher some perl code at work, and i was wondering what
>> does this mean:
>> 
>> $myvariable=100*
>> 
>> 
>> doe this mean multiple myvariable by 100?
> 
> No.  It's not Perl.  Copy and paste the actual code.
> 
> Anno

my bad - the code was poorly formatted.

it looked like this:

$myvariable=100*


$anothervariable




when it should be

$myvariable=100*$anothervariable



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

Date: 26 Sep 2003 13:03:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: newbie question
Message-Id: <bl1dej$5nb$3@mamenchi.zrz.TU-Berlin.DE>

kaptain kernel  <nospam@nospam.gov> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> 
> > kaptain kernel  <nospam@nospam.gov> wrote in comp.lang.perl.misc:
> >> sorry , i'm new to perl.
> >> 
> >> i'm trying to decipher some perl code at work, and i was wondering what
> >> does this mean:
> >> 
> >> $myvariable=100*
> >> 
> >> 
> >> doe this mean multiple myvariable by 100?
> > 
> > No.  It's not Perl.  Copy and paste the actual code.
> > 
> > Anno
> 
> my bad - the code was poorly formatted.
> 
> it looked like this:
> 
> $myvariable=100*
> 
> 
> $anothervariable
> 
> 
> 
> 
> when it should be
> 
> $myvariable=100*$anothervariable

To answer your question, that multiplies the value in $anothervariable
with 100 and assigns the result to $myvariable.  The statement is still
missing a semicolon (";") at the end, which would be needed if more
statements were to follow.

However, this isn't going to take you anywhere.  You are not going
to learn Perl by presenting tiny snippets of Perl code to the group
asking for an explanation.  The group isn't going to go along much
either.

Get a decent tutorial, like _Learning Perl_ from O'Reilly.  If that
raises specific questions, you can ask them here.

Anno


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

Date: 26 Sep 2003 11:37:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: packages
Message-Id: <bl18dr$30t$2@mamenchi.zrz.TU-Berlin.DE>

Steve Grazzini  <grazz@pobox.com> wrote in comp.lang.perl.misc:
> Steve Grazzini <grazz@pobox.com> wrote:
> > And since you said that doing it this way avoids pulling in another 
> > whole module: Exporter is ALREADY LOADED!  (By CGI.pm.) 
> 
> Okay, this is not actually the case.  In fact, CGI says that it
> doesn't use Exporter for reasons of "execution speed" -- but I 
> still think it's better to be slow than incorrect, and that
> Exporter is not really so slow, and that constantly reinventing
> Exporter will eventually lead to *more* bloat, not less.

In fact, Exporter bends over backwards to load only minimal stubs
at compile time.  Only when Exporter->import is actually called
the heavy stuff is pulled in (only once, of course).  Carp is
constructed similarly.

Anno


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

Date: 26 Sep 2003 03:36:31 -0700
From: ehsnish@yahoo.com (Nipun Sharma)
Subject: Perl_init_i18nl10n gives a core dump on HP-UX 64 bit env
Message-Id: <6ac30413.0309260236.60c45102@posting.google.com>

HI !
     I am compiling a program where perl is embedded in C on HPUX 64
bit env. The perl is 32 bit executable . The same code is running fine
on Linux 64 bit but gives a core dump on HPUX . The version of Perl is
5.8.0 .

The code is pasted below ................

static int32_t
Init_Perl(int32_t P_argc, char** P_argv, char** P_env)
{
   int32_t  L_exitstatus;
   char*    L_env;
   char*    L_load[] = {"",
                        "-e", "sub _load_ { $m=shift; require $m; } ",
                        "-e",
            "sub _eval_ { eval ss7diagParser::syntax($_[0]);
return($RETURN)} "
                       };

   PERL_SYS_INIT(&P_argc,&P_argv);

   perl_init_i18nl14n(1);  // giving a core dump on this line 

 .....
 .....


 I am attaching the core analysis by gdb .... below

#0  0x445e9a0:0 in Perl_new_collate+0x260 ()
(gdb) where
#0  0x445e9a0:0 in Perl_new_collate+0x260 ()
#1  0x4460fa0:0 in Perl_init_i18nl10n+0x2220 ()
#2  0x4461680:0 in Perl_init_i18nl14n+0x40 ()
#3  0x404b900:0 in Init_Perl+0xf0 ()
#4  0x404d240:0 in main+0x2d0 ()

 did any one of you have encountered this problem ?


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

Date: 26 Sep 2003 05:59:45 -0700
From: gisle@activestate.com
Subject: Re: regexp question + html::parser question on the side
Message-Id: <m3pthnn1ry.fsf@eik.i-did-not-set--mail-host-address--so-shoot-me>

bbass@hotmail.com (boris bass) writes:

> ps. this could probably be done via HTML::Parser module and not
> through the regular expressions.
> 
> the task i am trying to accomplish: find
> 
> <a href="something">
> 
> and change it to
> 
> <a href=""> 
> 
> i.e. delete a link to whatever and leave an empty string in place of
> it.

http://search.cpan.org/src/GAAS/HTML-Parser-3.31/eg/hrefsub is an
example of some code that can do this (and more).

-- 
Gisle Aas


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

Date: 26 Sep 2003 11:29:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: XS/XSUB FAQs? Tutorials?
Message-Id: <bl17u2$30t$1@mamenchi.zrz.TU-Berlin.DE>

Iain Truskett  <ict@eh.org> wrote in comp.lang.perl.misc:
> * Jeff <jeffjackson@fairisaac.com>:
> > I'm looking for documentation beyond the perlxs and perlXStut docs. 
> > Is there anything else available.
> 
> "Extending and Embedding Perl", Simon Cozens and Tim Jenness.
>     http://books.perl.org/book/147
> 
> See also: http://books.perl.org/category/20
> 
> [...]
> > We have an existing C library (libxlate.so) that I would
> > like to reference in a Perl utility that we use quite a
> > bit. I want to create a Translate.pm module that my Perl
> > utility can use to reference the library's functions. None
> > of the examples talk about something like this. Does
> > anyone have any suggestions?
> 
> I imagine h2xs will prove invaluable. Check it out.

Also, take a look at the Inline module.  It supports building wrappers
to existing libraries.  In simple cases (meaning that the parameters
and return values of the library functions are sufficiently simple),
it suffices to hand Inline the library's header file, and it builds
the wrapper module for you.

Anno


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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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.  

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 5568
***************************************


home help back first fref pref prev next nref lref last post