FW: Re: Urgent help in h2xs

2005-10-02 Thread sam joseph
I have installed activeperl version 5.8.7 for win32 applications on windows 
2000.


I am using MSVC for compiling the programs and after running h2xs.bat when i 
run the makefile.pl command it gives me the following error message :
Could not open 'lib/03_10_05.pm': No such file or directory at 
C:/Perl/lib/ExtUt

ils/MM_Unix.pm line 3079.

and the line 3079 of MM_Unix.pm  looks like this :

open(FH,$parsefile) or die "Could not open '$parsefile': $!";

Anyone knowing why such kind of an error message is coming ???




From: "sam joseph" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], beginners@perl.org, 
[EMAIL PROTECTED]

Subject: Re: Urgent help in h2xs
Date: Sun, 02 Oct 2005 20:28:07 +0530

Hi All

I appreciate your help

I have MSVC++ version 6.0

Can you be more precise in telling how to use VC++ for h2xs as i dont have 
much prior working experience in VC++ except for some basic C++ coding.


Are there any steps required for executing h2xs on MSVC++ editor.

I have made a default dll project which has a default exported method.
After compiling that project

what should be the next steps for interfacing the the exported function 
from the

project using perl h2xs.

Please be as clear as possible
so that i am able to execute the steps.

Its really urgent as i have already some precious time in searching
information in this area.

Thanks,
Sam.


I


From: Xiaofang Zhou <[EMAIL PROTECTED]>
To: sam joseph <[EMAIL PROTECTED]>, beginners@perl.org 


Subject: Re: Urgent help in h2xs
Date: Sun, 2 Oct 2005 11:58:20 +0800

Hi, Sam,

Check what version of VC u're running:
active perl 5.001-> vc++5.0
active perl 5.6->vc++6.0
active perl 5.8->vc.net?

Thanks,
Xiaofang.


ÔÚ 2005-10-01 18:22:00 ÄúдµÀ£º
>hi
>
>I am new to perl and have got a project of interfacing c/c++ code with 
perl

>and have downloaded active perl.
>
>But i am stuck at the very basic step of execution.
>
>To interface i have to perform foll step:
>
>run h2xs
>
>run perl makefile.pl
>
>nmake
>
>after this i get an error message saying
>types.h not present in sys folder and many other header files missing
>
>Can anyone tell me how can i fix this problem and get teh correct
>C:\Perl\lib\CORE\sys\
>which contains all the required header files.
>
>
>Any help will be appreciated.
>
>Thanks,
>Sam
>
>_
>Repay your personal loan on your own terms.
>http://www.hsbc.co.in/script/in/common/redirect.asp?redirectto=/in/personal/loans/perloan.htm
>With HSBC's MyTerms Credit
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
> 
>
>
>
>.

ÖÂ
Àñ£¡

Xiaofang Zhou
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




_
Amitabh fan? Here’s a chance to chat with the Big B himself. 
http://server1.msn.co.in/sp05/DJbk/index.asp Click here now!



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




_
Stand a chance to Win Half Kg Gold & Lots more! 
http://adfarm.mediaplex.com/ad/ck/4686-26272-10936-631?ck=GoldRush Shop on 
eBay Now!



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: BEGIN block question

2005-10-02 Thread Charles K. Clarkson
Peter Rabbitson  wrote:

: I have some trouble understanding why a BEGIN block behaves the
: way it does. Here are two files to demonstrate:
:
[snip code]
: What makes the difference?

'use' and 'BEGIN' blocks are compiled by Perl before our().
So your script is compiled by the Perl interpreter in this order.

: #!/usr/bin/perl
: use warnings;
: use strict;
: use test2 qw($var);
:
: BEGIN {
: print "I see $var but don't see $var2\n";
: }
:
: our $var2 = 'second';


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: BEGIN block question

2005-10-02 Thread John W. Krahn
Peter Rabbitson wrote:
> Just to sum it up, so I make sure I got what you are saying. From the 
> previous e-mail I understand that:

To sum what up?  What who is saying?  What previous e-mail?


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: BEGIN block question

2005-10-02 Thread Peter Rabbitson
Just to sum it up, so I make sure I got what you are saying. From the 
previous e-mail I understand that:

* Right after the use xxx statement is parsed the corresponding module 
which is 'use'd is fully parsed AND executed. This execution includes 
any top level code not enclosed in subroutines and all subroutines 
referenced by said code, just like if we were to do 'perl '

* Parsing of the original 'use'r code (even if there are BEGIN blocks 
defined firther in the 'use'r) continues only after the abovementioned 
parsing/execution is completed for the 'use'ed module and recursively 
any other modules it in turn might be 'use'ing.

Is this correct? :)

Thanks a lot
Peter 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use strict, aliases, local

2005-10-02 Thread Gerard Robin
On Sun, Oct 02, 2005 at 08:49:30AM -0400 Jeff 'japhy' Pinyan wrote:
...
> 
> If you REALLY want to use package variables instead of lexicals, then you 
> need to follow the instructions in the 'strict' documentation for 
> declaring your global variables:
> 
>   use strict;
>   our ($foo, @foo);
> 
>   $foo = ...;
>   @foo = ...;
> 
>   testsub(*foo);
> 
>   sub testsub {
> our ($x, @x);
> *x = $_[0];
> $x++;
> push @x, 100;
>   }
> 
> But this is really inadvisable.  What is your motivation to do this kind 
> of thing?

Many thanks it works fine now (with   "print "@x", "\n";" :-)) but local 
disappeared. 

I pick up this example in a tutorial (it is old but it exists and there are 
many examples
and most of them are understandable (imho)) because I searched some example of 
scripts
which used local. I encounter some problems to figure out local ;-) 
  
for example, in perldoc -q dynamic, I found this example: (I changed it a 
little...)

use warnings;
# use strict;

$var = 'global';

print " in visible ";
visible();  
dynamic();
lexical();  

sub visible {

  print "\$var has value $var\n ";
}

sub dynamic {
  local  $var = 'local';
  print "in dynamic ";
  visible();
}

sub lexical {
  my $var = 'private';

  print "in lexical via visible  ";
  visible();
  print "in lexicale \$var has value $var\n";

}

output:
 in visible $var has value global
 in dynamic $var has a value local
in dynamic via visible $var has value local
 in lexical via visible  $var has value global
 in lexicale $var has value private

if I want the result:
 in visible $var has value global
 in dynamic $var has a value local
in dynamic via visible $var has value local
 in lexical via visible  $var has value local
 in lexicale $var has value private

I think that I have two ways:

With local:
..
use strict;
use vars '$var';

local $var;
.

without local:
..
use strict;
our $var = global;
.

Is it correct what I said ? 

tia
-- 
Gérard 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




BEGIN block question

2005-10-02 Thread Peter Rabbitson
Hello list,
I have some trouble understanding why a BEGIN block behaves the way it 
does. Here are two files to demonstrate:

== test =
#!/usr/bin/perl
use warnings;
use strict;
use test2 qw($var);

our $var2 = 'second';

BEGIN {
print "I see $var but don't see $var2\n";
}


= test2.pm ===
package test2;

use warnings;
use strict;
use Exporter;
our @ISA = qw (Exporter);
our @EXPORT_OK = qw ($var);

our $var = 'first';

1;


What makes the difference?

Thanks
Peter


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: New Website for Perl Beginners: perlmeme.org

2005-10-02 Thread Gavin Henry
Randal L. Schwartz said the following on 02/10/05 13:17:
>>"Shlomi" == Shlomi Fish <[EMAIL PROTECTED]> writes:
> 
> 
> Shlomi> Hi good people,
> Shlomi> there's a new web-site for Perl beginners - perlmeme.org - 
> 
> Shlomi> http://perlmeme.org/
> 
> Unless it's hidden, I'm not finding any obvious link there to the
> defacto standard location for Perl beginners, .
> I think this represents broken integrity on your part, since you
> appear to be trying to replace learn.perl.org, not supplement it, so
> you're attempting to fracture the community, not enhance it.
> 
> If you add a prominent link to learn.perl.org, I will withdraw my
> complaint.


I agree with this, and mentioned my thoughts here:

http://perlmonks.org/?node_id=496511

Thanks,

Gavin.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: generating a wordlist from an array of arrays

2005-10-02 Thread Christer Ekholm
mark berger <[EMAIL PROTECTED]> writes:

> hey list. i stuck with gererating a wordlist from a changing
> multidimensional array. each entry in the array contains a list with the
> possible values.
>
> fe:
>
> @wordlayout = ((a, b),# possible values for 1st char
>(c),   # possible values for 2nd char
>(d, e, f));# possible values for 3rd char
>
> the following wordlist should be generated:
>
> acd
> ace
> acf
> bcd
> bce
> bcf
>
> the only thing i came up with so far, is to generate some for loops
> based on the array structure (how many chars, with how many posible
> values) on fly and pass this to eval. pretty ugly (at least the way i
> thought it out).

I gave that some thought. And I think it actually might be a good
solution. I wonder which method is more efficient, dynamic
code-generation or recursion?

Here is my try at it, does it look like yours?

@wordlayout = (['a', 'b'],
   ['c'],
   ['d','e','f'],
);

for my $idx ( 0 .. $#wordlayout ) {
# A loop for each level.
$code .= 'for my $char ( @{$wordlayout[' . $idx . ']} ) {'. "\n";
# concat chars
$code .= '$str .= $char;'."\n";
}
# At the innermost level, extract a word.
$code .= 'push @list,$str;';

for my $idx ( 0 .. $#wordlayout ) {
# Remove this levels char on our way out.
$code .= 'substr($str,-1,1,"");';
$code .= "}\n";
}

# Now do it.
eval $code;

# The result is in @list.
print join("\n",@list),"\n";



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Urgent help in h2xs

2005-10-02 Thread sam joseph

Hi All

I appreciate your help

I have MSVC++ version 6.0

Can you be more precise in telling how to use VC++ for h2xs as i dont have 
much prior working experience in VC++ except for some basic C++ coding.


Are there any steps required for executing h2xs on MSVC++ editor.

I have made a default dll project which has a default exported method.
After compiling that project

what should be the next steps for interfacing the the exported function from 
the

project using perl h2xs.

Please be as clear as possible
so that i am able to execute the steps.

Its really urgent as i have already some precious time in searching
information in this area.

Thanks,
Sam.


I


From: Xiaofang Zhou <[EMAIL PROTECTED]>
To: sam joseph <[EMAIL PROTECTED]>, beginners@perl.org 


Subject: Re: Urgent help in h2xs
Date: Sun, 2 Oct 2005 11:58:20 +0800

Hi, Sam,

Check what version of VC u're running:
active perl 5.001-> vc++5.0
active perl 5.6->vc++6.0
active perl 5.8->vc.net?

Thanks,
Xiaofang.


ÔÚ 2005-10-01 18:22:00 ÄúдµÀ£º
>hi
>
>I am new to perl and have got a project of interfacing c/c++ code with 
perl

>and have downloaded active perl.
>
>But i am stuck at the very basic step of execution.
>
>To interface i have to perform foll step:
>
>run h2xs
>
>run perl makefile.pl
>
>nmake
>
>after this i get an error message saying
>types.h not present in sys folder and many other header files missing
>
>Can anyone tell me how can i fix this problem and get teh correct
>C:\Perl\lib\CORE\sys\
>which contains all the required header files.
>
>
>Any help will be appreciated.
>
>Thanks,
>Sam
>
>_
>Repay your personal loan on your own terms.
>http://www.hsbc.co.in/script/in/common/redirect.asp?redirectto=/in/personal/loans/perloan.htm
>With HSBC's MyTerms Credit
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
> 
>
>
>
>.

ÖÂ
Àñ£¡

Xiaofang Zhou
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




_
Amitabh fan? Here’s a chance to chat with the Big B himself. 
http://server1.msn.co.in/sp05/DJbk/index.asp Click here now!



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use strict, aliases, local

2005-10-02 Thread Jeff 'japhy' Pinyan

On Oct 2, Gerard Robin said:


use warnings;
# use strict;

$foo = 26;
@foo = ("here's", "a", "list");

&testsub (*foo);
print ("The value of \$foo is now $foo\n");

sub testsub {
local  (*printarray) = @_;
foreach  $element ( @printarray) {
print ("$element\n");
}
$printarray = 61;
}

it gives the expected result.


Yes, but it's pretty esoteric code.  Why are you doing this?


I can't make this script work with "use strict", always perl complains ?


If you REALLY want to use package variables instead of lexicals, then you 
need to follow the instructions in the 'strict' documentation for 
declaring your global variables:


  use strict;
  our ($foo, @foo);

  $foo = ...;
  @foo = ...;

  testsub(*foo);

  sub testsub {
our ($x, @x);
*x = $_[0];
$x++;
push @x, 100;
  }

But this is really inadvisable.  What is your motivation to do this kind 
of thing?


--
Jeff "japhy" Pinyan%  How can we ever be the sold short or
RPI Acacia Brother #734%  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %-- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




use strict, aliases, local

2005-10-02 Thread Gerard Robin
Hello,
when I try this example for aliases:

use warnings;
# use strict;

$foo = 26;
@foo = ("here's", "a", "list");

&testsub (*foo);
print ("The value of \$foo is now $foo\n");

sub testsub {
local  (*printarray) = @_;
foreach  $element ( @printarray) {
print ("$element\n");
}
 $printarray = 61;
}

it gives the expected result.

But the perl's guru recommend to use, "use strict".

I can't make this script work with "use strict", always perl complains ?

Can someone explain to me why perl complains.

perldoc -f local -> perldoc perlsub

WARNING: In general, you should be using "my" instead of
   "local", because it's faster and safer.  
tia
-- 
Gérard 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: New Website for Perl Beginners: perlmeme.org

2005-10-02 Thread Randal L. Schwartz
> "Shlomi" == Shlomi Fish <[EMAIL PROTECTED]> writes:

Shlomi> Hi good people,
Shlomi> there's a new web-site for Perl beginners - perlmeme.org - 

Shlomi> http://perlmeme.org/

Unless it's hidden, I'm not finding any obvious link there to the
defacto standard location for Perl beginners, .
I think this represents broken integrity on your part, since you
appear to be trying to replace learn.perl.org, not supplement it, so
you're attempting to fracture the community, not enhance it.

If you add a prominent link to learn.perl.org, I will withdraw my
complaint.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Need help with XML traversing....

2005-10-02 Thread Chris Devers
On Sun, 2 Oct 2005, Anish Kumar K. wrote:

> Anyone could tell some site where I could get the script in JAVA 
> SCRIPT for traversing the XML with unlimited DEPTH(TREE). I do not 
> want to use the XML:: Modules available in PERL.

Then you're asking utterly the wrong list. 
 



-- 
Chris Devers

LÀ:ñH…ÇVø0[H
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


New Website for Perl Beginners: perlmeme.org

2005-10-02 Thread Shlomi Fish
Hi good people,

there's a new web-site for Perl beginners - perlmeme.org - 

http://perlmeme.org/

It has Howto's, Tutorials and FAQs for Perl beginners - freely available and 
freely usable. Its mission ( http://perlmeme.org/start_here/index.html ) is:


It's lots of ideas that together define why Perl is so different. 

It is the idea that there should be "more that one way to do it", the idea 
that a language should make easy jobs easy and hard jobs possible, the idea 
that laziness, patience and hubris are virtues (for a programer). 

 Perl itself is evolving at a rate unlike any other programming language. 
Those of us who use it for a living are excited by how powerful and 
expressive the language is and how close to the 'problem set' it is. With the 
development of Perl 6 well underway, the language is set to expand and take 
on even more functionality not found anywhere else. In our opinion, this 
makes it the language of choice for solving many of the software problems of 
the future.


I have already contributed some code, text and ideas to perlmeme.org, but we 
could always use more help. If you have a document to contribute (even if 
it's already written), can provide feedback on the site, or can help in any 
other way, feel free to visit our developers' web-site:

http://perlmeme-org.sourceforge.net/

Regards,

Shlomi Fish

-
Shlomi Fish  [EMAIL PROTECTED]
Homepage:http://www.shlomifish.org/

95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Need help with XML traversing....

2005-10-02 Thread Anish Kumar K.
Hi

Anyone could tell some site where I could get the script in JAVA SCRIPT for 
traversing the XML with unlimited DEPTH(TREE).
I do not want to use the XML:: Modules available in PERL.

Say I want to print the name of the tree. I did with Hard Coding. That is not I 
wantI tried in recursive. Failed.
This works fine with Module. I don't want Module.













   





OUTPUT
a
an
ani
anis
anish
anish 
anish k
anish ku
anish kum
anish kuma
anish kumar
SUCCESS


Thanks
Anish