Inline Example "Compile" time
use Inline C => ' int times2(int a) { return a * 2 } '; print ×2(8);
Runtime
sub make_multiplier { my($n) = @_; my $name = "times$n"; my $code =
" int ${name}(int a) { return a * $n; } "; Inline->bind(C => $code); }
&make_multiplier(42); print ×42(8);
----
[EMAIL PROTECTED] wrote: Send Perl-Win32-Users mailing list submissions to
perl-win32-users@listserv.ActiveState.com
To subscribe or unsubscribe via the World Wide Web, visit
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Perl-Win32-Users digest..."
Today's Topics:
1. hash table question (Mark Funk)
2. RE: hash table question
(Wagner, David --- Senior Programmer Analyst --- WGO)
3. RE: hash table question (Suresh Govindachar`)
4. Compilation of Inline::Ruby on win32 (Ed S. Peschko)
5. [SPAM?] Compilation of Inline::Ruby on win32 (Ed S. Peschko)
6. RE: a simple program (Steve Howard (PFE))
----------------------------------------------------------------------
Message: 1
Date: Wed, 8 Aug 2007 17:58:57 -0400
From: "Mark Funk"
Subject: hash table question
To:
Message-ID:
Content-Type: text/plain; charset="us-ascii"
What exactly does the following Perl code do?
%hash=();
open(PREVFILE, $prevfile) or die("Unable to open previous file");
while(
) {
chomp;
last if /BREAK/;
$seen{$_}++;
}
close(PREVFILE);
TIA,
David M. Funk
President/CEO
Tivoli Certified Enterprise Consultant
Specializing in Network and Systems Management Solutions
Trinity Solutions
604 Cassandra Dr.
Suite 204
Cranberry Twp., PA 16066
Phone: 724-316-0721
Fax: 724-772-7889
email: [EMAIL PROTECTED]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3902 bytes
Desc: not available
Url :
http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/perl-win32-users/attachments/20070808/b00c106f/attachment.bin
------------------------------
Message: 2
Date: Wed, 8 Aug 2007 15:10:01 -0700
From: "Wagner, David --- Senior Programmer Analyst --- WGO"
Subject: RE: hash table question
To: "Mark Funk" ,
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mark Funk
Sent: Wednesday, August 08, 2007 14:59
To: perl-win32-users@listserv.ActiveState.com
Subject: hash table question
What exactly does the following Perl code do?
%hash=();
This should be my %seen = ();
open(PREVFILE, $prevfile) or die("Unable to open previous
file");
while(
) {
chomp;
last if /BREAK/;
$seen{$_}++;
}
close(PREVFILE);
TIA,
removing the carriage return info as defined on your system
and counting all occurances of whatever it finds on the lines it reads.
If it finds the characters BREAK ( since it is done this way, it could
be anywhere on the line, BREAKDOWN or xxBREAK or BREAKnnn ), but will
not exist the processing if it sees break ( Must be capitalized to get
out early ).
If this is all then you are not seeing the actual totals, but is
just placing in the hash keyed by whatever you are reading in.
Wags ;)
David M. Funk
President/CEO
Tivoli Certified Enterprise Consultant
Specializing in Network and Systems Management Solutions
Trinity Solutions
604 Cassandra Dr.
Suite 204
Cranberry Twp., PA 16066
Phone: 724-316-0721
Fax: 724-772-7889
email: [EMAIL PROTECTED]
**********************************************************************
This message contains information that is confidential and proprietary to FedEx
Freight or its affiliates. It is intended only for the recipient named and for
the express purpose(s) described therein. Any other use is prohibited.
**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/perl-win32-users/attachments/20070808/9d5b4bae/attachment.html
------------------------------
Message: 3
Date: Wed, 8 Aug 2007 15:25:13 -0700
From: "Suresh Govindachar`"
Subject: RE: hash table question
To: "'Mark Funk'" ,
Message-ID:
Content-Type: text/plain; charset="us-ascii"
Mark Funk asked:
> What exactly does the following Perl code do?
>
> %hash=();
>
> open(PREVFILE, $prevfile) or die("Unable to open previous file");
>
> while(
) {
> chomp;
> last if /BREAK/;
> $seen{$_}++;
> }
> close(PREVFILE);
Exactly, the code does nothing (since there is no output). I
suspect the intent is to count the number of times each line of
the file $prevfile occurs; but if $prevfile has a line which is
just "BREAK" then only lines above that line are considered
(otherwise all lines are considered).
--Suresh
------------------------------
Message: 4
Date: Wed, 8 Aug 2007 22:57:51 -0700
From: "Ed S. Peschko"
Subject: Compilation of Inline::Ruby on win32
To: "'Active State Perl'"
Cc: Eric Promislow , Gisle Aas
, Todd Whiteman ,
perl-win32-users@listserv.activestate.com, Jan Dubois
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
All,
I'm trying to compile Inline::Ruby on win32, using visualc++ v6 and
activestate perl, without too much luck, in trying to get HttpWatch
to work with perl.
In particular, I'm having difficulty with the headers. When you try to
compile it, the lines in malloc.h and signal.h (win32 headers) turn
from:
_CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int);
into
__declspec(dllimport) void (__cdecl * __cdecl
(*(*Perl_IProc_ptr(((PerlInterpreter *)Perl_get_context())))->pSignal)
((*Perl_IProc_ptr(((PerlInterpreter *)Perl_get_context()))), (int),
(void (__cdecl *)(int)))
)
(int);
This also happens with malloc, etc in the files:
\visualc\VC98\Include\SIGNAL.H
and
\visual\VC98\Include\MALLOC.H
with the errors:
C:\visualc\VC98\INCLUDE\signal.h(102) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(106) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(107) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(108) : error C2059: syntax error : '('
Same thing happens with ruby (the win32.h headers)
I am using
http://rubyforge.org/frs/?group_id=167
as a ruby executable (native win32) and
http://rubyforge.org/frs/?group_id=104
As I said, the ultimate goal is to be able to use HttpWatch
(http://www.httpwatch.com) with perl - it pisses me off, it has a
ruby API but no perl API.
Given that this is the best tool I've ever used for sniffing http traffic
(even does https unencryption transparently) and that it would allow perl
to very finely control IE (and ultimately firefox) using OLE, I'd love
to get this to work natively (rather than try to loop it in through
a separate, ruby script). And not having the time to write a native perl
API for the program myself, I thought I'd borrow ruby's.
. Any ideas on helping compile this would be very helpful.. Also, any
line on a HttpWatch API for perl would be very welcome.
Ed
------------------------------
Message: 5
Date: Thu, 9 Aug 2007 02:15:48 -0400
From: "Ed S. Peschko"
Subject: [SPAM?] Compilation of Inline::Ruby on win32
To:
Cc: Jan Dubois , Eric Promislow
, Gisle Aas ,
perl-win32-users@listserv.ActiveState.com, Todd Whiteman
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
All,
I'm trying to compile Inline::Ruby on win32, using visualc++ v6 and
activestate perl, without too much luck, in trying to get HttpWatch
to work with perl.
In particular, I'm having difficulty with the headers. When you try to
compile it, the lines in malloc.h and signal.h (win32 headers) turn
from:
_CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int);
into
__declspec(dllimport) void (__cdecl * __cdecl
(*(*Perl_IProc_ptr(((PerlInterpreter *)Perl_get_context())))->pSignal)
((*Perl_IProc_ptr(((PerlInterpreter *)Perl_get_context()))), (int),
(void (__cdecl *)(int)))
)
(int);
This also happens with malloc, etc in the files:
\visualc\VC98\Include\SIGNAL.H
and
\visual\VC98\Include\MALLOC.H
with the errors:
C:\visualc\VC98\INCLUDE\signal.h(102) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(106) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(107) : error C2059: syntax error : '('
C:\visualc\VC98\INCLUDE\malloc.h(108) : error C2059: syntax error : '('
Same thing happens with ruby (the win32.h headers)
I am using
http://rubyforge.org/frs/?group_id=167
as a ruby executable (native win32) and
http://rubyforge.org/frs/?group_id=104
As I said, the ultimate goal is to be able to use HttpWatch
(http://www.httpwatch.com) with perl - it pisses me off, it has a
ruby API but no perl API.
Given that this is the best tool I've ever used for sniffing http traffic
(even does https unencryption transparently) and that it would allow perl
to very finely control IE (and ultimately firefox) using OLE, I'd love
to get this to work natively (rather than try to loop it in through
a separate, ruby script). And not having the time to write a native perl
API for the program myself, I thought I'd borrow ruby's.
. Any ideas on helping compile this would be very helpful.. Also, any
line on a HttpWatch API for perl would be very welcome.
Ed
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
------------------------------
Message: 6
Date: Wed, 8 Aug 2007 23:15:08 -0700
From: "Steve Howard (PFE)"
Subject: RE: a simple program
To: prapulla rani
,
"perl-win32-users@listserv.ActiveState.com"
Message-ID:
Content-Type: text/plain; charset="us-ascii"
I'm having a little trouble understanding the question. Are you expecting Perl
to compile into an executable program like C would do? If so, Perl doesn't do
that. Perl is an interpreted language, and compiles when called, then executes.
The script is loaded by the interpreter, and must have the interpreter to run.
It also sounds like you are looking for a Perl debugger. There are many
available, but what is available changes regularly. Komodo is an IDE and works
well from what I understand (but it has been a long time since I have used it).
If you're looking for a freeware IDE with a debugger, you might try searching
using your favorite search engine, or maybe someone has a suggestion on what is
currently available in the freeware world.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of prapulla rani
Sent: Wednesday, August 08, 2007 1:21 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: a simple program
hi
am learning c language .
in the same time i am learning perl lanuage so i want one
perl program to compile with debugging in cygwin . including each
step is running debugging commands also i want.
please send me reply as early as possible
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/perl-win32-users/attachments/20070808/27b3888c/attachment.html
------------------------------
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
End of Perl-Win32-Users Digest, Vol 13, Issue 5
***********************************************
www.g-billboards.com
---------------------------------
Download prohibited? No problem. CHAT from any browser, without download.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs