[22023] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4245 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 11 00:05:54 2002

Date: Tue, 10 Dec 2002 21:05:12 -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, 10 Dec 2002     Volume: 10 Number: 4245

Today's topics:
    Re: @INC error in in unix <family2@aracnet.com>
    Re: A formating problem (Tad McClellan)
    Re: Comparison confusion <jkeen@concentric.net>
    Re: Comparison confusion <eric@spamnotcfm-consulting.com>
    Re: Comparison confusion (Tad McClellan)
    Re: Comparison confusion <bwalton@rochester.rr.com>
    Re: debug in cgi environment (indigoperl) ? <os7man@attbi.com>
    Re: debug in cgi environment (indigoperl) ? <jurgenex@hotmail.com>
    Re: debug in cgi environment (indigoperl) ? <bwalton@rochester.rr.com>
    Re: debug in cgi environment (indigoperl) ? (Tad McClellan)
    Re: HELP.... problem splitting fields <garry@ifr.zvolve.net>
    Re: HOW DO YOU CONSTRUCT A URL STRING FROM A POST METHO <jurgenex@hotmail.com>
        How does HTML encodes GET and POST requests? (gnuist006)
    Re: How to do 32-bit calculations WITH overflow? (Alan Barclay)
        incorporating off-site content <moo@cow.com>
    Re: incorporating off-site content (Tad McClellan)
    Re: incorporating off-site content <moo@cow.com>
    Re: Max fork'd proc limit...? <eric@spamnotcfm-consulting.com>
    Re: Newbie question <spam@thecouch.homeip.net>
    Re: perl bad interpreter: No such file or directory <eric@spamnotcfm-consulting.com>
    Re: perl bad interpreter: No such file or directory <bongie@gmx.net>
    Re: porting a routine which uses uint32_t (Sisyphus)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 10 Dec 2002 20:13:55 -0600
From: Abernathey Family <family2@aracnet.com>
Subject: Re: @INC error in in unix
Message-Id: <3DF69F63.8165D24F@aracnet.com>

Brian McCauley wrote:
> 
> "Sunil" <sunil_franklin@hotmail.com> writes:
> 
> > (@INC contains:
> >  'some directory I don't even have'
> >  .....
> >   'some other directory I don't even have'  .
> > ) at myprg.pl line 53.
> >
> >
> > The default perl in my path is of an older version and I was running my
> > program by using
> >         /full/path/to/561/perl/bin/perl myprg.pl  -Idir
> > /full/path/to/561/perl/lib/5.6.1
> 
> You have made two careless mistakes in reading the perlrun manpage.
--snip--
Christmas is coming and Santa is going to put you on the naughty list if
you don't learn to leave your vitrol out of your "help".


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

Date: Tue, 10 Dec 2002 20:40:06 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: A formating problem
Message-Id: <slrnavd9c6.49c.tadmc@magna.augustmail.com>

Jan Fure <jan_may2002_fure@attbi.com> wrote:
> Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote in message 


[snip japhy's code, repeated below]


> I like your solution a lot, but unfortunately it does not work for
> getting the proper format. 


Yes it does. What makes you think it doesn't?

Did you print out the structure to see what was built?

Did you miss autovivification creating another level of
array for you in the push() statement?


> The @points array needs to be an array of
> arrays, where the first element (the keys) is an array, and the second
> element is an array of arrays, with one element per key, and each
> element is an array containing the data points for the corresponding
> key.


That describes the structure that Jeff's code builds...


> How must the code be modified to provide the given structure?

 ... so no modifications are needed.


----------------------------
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;

  # step 1 -- read the file into a hash of array-references:
  my (%data, @points);

  while (<DATA>) {
    my ($field, $val) = split;
    push @{ $data{$field} }, $val;
  }

  # step 2 -- convert hash of array-references
  # into array of array-references

  @points = (
    [ keys %data ],
    [ values %data ],
  );

print Dumper(\@points), "\n";

__DATA__
A1  0.1233
A1  1.234
A1  0.34
C3  1.4321
A5  1.24555
A5  23
A5  2
----------------------------

(annotated) output:

$VAR1 = [                          # @points
          [                        # $points[0]
            'A5',
            'C3',
            'A1'
          ],
          [                        # $points[1]
            [                      # $points[1][0]
              '1.24555',
              '23',
              '2'
            ],
            [                      # $points[1][1]
              '1.4321'
            ],
            [                      # $points[1][2]
              '0.1233',
              '1.234',
              '0.34'
            ]
          ]
        ];


> I don't want to loose
> the order of the keys (first column of INFO/@data2), which must be
> alphanumerically sorted.


There were 2 other followups that showed how to get it sorted,
did you see those?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 11 Dec 2002 02:25:29 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Comparison confusion
Message-Id: <at67mp$721@dispatch.concentric.net>


"Rob Richardson" <therobs@n2net.net> wrote in message
news:f79bc007.0212101651.294b7e32@posting.google.com...
>
> P.S.  Is there a list that is preferred to this one for asking newbie
> questions like these?

Yes.  There are a variety of mailing lists available at
http://learn.perl.org/ .  In addition, the Yahoo group perl-beginners is
also very helpful (http://groups.yahoo.com/group/perl-beginner/).




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

Date: Wed, 11 Dec 2002 02:48:15 GMT
From: "Eric Le Donné" <eric@spamnotcfm-consulting.com>
Subject: Re: Comparison confusion
Message-Id: <PHxJ9.312501$QZ.46032@sccrnsc02>



> if ((param('step')) eq "")
>
> A little test script I wrote contained the following line:
>
> if (param('selection') eq "")
>
> The first comparison works just fine.  The first time through the
> script, the comparison is true and the initial web page is displayed
> to the user.  The user makes a choice, the parameter named 'step' is
> set to "step2", and the comparison is false.  The second comparison
> did not work.  It is true whether or not 'selection' is set to
> anything.
>
This is peculiar.. If param('selection') does return a valid string, there
is no reason why the condition would evaluate to true...
So I must question whether param('selection') really returns something. If
it's undef (and it might well be), then your condition will evaluate to
true.

Eric




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

Date: Tue, 10 Dec 2002 20:45:41 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Comparison confusion
Message-Id: <slrnavd9ml.49c.tadmc@magna.augustmail.com>

Rob Richardson <therobs@n2net.net> wrote:

> P.S.  Is there a list that is preferred to this one for asking newbie
> questions like these?


   http://lists.perl.org/showlist.cgi?name=beginners

   http://lists.perl.org/showlist.cgi?name=beginners-cgi


Oops! I said I wouldn't do that anymore.

The scorefile will work properly after I start a new newsreader session.

Sorry again.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 11 Dec 2002 03:00:07 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Comparison confusion
Message-Id: <3DF6A92F.5080403@rochester.rr.com>

Rob Richardson wrote:

 ...

> The Perl script I am modifying contains the following line:
> 
> if ((param('step')) eq "")  
> 
> A little test script I wrote contained the following line:
> 
> if (param('selection') eq "")
> 
> The first comparison works just fine.  The first time through the
> script, the comparison is true and the initial web page is displayed
> to the user.  The user makes a choice, the parameter named 'step' is
> set to "step2", and the comparison is false.  The second comparison
> did not work.  It is true whether or not 'selection' is set to
> anything.
> 
> I'm pretty sure that I'm getting my contexts confused, but I don't
> know why.  Can anyone explain it?
 ... 
> Rob
 ...


Hmmmmm...I'm unable to duplicate your results.  The following 

program works as one would expect, for example:


use CGI qw(:standard);
print header,start_html('test'),
	h1('test'),start_form,
	'step:',textfield('step'),p,
	'selection:',textfield('selection'),p,
	'selection:',textfield('selection'),p,
	submit,end_form,hr;
if(param()){
	print "step=".param('step'),br,
	"selection=".param('selection'),br;
	if((param('step')) eq ""){print "step true",br;}
	if(param('selection') eq ""){print "selection true",br;}
}

What happens if you the above script verbatim?  If your problem 
persists, can you post more complete code (a short concise example 
anyone can copy/paste/run is highly desirable)?
-- 
Bob Walton



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

Date: Wed, 11 Dec 2002 02:58:35 GMT
From: Eric Osman <os7man@attbi.com>
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <3DF6AA51.6401A926@attbi.com>



Thanks for the EXCELLENT informative answer.

One of your points I have another question about.

> Indeed.  that's why it's good to get most of the details out of the
> way from a command shell (as you noted before) before moving to the
> actual server situation.


Certainly I agree with the above, but in my case
the input is fields on a form from a web page.

How the heck do you emulate such input in order to
test a perl file without the browser environment ?

Thanks.  /Eric


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

Date: Wed, 11 Dec 2002 03:09:58 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <a0yJ9.8631$BB.8059@nwrddc01.gnilink.net>

Eric Osman wrote:
>> Indeed.  that's why it's good to get most of the details out of the
>> way from a command shell (as you noted before) before moving to the
>> actual server situation.
> Certainly I agree with the above, but in my case
> the input is fields on a form from a web page.
>
> How the heck do you emulate such input in order to
> test a perl file without the browser environment ?

Well, you could use the methods which are provided by the CGI module and are
explained in it's documentation.

jue




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

Date: Wed, 11 Dec 2002 03:16:34 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <3DF6AD07.3010801@rochester.rr.com>

Eric Osman wrote:

> 
> Thanks for the EXCELLENT informative answer.
> 
> One of your points I have another question about.
> 
> 
>>Indeed.  that's why it's good to get most of the details out of the
>>way from a command shell (as you noted before) before moving to the
>>actual server situation.
>>
> 
> 
> Certainly I agree with the above, but in my case
> the input is fields on a form from a web page.
> 
> How the heck do you emulate such input in order to
> test a perl file without the browser environment ?
> 


Read the CGI module docs (perldoc CGI) (you ARE using the CGI module, 
right? -- if you aren't, you'll have to write your own debug code), in 
particular the section titled "debugging". There you will discover that 
you can invoke your script from the command line as:

     perl scriptname.pl keyword1=value1&keyword2=value2

etc and that CGI will detect this and treat it as GET-method input.  You 
will also discover how to test POST-method input, wherein a statement like:

    use CGI qw(:standard -debug);

in your script will cause the CGI module to accept keyword-value pairs 
from standard input when your program is invoked from the console.


> Thanks.  /Eric
> 


You're welcome.


-- 
Bob Walton



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

Date: Tue, 10 Dec 2002 22:31:59 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <slrnavdftv.4q1.tadmc@magna.augustmail.com>

Eric Osman <os7man@attbi.com> wrote:

>> Indeed.  that's why it's good to get most of the details out of the
>> way from a command shell (as you noted before) before moving to the
>> actual server situation.
> 
> 
> Certainly I agree with the above, but in my case
> the input is fields on a form from a web page.
> 
> How the heck do you emulate such input in order to
> test a perl file without the browser environment ?


(you meant without a *server* environment, as it is the web
 server that invokes the CGI program, not the browser.
)

A CGI program gets its input from an env var (GET) or from STDIN (POST).

Just arrange to have the properly encoded data put into one
of those appropriate places.

(it will be a lot easier if you are using CGI.pm, as it will do
 the arranging for you.
)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 11 Dec 2002 04:43:17 -0000
From: Garry Williams <garry@ifr.zvolve.net>
Subject: Re: HELP.... problem splitting fields
Message-Id: <slrnavdgj5.943.garry@zfw.zvolve.net>

On Tue, 10 Dec 2002 22:50:17 GMT, Jay Tilton <tiltonj@erols.com> wrote:
> ktyson9426@aol.com (KTyson9426) wrote:

[snip]

>: $phone = ~ s/^.{1,10}/^.{1,10},/;
           ^
           ^

> Where is $phone getting its value?  Is that thing you just assigned to $_
> in the previous step what you want in $phone?  Are you writing this
> program without warnings enabled?
> 
> The second half of the s/// operator is a string, not a regex.
> 
>     $phone = ~ s/^(.{1,10})/$1,/;
              ^
              ^
The space is not allowed!  You are asigning the complement of the
result of the substitution.  

-- 
Garry Williams


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

Date: Wed, 11 Dec 2002 03:11:06 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: HOW DO YOU CONSTRUCT A URL STRING FROM A POST METHOD IN A FORM
Message-Id: <e1yJ9.8642$BB.4444@nwrddc01.gnilink.net>

gnuist006 wrote:
> I do not know if this is the right group for my question sorry if I am
> wrong here.
>
> I have the following html page:

Good for you. So you have a question about HTML and CGI.
What is your Perl question?

jue




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

Date: 10 Dec 2002 18:20:17 -0800
From: gnuist006@hotmail.com (gnuist006)
Subject: How does HTML encodes GET and POST requests?
Message-Id: <b00bb831.0212101820.6c76d026@posting.google.com>

jstokes@crmnet.org (John Stokes) wrote in message news:<BA1A75F6.3D30%

> As you know, HTML encodes GET and POST requests using the format:
> "myurl.com?name1=value1&name2=value2&..."

My problem is:

Subject: How DO YOU CONSTRUCT A URL STRING FROM A POST METHOD IN A FORM ?
NNTP-Posting-Host: 209.179.39.190
Message-ID: <b00bb831.0212101742.369f0040@posting.google.com>

Hi,

I do not know if this is the right group for my question sorry if I am
wrong here.

I have the following html page:

<html><head></head>

<form method=post action=http://www.some_site.zzz/tt.t >
<input type="text" name="ID" value="5">
<INPUT type="submit" name="down_load" VALUE="button">
</form>

</body></html>

and when I click the button the site sends a file and a dialog box opens
with the filename in it asking your to save it.

I want to automate this. One method is to construct some url like this:

http://www.some_site.zzz/tt.t-ID=5&down_load=submit&method=post

I am not sure if this is correct approach. I know little about wget although
it comes with NTRK and I know little about perl. If a kind soul can give me
a very simple working solution in either wget, perl or both, it would be
very nice. I know C/C++ and can hack a little if you get me started.

Thanks for reading

-- 
gnuist


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

Date: 11 Dec 2002 04:23:38 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: How to do 32-bit calculations WITH overflow?
Message-Id: <1039580618.926702@elaine.furryape.com>

In article <at4ljr$6ir$1@phys-news1.kolumbus.fi>,
Mikko Noromaa <mikkon@excelsql.com> wrote:
>When I do %4294967296 with this result, I get 2266681512. This is not
>correct, I believe because of some lost precision in the floating-point
>representation. The correct result (with overflowing 32-bit integers) is
>2266681510.

use Math::BigInt;


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

Date: Wed, 11 Dec 2002 04:27:58 GMT
From: zathras <moo@cow.com>
Subject: incorporating off-site content
Message-Id: <lredvu446hf712gn1hsernms0a9kglo8vs@4ax.com>

What is the best method to incorporate off-site content into an
existing site?

I have setup some HTML pages in the following format: 

<table>
 ...
 ...content...
 ...
</table>

With the intention of some how referencing the above file from within
another sites structure. Something like

<other site's body>
<other site's table>
 ...
other site's content...
 ...
*content from my site (the table structure above)*
 ...
<other site's /table>
<other site's /html>

This is pretty simple to do with frames--just load the external
content in a separate frame. But how do you do this on a site without
frames?

The goal is not to have to send files back and forth via FTP--I would
like external sites to link directly to the file on my site. And also
to make it as simple and generic as possible so the same method can be
used on other sites. For the most part, I will have admin access to
these external sites, so I will be able to place perl scripts to
facilitate incorporating external content.

Any ideas? I vaguely remember reading about some perl functionality
that would allow code to reach out over the internet to a site and
pull down content and be able to manipulate it for use. Don't know if
it would apply here. But again, the less intrusive the method is for
the site that will be pulling content off mine, the better.

Thanks.


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

Date: Tue, 10 Dec 2002 22:48:03 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: incorporating off-site content
Message-Id: <slrnavdgs3.4sd.tadmc@magna.augustmail.com>

zathras <moo@cow.com> wrote:

> I vaguely remember reading 


Perhaps in the Perl FAQ?


> about some perl functionality
> that would allow code to reach out over the internet to a site and
> pull down content and be able to manipulate it for use. 


   How do I fetch an HTML file?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 11 Dec 2002 05:04:01 GMT
From: zathras <moo@cow.com>
Subject: Re: incorporating off-site content
Message-Id: <3ohdvu84na5h5s87pluc1feint5522hbtv@4ax.com>

On Tue, 10 Dec 2002 22:48:03 -0600, tadmc@augustmail.com (Tad
McClellan) wrote:

>zathras <moo@cow.com> wrote:
>
>> I vaguely remember reading 
>
>
>Perhaps in the Perl FAQ?
>
>
>> about some perl functionality
>> that would allow code to reach out over the internet to a site and
>> pull down content and be able to manipulate it for use. 
>
>
>   How do I fetch an HTML file?

sigh...


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

Date: Wed, 11 Dec 2002 02:11:48 GMT
From: "Eric Le Donné" <eric@spamnotcfm-consulting.com>
Subject: Re: Max fork'd proc limit...?
Message-Id: <E9xJ9.312149$QZ.46423@sccrnsc02>

hmmm.....

I confess that I am ignorant of Cygwin matters, yet I dare replyimg

errno 5 is indeed EIO, however fork() doesn't set errno to that value
(documented values are EAGAIN, if you ran out some system-imposed limit, and
ENOMEM, if you run out of swap). EIO is set when something completly
unhandled occurs

That said, each fork'ed child inherit from the parent's opened file
descriptors, so concievable that somewhere at the file system level
something didn't turn right.

Sorry I can't be any more helpful,

Eric

>
> Under Cygwin, at least, it showed exit code = 0, when I did "echo $?"
after
> the program ended... which is '$!' from?
>
> Anyway, when ALL I did was fork in my script, the exit code was 5.
> In Cygwin that's an IO Error.  Could be...?
>
> - Tim
>




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

Date: Tue, 10 Dec 2002 22:42:20 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Newbie question
Message-Id: <3DF6B41C.1070906@thecouch.homeip.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1



TBN wrote:
| I've got the following code that works fine...
|
| open (STUFF, $myFile) || open (STUFF, $defFile) || &notFound;
|
| The code works great, but I want to use the same variable for the file in
| both opens, so I tried something like:
|
| open (STUFF, $myFile) || $myFile="aDefaultFile.txt"; open (STUFF, $myFile)
| || &notFound;
|
| Which does not work.  I know there's an easy solution to this one
probably,
| but can't find an example for this.

Your example doesn't work because of precedence. Here's a clean
(untested) alternative:

for $myFile (qw(filename1 filename2)) {
	open (STUFF, $myFile) && last;
}
STUFF || &notFound;

Best of luck.


-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE99rQceS99pGMif6wRAkEcAJ9YVnQJo8gH0SqiSYIzVBSZ5yPbNgCgpE5E
zrGAFFpKNI+3y3bXSfQ7fxM=
=QOQv
-----END PGP SIGNATURE-----



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

Date: Wed, 11 Dec 2002 02:51:19 GMT
From: "Eric Le Donné" <eric@spamnotcfm-consulting.com>
Subject: Re: perl bad interpreter: No such file or directory
Message-Id: <HKxJ9.312525$QZ.46598@sccrnsc02>

 ... or #!/usr/bin/perl ain't a valid Perl interpreter...
since perl script.pl works, it's quite likely that it doesn't reside under
/usr/bin

What does "which perl" return ?
Eric

"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
news:Pine.LNX.4.40.0212110215100.507-100000@lxplus073.cern.ch...
> On Dec 10, Stas Neuberger inscribed on the eternal scroll:
>
> > i get this message on every perl script i'm trying to start. doesn't
> > matter via cgi or shell. the script runs normally if i add -w at the
> > end of #!/usr/bin/perl. also perl test.pl runs the file.
>
> This should be an FAQ.  I'm convinced you have a stray CR from e.g
> MS-Win-land at the end of that line in your unix file.
>
> > the files have normal unix LF.
>
> I have to express doubt about that.  Your description of symptoms
> is just too good a match.
>
>
>




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

Date: Wed, 11 Dec 2002 04:05:46 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: perl bad interpreter: No such file or directory
Message-Id: <1459168.3YJFZZYUe6@nyoga.dubu.de>

[posting order rebuilt]
Eric Le Donné wrote:
> "Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
> news:Pine.LNX.4.40.0212110215100.507-100000@lxplus073.cern.ch...
>> On Dec 10, Stas Neuberger inscribed on the eternal scroll:
>>
>> > i get this message on every perl script i'm trying to start.
>> > doesn't matter via cgi or shell. the script runs normally if i add
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> > -w at the end of #!/usr/bin/perl. also perl test.pl runs the file.
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> This should be an FAQ.  I'm convinced you have a stray CR from e.g
>> MS-Win-land at the end of that line in your unix file.
>>
>> > the files have normal unix LF.
>>
>> I have to express doubt about that.  Your description of symptoms
>> is just too good a match.
>
> ... or #!/usr/bin/perl ain't a valid Perl interpreter...
> since perl script.pl works, it's quite likely that it doesn't reside
> under /usr/bin

The line of the OP marked above renders this quite improbable.
OTOH, he also wrote that the line endings were okay...

Ciao,
        Harald
-- 
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge. 
                -- Peter J. Schoenster



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

Date: 10 Dec 2002 19:10:13 -0800
From: kalinabears@hdc.com.au (Sisyphus)
Subject: Re: porting a routine which uses uint32_t
Message-Id: <e615828f.0212101910.f222568@posting.google.com>

fishbowl@m0x0.conservatory.com () wrote in message news:<3df4bf79$1_3@corp.newsgroups.com>...

<snip>
 
> 
> I wonder if there is a straighforward way to take the Inline::C
> version and turn it directly into an XS lib; I imagine the runtime
> performance will be the same with an improved load time.
> 

Yes - you simply need to set the Inline C Config variable
'CLEAN_AFTER_BUILD' to zero.

    use Inline (C => Config =>
                CLEAN_AFTER_BUILD => 0,
                );

Then you can go into the build directory after Inline has built the
thing and grab the xs code, the makefile and Inline.h (if it exists).

This has worked fine for me, so long as the return and argument types
are 'int' or 'SV *'. I imagine that 'AV *' is also ok.
Don't know how Inline deals with 'void *' arguments - I've had no need
to find out. Assuming there are no problems with the 'void *'
argument, then that sample script should work fine with Inline - and
you should also be able to delve into the build directory and do the
stuff you suggested above.

<snip>

Cheers,
Rob


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

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


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