RE: PAR - WIN32 Client/Server application using fork.

2004-03-26 Thread Burak Gürsoy
PAR has it's own discussion list:

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

you may get a better answer from there...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Rush,
Thomas
Sent: Friday, March 26, 2004 7:54 PM
To: [EMAIL PROTECTED]
Subject: PAR - WIN32 Client/Server application using fork.


Hi,

I have used PAR (written by Autrijus Tang) to 'compile' a server module
which uses socket and fork()s a 'process' to handle the clients as they
connect into the server.

This all works well when I'm just using standard Perl however if I use PAR
and compile the code it still waits for connections but doesn't seem able to
pass information back and forward between the client/server pipe.
Any ideas.

Oh and PAR seem to work fine on other standard Perl scripts I've used. But
must admit I've not tried compiling a script with fork() on a WIN32 system
before.

Currently using:
   perl, v5.8.0 built for MSWin32-x86-multi-thread
   (with 1 registered patch, see perl -V for more detail)
   Binary build 806

Thanks in advance for any help,

Tom


{Extract server}--
#!/usr/bin/perl
# Server.pl

use Socket;
$port = 2345;
($name, $aliases, $protocol) = getprotobyname('tcp');
if ($port !~ /^\d+$/) {
 ($name, $aliases, $port) = getservbyport($port, 'tcp');
}
print Listening on port $port...\n;
socket(S,AF_INET,SOCK_STREAM,$protocol) || die socket : $!;
$sockaddr = 'S n a4 x8';
$this = pack($sockaddr, AF_INET, $port, \0\0\0\0);
bind(S, $this) || die bind : $!;
listen(S,10) || die listen: $!;
select(S);
$| = 1;
select(STDOUT);
for ($con = 1; ; $con++) {

 # Let the user know we're waiting for a connection...

 printf(Waiting for connection %d\n, $con);

 ($addr = accept(NS,S)) || die $!;

 # Temporarily set default output to the handle NS so...

 select(NS);

 # flushed.
 $| = 1;

 # Set default output back to the standard output channel

 select(STDOUT);

 if (($child = fork()) == 0) {

   ($af,$port, $inetaddr) = unpack($sockaddr, $addr);
   @inetaddr = unpack('C4', $inetaddr);

   print Serving connection $con @ Internet address @inetaddr\n;

   while (NS) {
  # output stuff from client here and...
  $response = NS;
  print Received from client $con: $_;
  # ...and echo it back to the client, too.
  print NS Server $con: $_;

   }

   # Close the socket connection when the client goes away

   close(NS);

   # The forked server dies here
   print Client went away.  Forked server $con exiting...\n;
   exit;
 }
 close(NS);
}

[Extract client]--
#!/usr/bin/perl -w
# client.reporter.pl

use strict;
use warnings;
use Socket;
use DBD::ODBC;
use IO::Socket;

my $host = 'netman';
my $port = 2345;
my $response = '';

my $socket = new IO::Socket::INET(
   PeerAddr = $host,
   PeerPort = $port,
   Proto = tcp,
   Type = SOCK_STREAM)
   or die (%CLIENT-F-NOSERVER, cannot connect to server on $host:$port
: [EMAIL PROTECTED]);

local $| = 1;

print ($socket Hello\n);

$response = $socket;
print $response\n;

my $input = STDIN;
chomp ($input);

while ($response) {
print ($socket $input\n);
$response = $socket;
print (loop: $response);

$input = STDIN;
chomp ($input);
}

print (\ndone\n);

close ($socket) or die ( cannot close socket: $!);

#



The information contained in or attached to this email is
intended only for the use of the individual or entity to
which it is addressed. If you are not the intended
recipient, or a person responsible for delivering it to the
intended recipient, you are not authorised to and must not
disclose, copy, distribute, or retain this message or any
part of it. It may contain information which is confidential
and/or covered by legal professional or other privilege (or
other rules or laws with similar effect in jurisdictions
outside England and Wales).
The views expressed in this email are not necessarily the
views of Centrica plc, and the company, its directors,
officers or employees make no representation or accept any
liability for its accuracy or completeness unless expressly
stated to the contrary.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


idiots out of office (RE: Out of Office AutoReply: PAR - WIN32 Client/Server application us ing fork.)

2004-03-26 Thread Burak Gürsoy
I get 6 of this out of ... crap and one idiot returned me as rejected.

ok... moderator of this list or anyone from ActiveState, why don't you do
anything about that SPAM and SPAMMERS?

probably I get another 7 spam after sending this one and I think that I'll
unsubsribe from all activestate lists...

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Struggling with my first XML::Parser project

2003-11-09 Thread Burak Gürsoy
try XML::Simple = http://search.cpan.org/~grantm/XML-Simple/


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Gary
Nielson
Sent: Sunday, November 09, 2003 9:35 PM
To: [EMAIL PROTECTED]
Subject: Struggling with my first XML::Parser project


I have partially written a program to parse National Weather Service alerts.
But I am struggling to figure out how to parse the file so that if there an
urgent alert, say, for a specific geocode or area, I can grab the headline
and description for that geocode.

I am working off the examples in the XML::Parser perldoc but don't
understand how startElement, endElement and characterData work together. Let
me show you my code and an example from the file I am trying to parse. I
have included a note in the code where I am getting stuck. I am looking for
advice and explanations.

Code:

use strict;
use XML::Parser;
use diagnostics;
use vars qw(@array $data $xmlfile $count $tag $element $infile);

my $xmlfile = us.xml;
die Cannot find file \$xmlfile\
   unless -f $xmlfile;

$count = 0;
$tag = ;
$element = ;

# retrieve complete file and fix errors in the file
open (IN, $xmlfile) || die(Error Reading File: $xmlfile $!);
{
undef $/;
$infile = IN;
}
close (IN) || die(Error Closing File: $xmlfile $!);

$infile =~ s//amp;/gm;

# write complete file
open (PROD, $xmlfile) || die(Error Writing to File: $xmlfile $!);
print PROD $infile;
close (PROD) || die(Error Closing File: $xmlfile $!);

my $parser = new XML::Parser;

$parser-setHandlers( Start = \startElement,
   End = \endElement,
   Char = \characterData,
   Default = \default);

$parser-parsefile($xmlfile);

sub startElement {
   my( $parseinst, $element, %attrs ) = @_;
 #print start element: $element\n;
}

sub endElement {
   my( $parseinst, $element ) = @_;
# i am doing nothing with this
  }

sub characterData {
  my( $parseinst, $data ) = @_;
print element: $element\n;
print data: $data\n;
push @array, $data;

}

NOTE: I can print the data and put it in an array, but it's useless because
each line of the array is  just the data for that element. I don't know how
to get all of the data for each element under cap:info onto one line (ie.
data for category|event|urgency|severity... etc.( so I can split it and pull
out
what I want. I don't even know if this is the best approach because it seems
I could do a parser myself without using XML::Parser; it doesn't seem to be
an easier this way.

Also I see that cap:area includes its own level in the hierarchy, areaDesc
and geocode, and don't know how that works, though when I print $data I get
that information.


sub default {
   my( $parseinst, $data ) = @_;
}

Example from file at http://www.nws.noaa.gov/alerts/us.cap.

- cap:info
  cap:categoryMet/cap:category
  cap:eventNON PRECIPITATION STATEMENT/cap:event
  cap:urgencyUnknown/cap:urgency
  cap:severityUnknown/cap:severity
  cap:certaintyUnknown/cap:certainty
  cap:effective2003-11-09T09:21:00/cap:effective
  cap:expires2003-11-09T21:00:00/cap:expires
  cap:headlineNON PRECIPITATION STATEMENT/cap:headline
  cap:descriptionURGENT - WEATHER MESSAGE NATIONAL WEATHER SERVICE
MORRISTOWN TN 400 AM EST SUN NOV 9 2003 ...FIRST HARD FREEZE OF THE FALL
SEASON POSSIBLE ACROSS NORTHEAST TENNESSEE...NORTHERN PLATEAU...AND PARTS OF
THE SMOKY MOUNTAINS SUNDAY NIGHT... .A RIDGE OF HIGH PRESSURE WILL CONTINUE
TO BUILD INTO THE SOUTHERN APPALACHIANS TODAY ALLOWING WINDS TO BECOME LIGHT
LATER TONIGHT. TEMPERATURES WILL BE ABLE TO DROP INTO THE UPPER 20S TO LOWER
30S BY DAYBREAK MONDAY ACROSS MUCH OF NORTHEAST TENNESSEE...SOUTHWEST
VIRGINIA AND NORTHERN SECTIONS OF THE CUMBERLAND PLATEAU AS WELL AS THE
SMOKY MOUNTAINS. STAY TUNED TO NOAA WEATHER RADIO AND OTHER LOCAL MEDIA FOR
FURTHER DETAILS OR UPDATES. TNZ012017-035-041-042-044-046-072-074-092100-
BLOUNT SMOKY MTN-CAMPBELL-CLAIBORNE-COCKE SMOKY MTN-HANCOCK-HAWKINS-
MORGAN-NORTHWEST CARTER-NORTHWEST GREENE-SCOTT TN-SEVIER SMOKY MTN-
SULLIVAN-WASHINGTON TN- INCLUDING THE CITIES
OF...BRISTOL...COSBY...ELIZABETHTON...
GATLINBURG...GREENEVILLE...JACKSBORO...JOHNSON CITY...ONEIDA...
ROGERSVILLE...SNEEDVILLE...TAZEWELL...TOWNSEND...WARTBURG 400 AM EST SUN NOV
9 2003 ...FREEZE WATCH IS IN EFFECT FOR TONIGHT... LIGHT WINDS AND ONLY
PARTLY CLOUDY SKIES WILL ALLOW TEMPERATURES TO DROP INTO THE UPPER 20S TO
LOWER 30S BY DAYBREAK MONDAY. TEMPERATURES MAY DROP AT OR BELOW FREEZING FOR
1 TO 3 HOURS TONIGHT. ANY OUTSIDE PLANTS SUSCEPTIBLE TO FREEZE DAMAGE SHOULD
BE BROUGHT INDOORS OR COVERED WITH MULCH OR PLASTIC. $$/cap:description


RE: perlis is *very* slow

2003-11-03 Thread Burak Gürsoy
Thank you for the reply Jan :)

-Original Message-
From: Jan Dubois [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 6:02 AM
To: Burak Gürsoy
Cc: Perl-Win32-Users
Subject: Re: perlis is *very* slow


On Mon, 3 Nov 2003 05:17:21 +0200, Burak Gürsoy [EMAIL PROTECTED]
wrote:

On our new host (Windows Server 2003 - IIS6) we are using Activeperl 5.8.0
and there is a problem with perlis.dll -- or the server (IIS)? (mapped to
.plx extension.)

Yes, I know why this happens and have already fixed it for ActivePerl 807
(not yet released).

Perl 5.8 uses the new IO layer abstraction, and we forgot to disable line
buffering for STDOUT when running inside PerlIS.  Therefore Perl 5.8 will
tell IIS after each newline to send all accumulated data.  Even if there
are no newlines, Perl would chunk data up into 4KB blocks here, but that
is probably not relevant except for extremely large pages.

The line buffering has a smaller effect on IIS5, which uses winsock to
transmit the data.  winsock implements TCP/IP nagling, which will bundle
small packets together dynamically.  IIS6 talks via http.sys and will
transmit each block as soon as possible and not use nagling.  Therefore
you see a much larger delay on IIS6.

With ActivePerl 807 the line buffering and block buffering will be
disabled.  But each print statement will still generate a separate data
transmission.  Even multiple values separated by commas:

  print $a, $b, \n;

will send multiple packets (3 in the example above).  So it will always be
a good idea to assemble the whole page in a string and send it with a
single print command (unless you page takes very long to load and you want
to send some early feedback early on).

Note that sending a single string will not help you with current
ActivePerl as PerlIS will still split it up at each newline boundary.  I
guess if you are desperate you could just turn all newlines into spaces,
as long as you are not sending binary content like images.

Cheers,
-Jan

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: OOP and variables!

2003-10-31 Thread Burak Gürsoy
it is always true because you set it to a value before you call it (as I see
in your first post)

try this code to see it:

-
use mypackage;
my $Obj = mypackage-new;

# not defined
print defined $Obj-phone ? defined\n : not defined\n;

# now we define it.
$Obj-phone(some value);

print defined $Obj-phone ? defined\n : not defined\n;

# now undef it

$Obj-phone(undef);

print defined $Obj-phone ? defined\n : not defined\n;
-

the output is like this in my system:

not defined
defined
not defined


and for the second one (the one that is always false). you are testing the
valus of an unknown scalar. say, if you $Obj-phone returns blah, you are
testing defined on $blah, which you didnt create...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, October 31, 2003 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: AW: OOP and variables!


My question was somehow different : how can I use my object in a expression
?
e.g.
if ( defined ($Obj-phone()) ){
#do something
}
This is always true!
I tried
if ( defined ${($Obj-phone()}) ){
# do smthg
}
and this is always false.

Thanks,
Nicu
-Ursprüngliche Nachricht-
Von: Burak Gürsoy [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 31. Oktober 2003 15:30
An: [EMAIL PROTECTED]
Betreff: RE: OOP and variables!


because you are trying to call a subroutine inside a string... there is a
trick to do this, but I find it unnecessary. you can use printf()
printf new Obj-Phone is %s ,$Obj-phone;
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Friday, October 31, 2003 4:18 PM
To: [EMAIL PROTECTED]
Subject: OOP and variables!




Hello all ,
   I need to keep an array of lists and I tried to do this in OOP style
meanyng that I am keeping now an array of  my objects.
Here is how my package looks like:
package mypackage;
use strict;
##
# constructor
##
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self-{PHONE}  = undef ;
bless($self,$class);
return $self;
}
sub phone {
my $self = shift;
if ( @_ ) {$self-{PHONE} = shift;}
return $self-{PHONE};
}
1;
I have more things like PHONE , this is just a snipset.
Now in my application I am doing
use mypackage;
my $Obj = new mypackage ;
sub Test {
$Obj-phone(hsagdhasg);
print new Obj-Phone is $Obj-phone() ;
}
For the last statement I get printed something like
'mypackage=HASH(0x2347e10)-phone()' and I cannot use this for example in a
join statement unless I get another variable
and do $x=$Obj-phone() ;
I do not want to use this second variable. Any ideea of how to do this and
maybe some short explanation why so ?
Thanks,
Nicu
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: REWRITE RE: Error trapping

2003-07-18 Thread Burak Gürsoy
well... it must catch it. BEGIN blocks happen at the compile time and at the
beginning...

for example, I can catch this compile time error:

#!/usr/bin/perl -w
use strict;
BEGIN {
   $| = 1;
   $SIG{__DIE__} = sub

   my $msg = shift;
   print ERROR: $msg;
   exit;
   };
}

use dbdbdb;

but if I add the signal code outside BEGIN, I can not catch it...

if you didnt properly defined EventLogger() sub, that can be the problem...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Farrington, Ryan
Sent: Friday, July 18, 2003 5:26 PM
To: [EMAIL PROTECTED]
Subject: RE: REWRITE RE: Error trapping


Grrr still didn't catch the error

-Original Message-
From: Burak Gürsoy [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 1:06 PM
To: [EMAIL PROTECTED]
Subject: RE: REWRITE RE: Error trapping


ok, try this one:
#!/usr/bin/perl -w
use strict;
BEGIN

   $| = 1;
   $SIG{__DIE__} = sub
my $msg = shift;
EventLogger(PERL Service, error, 666, $msg\n\n);
exit;
   };
}
# add your code here...


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Farrington, Ryan
Sent: Thursday, July 17, 2003 4:18 PM
To: '[EMAIL PROTECTED]'
Subject: REWRITE RE: Error trapping


Ok so now here is the stumper for me... I used
[code]
Local $SIG{__DIE__} = sub
my $msg = shift;
EventLogger(PERL Service, error, 666, $msg\n\n);
exit;
};
[/code]
And it died again today but no event written =( if it dies in a module will
this catch it?


 -Original Message-
From: Burak Gursoy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 1:52 PM
To: [EMAIL PROTECTED]
Subject: RE: Error trapping


it is $SIG{__DIE__} actually...
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Carl
Jolley
Sent: Tuesday, July 15, 2003 7:39 PM
To: FARRINGTON, RYAN
Cc: [EMAIL PROTECTED]
Subject: Re: Error trapping


On Mon, 14 Jul 2003, FARRINGTON, RYAN wrote:
 Ok I have a perl script that has been compiled as an executable and is
 running on a 2K server as a service. Now the problem is that it is
 die'ing without generating an error. Is there anyway to trap the die
 and then have it output it to a function before actually die'ing?

Have you tried to define a $SIG{DIE} subroutine?
 [EMAIL PROTECTED] Carl Jolley
 All opinions are my own and not necessarily those of my employer 


___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32 Icon (resource) extraction from exe/dll

2003-03-14 Thread Burak Gürsoy
I dont want to compile anything... If I want to, PAR is a good choice I
think...

Read the subject please...


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf
 Of Gregory, Carlton
 Sent: Friday, March 14, 2003 10:49 PM
 To: 'Burak Gürsoy'; [EMAIL PROTECTED]
 Subject: RE: Win32 Icon (resource) extraction from exe/dll


 I think there is a utility/module called perlcc which is not commercial.
 Should find it on search.cpan.org. I have gotten comments that
 perlcc is not
 worth the trouble but I have not tried it personally. I just download free
 utilities like perl2exe or PerlApp which is in the PDK.
 -Original Message-
 From: Burak Gürsoy [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 14, 2003 3:40 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Win32 Icon (resource) extraction from exe/dll


 If there is a perl way to extract icons and such things from a file, I'd
 also like to know it...

 Not any commercial progs please...

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of
  Gregory, Carlton
  Sent: Friday, March 14, 2003 4:37 PM
  To: [EMAIL PROTECTED]
  Subject: RE: Win32 Icon (resource) extraction from exe/dll
 
 
  In the Perl Development Kit from ActiveState there is a utility named
  PerlApp that allows you to bind files with perl scripts and
  create an .exe.
 
  you call a subroutine PerlApp::extract_bound_file(filename)
 and the file
  is extracted to a temporary directory on the filesystem. The file
  is deleted
  when the .exe is closed.
 
  -Original Message-
  From: D Smith [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 14, 2003 9:14 AM
  To: [EMAIL PROTECTED]
  Subject: Win32 Icon (resource) extraction from exe/dll
 
 
  Does anyone know of a script/module that will extract
  resources (esp. icons) from Win32 executable-format
  files?
 
  Or can anyone recommend a reference to these
  executable file formats with respect to resources?
 
  Thanks!
  D. Smith
 
  __
  Do you Yahoo!?
  Yahoo! Web Hosting - establish your business online
  http://webhosting.yahoo.com
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perldoc in Windows produces odd output

2003-02-24 Thread Burak Gürsoy
well... it looks like the only solution is to install the new perldoc:

http://search.cpan.org/author/SBURKE/Pod-Perldoc/

It solved my problem.

this was also discussed in pod-people

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] Behalf 
 Of Franz, Roger
 Sent: Monday, February 24, 2003 9:46 PM
 To: [EMAIL PROTECTED]
 Subject: Perldoc in Windows produces odd output
 
 
 When I run perldoc in windows ME, the output is offset; it's as if the
 program is not sending linefeeds/carriage returns in the proper 
 places. I've
 seen this reported here before:
 
   http://aspn.activestate.com/ASPN/Mail/Message/1510037
 
 and
 
   http://aspn.activestate.com/ASPN/Mail/Message/1509556
 
 and I'm wondering if there has been a fix or workaround for this?
 
 My Linux box is not always accessible (the problem is not present there,
 Perl 5.6.1 on Debian Linux), so I need to be able to use perldoc 
 on my WinME
 machine also.
 
 Version information:
 
 Perl v5.8.0 built for MSWin32-x86-multi-thread
 
 Build 805
 
 Does anyone know of a fix for this?
 
 Thanks!
 
 Roger
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl OOP

2003-01-25 Thread Burak Gürsoy
how about using a parameter with a constructor?

my $obj = Your::Class-new({param1 = $va1,DEBUG = 1});

...

sub new {
   my $class = shift;
   my $options = shift;
...
   if ($options-{DEBUG}) {
  # enable some debugging options or set $Your::Class::DEBUG var to 1
   }
...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Neil
Sent: Saturday, January 25, 2003 6:04 AM
To: [EMAIL PROTECTED]
Subject: Perl OOP


Hi,

I have put together a couple of modules and I  am _getting_ comfortable with
Perl OOP. However, something today has put me a bit sideways.

I will show code snippets to begin with and if its not clear - I'll post the
actual code.

I have one OO package that creates 'debug' object, that can log debug info,
provide trace info etc. and it has worked well in _scripts_. It is called
CreateYourWeb::Debug

I decided today to use it to help debug a new package - an OO 'messenger -
that I am working on. It is called CreateYourWeb::Messenger and basically an
OO wrapper around Mail::Sendmail - but now I can $obj-send_pager() or
$obj-send_mail(), which seems more intuitive when sending error messages of
different priorities for system admins attention. The package works well for
sending OO email but today I thought ... hmm ... I wonder if I can
create a modue level debug object for debugging the module.

So ... the debug object must be global - to the module ... so I dropped it
into the encapsuled data area ... like the code below ...assuming I would
have a debug object persisting in the encapsulation block that I could call
in the modules private methods. ie $_debug_obj -log_dump($whatever);

When I use CreateYourWeb::Messenger; in a test script to send an email - it
works as expected and sends the email.

Problem is when I add print statements to my constructors/destructors and to
the script what I see is that during the use CreateYourWeb::Messenger; in
the script that the debug object is created and destroyed and does not
persist - and therefore I unable to call private methods on it.

The code below is a fast cut/paste and I ask that you excuse any obvious
errors that would cause a non compile or strict/warning alert. The actual
code does work to completion because I check all returns and I don't try to
use the object cus it vanishes. I just didn't want to post all 500 lines
(more or less). I've tried to focus on the problem at hand...

# code begins

use Mail::Sendmail;
use CreateYourWeb::DeBug;
package CreateYourWeb::Messenger;
@ISA = qw (Mail::Sendmail  CreateYourWeb::Debug );
$VERSION = 1.00;
use strict;
use vars qw( $AUTOLOAD );   # Keep 'use strict' happy
use warnings;
use Carp;
use Data::Dumper;

{
# Encapsulated class data

   my $_debug_obj  =
CreateYourWeb::Debug-new('logfile'='c:\logs\messenger.log','mode'='APPEND
');
   my $_count = 0;   # number of msg objects
   my %_attr_data =  (  # namedefault
access
 '_msg_type'   = [   'email',   'read/write'],
 '_send'  = [   '','read/write'],
 '_sent'  = [   '','read/write'],
 '_time_sent'  = [   '','read/write'],
 '_error' = [   '','read/write'],
 '_log' = [   '','read/write'],
 '_to' = [   '','read/write'],
 '_from'= [   '','read/write'],
 '_subject'= [   '','read/write'],
 '_message'= [   '','read/write'],
 '_cc' = [   '','read/write'],
 '_bcc' = [   '','read/write'],
 '_smtp'= [   '','read/write'],
 '_X-Mailer' =  [ '',   'read/write'],
  );

# Encapsulated Class methods, to operate on encapsulated class data

# Is a specified object attribute accessible in a given mode
sub _accessible
{
my ($self, $attr, $mode) = @_;
print attr[$attr]mode[$mode]\n;
$_attr_data{$attr}[1] =~ /$mode/
}

etc...
}
# public methods
sub get_count
{
_get_count();
}
# Destructor adjusts class count
sub DESTROY
{
my ($self) = @_;
$self-_decr_count();
print DESTROYED MESSENGER $self\n;
}
etc...
1;
# code ends

Thanks,
Neil

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: DBD-MySQL (succesful connexion to MySQL)

2003-01-25 Thread Burak Gürsoy
Well... there was a discussion with this module in dbi-users this week. It
looks like it has a problem with the blobs. I didnt use it.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Tillman, James
 Sent: Friday, January 24, 2003 4:58 PM
 Cc: [EMAIL PROTECTED]
 Subject: RE: DBD-MySQL (succesful connexion to MySQL)


  -Original Message-
  From: Robert Allerstorfer [mailto:[EMAIL PROTECTED]]
  Sent: Friday, January 24, 2003 9:59 AM
  To: theatrale
  Cc: [EMAIL PROTECTED]
  Subject: Re: DBD-MySQL (succesful connexion to MySQL)
 
 
  Hi,
 
  I think you have meant 'DBD::mysql'. Which reasons are there not using
  the PurePerl version 'DBD::mysqlPP' instead? Since it does not include
  XS files, it will work with Perl 5.8, on all platforms (at least
  theoretical). No package required - just copy the perl files into
  the proper directories.
 
 

 You know, I have to extend some kudos to the person who wrote
 that pure perl
 mysql driver.  That must have been some painstaking work.  How's the
 performance compared to the XS module?  Anyone know?  If it's comparable,
 then they deserve even more geek prestige. :-)

 jpt
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: DBD-MySQL (succesful connexion to MySQL)

2003-01-25 Thread Burak Gürsoy
Actually, it does exist for 5.8 in the http://theoryx5.uwinnipeg.ca/ppms/
repository and I' ve re-installed it from this address yesterday to test. I
don't know why you get a 404 (if you still get it)

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of theatrale
 Sent: Friday, January 24, 2003 2:37 PM
 To: [EMAIL PROTECTED]
 Subject: DBD-MySQL (succesful connexion to MySQL)


 That's fine, I succesfully connect Perl 5.6 to MySQL 3.23.54-nt

 It seems that package bdb-mysql is not available for perl 5.8.
 so I have switch from Perl 5.8 to Perl 5.6, and it is ok now.

 I want to thank all fo you for your usefull help, and specially :

 - Burak Gürsoy
 - Christopher R. Jones
 - Fernando Freire Baez
 - Kim H. Young
 - michael higgins
 - Randy Kobes
 - Tillman, James

 - and sorry if I have fogotten someone.

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: :MySQL

2003-01-23 Thread Burak Gürsoy
ok , found it... run this command from the commandline:

ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd

this is for perl 5.8 btw...

you can add it to your ppm repositories:
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58

Also, you can try the mysqlPP driveri just replace the string 'mysql' with
'mysqlPP' in your codes...


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of theatrale
 Sent: Thursday, January 23, 2003 5:22 PM
 To: Burak Gürsoy; [EMAIL PROTECTED]
 Subject: DBD::MySQL


 it seems your are right, I have installed DBD-mysqlPP from Active
 repositories.

 where can I find DBD-mysql ?
 (and how do I get it ??)



 - Original Message -
 From: Burak Gürsoy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, January 23, 2003 3:49 PM
 Subject: RE: MySQL (let's resume !)


  it looks like you have installed 'mysqlPP' not 'mysql'
 
  mysqlpp is the pure perl DBD driver for the mysql database server, while
  DBD::mysql includes some code that needs to be compiled...
 
  I' ve searched ActiveState repository, but they dont have a DBD::mysql
 ppd.
  You can try other repositories or if you can, compile it by
 yourself. I'm
  sure that someone in this list will give you a repository
 address for this
  (I dont remember right now).
 
  Also, when you, set RaiseError to 1, it is *unnecessary* to write
  DBI-connect() or die() because RaiseError just does this.
 
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED]]On Behalf
   Of theatrale
   Sent: Thursday, January 23, 2003 4:39 PM
   To: [EMAIL PROTECTED]
   Subject: BDI:MySQL (let's resume !)
  
  
   After imported sucesfully my database, I still can't connect to
   my database,
   Apache (error.log file) tells me that install_driver(mysql) failed.
  
   I don't understand, I have installed DBI and DBD::MySQL with
   ppm.exe without
   any problem.
   need I to declare something somewhere ?
   (in apache ? or in Perl ?)
  
  
  
   apache error.log extracted :
   [Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1] Premature end of
   script headers: base.pl
   [Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1]
   install_driver(mysql)
   failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
 D:/prog/Perl/lib
   D:/prog/Perl/site/lib .) at (eval 1) line 3.
   [Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1] Perhaps the
   DBD::mysql
   perl module hasn't been fully installed,
   [Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1] or perhaps the
   capitalisation of 'mysql' isn't right.
   [Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1]
 Available drivers:
   ExampleP, Proxy, mysqlPP.
  
  
  
   source code :
  
   use DBI;
  
   my $host = 'localhost';
   my $db   = 'theatre';
   my $userid   = 'root';
   my $password = 'root';
   my $err_attr = {PrintError = '0', RaiseError = '1'};
   my @dsn  = (DBI:mysql:host=$host;database=$db, $userid,
 $password,
   $err_attr);
  
   my $dbh = DBI-connect(@dsn) or die('Error in database'.$DBI-errstr);
  
  
   print Content-type: text/html\n\n;
   print connection !;
  
   $dbh-disconnect();
  
   ___
   Perl-Win32-Users mailing list
   [EMAIL PROTECTED]
   To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  
 
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: DBD::MySQL

2003-01-23 Thread Burak Gürsoy
I think that mysql 4 libraries or at least their names are different, I
couldnt compile the module to use mysql 4 ? can you give any info on that?


 -Original Message-
 From: Randy Kobes [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 23, 2003 5:56 PM
 To: theatrale
 Cc: Burak Gürsoy; [EMAIL PROTECTED]
 Subject: Re: DBD::MySQL


 On Thu, 23 Jan 2003, theatrale wrote:

  where can I find DBD-mysql ?
  (and how do I get it ??)

 We have a copy in our repository. You can either install
 it directly as
   C:\ ppm install
  http://theoryx5.uwinnipeg.ca/ppmpackages/DBD-mysql.ppd
 for ActivePerl builds 6xx, or as
   C:\ ppm install
  http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
 for build 8xx. Alternatively, within the ppm shell,
 set the repository to
   http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer
 for 6xx, or
   http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
 for 8xx. See the help utility within the ppm shell for
 how to set the repository.

 If you get a problem about a missing library when using these,
 try adding the path to the mysql dlls (eg, C:\mysql\lib\opt,
 where libmySQL.dll lives) to your PATH environment variable.

 These packages were compiled against mysql-3.23.51 - I
 believe they won't work with mysql-4.

 --
 best regards,
 randy kobes


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Technical Arguments for using Perl in a web environment...

2003-01-23 Thread Burak Gürsoy
the fact is, perl was (and still is) the #1 language in CGI programming, and
a lot of the people think that CGI is a language and perl is something
related to it. Looks like it is the same all around the world :p

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Story, Lenny
 Sent: Thursday, January 23, 2003 6:16 PM
 To: Scot Robnett; [EMAIL PROTECTED]
 Subject: RE: Technical Arguments for using Perl in a web environment...


 Maybe im an idiot,  but why are people complaining about CGI and PERL when
 CGI is just an interface mechanism ?

 Does mod_perl execute perl code embedded in webpages, like php, etc ?
 If so, whats the issue ?

  I'll take a first guess and say its just buzzword bingo..

 *shrug*

 Thanks,
 -Lenny

 -Original Message-
 From: Scot Robnett [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 23, 2003 11:00 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Technical Arguments for using Perl in a web environment...


 Can I be the first to ask this not to become a M$ lovers vs. M$ haters
 sparring match? Let's all help each other here. Thanks and I'll
 shut up now.
 :)

 -
 Scot Robnett
 inSite Internet Solutions
 [EMAIL PROTECTED]



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of
 Tillman, James
 Sent: Thursday, January 23, 2003 9:39 AM
 To: 'Herbold, John W.'; [EMAIL PROTECTED]
 Subject: RE: Technical Arguments for using Perl in a web environment...


  -Original Message-
  From: Herbold, John W. [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, January 23, 2003 10:32 AM
  To: [EMAIL PROTECTED]
  Subject: RE: Technical Arguments for using Perl in a web
  environment...
 
 
 [...]
  I just
  believe that any thing MS makes is faster ;-)

 ???  You've got to be kidding, right?

 jpt
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: DBD::MySQL

2003-01-23 Thread Burak Gürsoy
but the url you gave is for active perl 5.6.1 build6xx. ActiveState 5.8
repository does not contain DBD::mysql yet. and as far as I know, binary
modules are not compatible between 5.6.1  5.8


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Christopher R. Jones
 Sent: Thursday, January 23, 2003 6:18 PM
 To: theatrale; Burak Gürsoy; [EMAIL PROTECTED]
 Subject: Re: DBD::MySQL


 I always check out the Activestate package archives.
 http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/
 Here you will find DBD-Mysql.  I am not sure why ppm doesn't
 include it any
 more.  You download the zip file.  unzip it so it creates the directory
 structure as on the zip file. CD to the directory with the .ppd file. At
 the comand line, type:
 ppm install DBD-MySQL.ppd

 You need to include the ppd extension and ppm is case sensitive.


 At 16:21 1/23/2003 +0100, theatrale wrote:
 it seems your are right, I have installed DBD-mysqlPP from Active
 repositories.
 
 where can I find DBD-mysql ?
 (and how do I get it ??)
 
 
 
 - Original Message -
 From: Burak Gürsoy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, January 23, 2003 3:49 PM
 Subject: RE: MySQL (let's resume !)
 
 
   it looks like you have installed 'mysqlPP' not 'mysql'
  
   mysqlpp is the pure perl DBD driver for the mysql database
 server, while
   DBD::mysql includes some code that needs to be compiled...
  
   I' ve searched ActiveState repository, but they dont have a DBD::mysql
 ppd.
   You can try other repositories or if you can, compile it by
 yourself. I'm
   sure that someone in this list will give you a repository
 address for this
   (I dont remember right now).
  
   Also, when you, set RaiseError to 1, it is *unnecessary* to write
   DBI-connect() or die() because RaiseError just does this.
  
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf
Of theatrale
Sent: Thursday, January 23, 2003 4:39 PM
To: [EMAIL PROTECTED]
Subject: BDI:MySQL (let's resume !)
   
   
After imported sucesfully my database, I still can't connect to
my database,
Apache (error.log file) tells me that
 install_driver(mysql) failed.
   
I don't understand, I have installed DBI and DBD::MySQL with
ppm.exe without
any problem.
need I to declare something somewhere ?
(in apache ? or in Perl ?)
   
   
   
apache error.log extracted :
[Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1]
 Premature end of
script headers: base.pl
[Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1]
install_driver(mysql)
failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
 D:/prog/Perl/lib
D:/prog/Perl/site/lib .) at (eval 1) line 3.
[Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1] Perhaps the
DBD::mysql
perl module hasn't been fully installed,
[Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1] or perhaps the
capitalisation of 'mysql' isn't right.
[Thu Jan 23 15:31:13 2003] [error] [client 127.0.0.1]
 Available drivers:
ExampleP, Proxy, mysqlPP.
   
   
   
source code :
   
use DBI;
   
my $host = 'localhost';
my $db   = 'theatre';
my $userid   = 'root';
my $password = 'root';
my $err_attr = {PrintError = '0', RaiseError = '1'};
my @dsn  = (DBI:mysql:host=$host;database=$db,
 $userid, $password,
$err_attr);
   
my $dbh = DBI-connect(@dsn) or die('Error in
 database'.$DBI-errstr);
   
   
print Content-type: text/html\n\n;
print connection !;
   
$dbh-disconnect();
   
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
   
  
   ___
   Perl-Win32-Users mailing list
   [EMAIL PROTECTED]
   To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


 Chris Jones, P.Eng.
 14 Oneida Avenue
 Toronto, ON M5J 2E3
 Tel. 416 203-7465
 Fax 416 203-8249

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: bless question

2003-01-12 Thread Burak Gürsoy
okie dokie... It looks like I misunderstood something. Thanks :)

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Alan Dickey
 Sent: Sunday, January 12, 2003 1:54 AM
 Cc: Perl-Win32-Users
 Subject: Re: bless question


 Burak Gürsoy wrote:
 
  But I dont use bless on the first object, create a clone of it
 an use bless
  on the second one
  and return this second one. It looks like a bug to me.

 ok, let me try again.

  #!/usr/bin/perl -w
  use strict;
  package Test::One;
 
  sub new {
 my $class = shift;
 my $self  = {};

 # here an anonymous hash is created.

 bless $self, $class;

 # here that hash is blessed into package Test::One

 return $self;

 # and the blessed thingie is returned

  }
 
  package Test::Two;
 
  sub new {
 my $class   = shift;
 my $test_it = shift;
 my $self= $test_it;
 bless $self, $class;
 return $self;
  }
 
  package main;
 
  my $test_one = Test::One-new();
  print [Before] ref(\$test_one) = ,ref($test_one),\n;
  print $test_one\n;

 # I added this to show what $test_one refers to. when I ran this
 # I got this:

 Test::One=HASH(0x1abf0ac)

 # this shows the hash at '0x1abf0ac' has been blessed into
 # package Test::One.


  my $test_two = Test::Two-new($test_one);

 # when the Test::Two::new method is called, you are
 # passing it the reference to the blessed anonymous hash.
 # the Test::Two::new method reblesses that anonymous hash
 # into the package Test::Two.

  print [After ] ref(\$test_one) = ,ref($test_one),\n;
  print $test_two\n;

 # again, let's see what $test_two contains. on my system, I
 # got:

 Test::Two=HASH(0x1abf0ac)

 # this shows the hash at '0x1abf0ac' has been blessed into
 # package Test::Two.

 # I say again, this is what I expect.

 # have a look at the perl documentation for references and
 # objects:

 http://www.perldoc.com/perl5.8.0/pod/perlref.html
 http://www.perldoc.com/perl5.8.0/pod/perltoot.html

 # HTH


 --
 Alan F. Dickey - Interaction and Realization
 http://www.intac.com/~afdickey
 mailto:[EMAIL PROTECTED]
 VOX: 908-273-3232 Cell: 908-334-0932

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: bless question

2003-01-11 Thread Burak Gürsoy
But I dont use bless on the first object, create a clone of it an use bless
on the second one
and return this second one. It looks like a bug to me.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Alan Dickey
 Sent: Sunday, January 12, 2003 12:22 AM
 Cc: Perl-Win32-Users
 Subject: Re: bless question


 Burak Gürsoy wrote:
 
  Can anyone explain this? is this a bug or feature?
 

 what were you expecting

  #!/usr/bin/perl -w
  use strict;
  package Test::One;
 
  sub new {
 my $class = shift;
 my $self  = {};
 bless $self, $class;
 return $self;
  }
 
  package Test::Two;
 
  sub new {
 my $class   = shift;
 my $test_it = shift;

 #$text_it == $test_one

 my $self= $test_it;

 #$self == $test_one

 bless $self, $class;

 # $test_one now object of Test::Two

 return $self;
  }
 
  package main;
 
  my $test_one = Test::One-new();
  print [Before] ref(\$test_one) = ,ref($test_one),\n;
 
  my $test_two = Test::Two-new($test_one);
  print [After ] ref(\$test_one) = ,ref($test_one),\n;

 does what I would expect...

 --
 Alan F. Dickey - Interaction and Realization
 http://www.intac.com/~afdickey
 mailto:[EMAIL PROTECTED]
 VOX: 908-273-3232 Cell: 908-334-0932

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: 5.8 GD, DB_File, and TK::Jpeg ppd request

2002-12-26 Thread Burak Gürsoy
Activestate must add this address to the standard ppm repository list  :))

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Randy
Kobes
Sent: Thursday, December 26, 2002 10:16 PM
To: Bruce Winter
Cc: [EMAIL PROTECTED]
Subject: RE: 5.8 GD, DB_File, and TK::Jpeg ppd request


On Sat, 14 Dec 2002, Bruce Winter wrote:

 You mentioned a freetype lib fix.  Do you think with that fix
 we will be able to use TrueType fonts in GD?  In past versions,
 we have gotten that to work well on linux, but never with
 windows GD.  It always returned empty boxes where the fonts
 should go.

I've updated the freetype lib for the GD-2.05 module at
   http://theoryx5.uwinnipeg.ca/ppmpackages/
for 5.6 packages and
   http://theoryx5.uwinnipeg.ca/ppms/
for 5.8 packages. A simple test (using the full path
to the ttf file) seems to work in using TrueType fonts.
The GD version hasn't changed, so if you're already installed
GD via ppm from here, you may have to uninstall it first.

--
best regards,
randy

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: problem comparing hashes

2002-12-26 Thread Burak Gürsoy
#!/perl -w
use strict;


my %default = (
one   = 1,
two   = 2,
three = 3,
four  = 4,
five  = 5,
six   = 6,
);

my %cgi = (
one   = 10,
two   = 20,
three = 3,
four  = 4,
five  = 5,
six   = 6,
);

my %extra;

foreach my $key (keys %default) {
$extra{$key} = $cgi{$key}
if(exists $cgi{$key} and $cgi{$key} ne $default{$key});
}


print DEBUG:\nChanged keys are:\n;

foreach (sort keys %extra) {
print $_ = $extra{$_}\n;
}

__END__;

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Adam
Peterson
Sent: Thursday, December 26, 2002 10:33 PM
To: [EMAIL PROTECTED]
Subject: problem comparing hashes


hi,

i have a cgi script where i attempt to compare the values in 2 separate
hashes( %query_data  %cgi_data). if there are differences in the vaules,
i would like to build a 3rd hash (%update_data) containing the differences
(the keys of the two hashes are the same). i'm having no luck... any
advice?

thanks

excerpt from code:

if (@inserts)
{
 build hash from cgi/user input

foreach my $insert (@inserts)
{
push (@{$cgi_data{$insert}}, $wrkd[$count], $cmt[$count],
$crash[$count]);
$count++;
}

 compare cgi and query hashes. if there are differences, build a new
update hash

foreach my $kee (keys (%query_data))
{
foreach my $keyz (keys (%cgi_data))
{
unless (${query_data{$kee}[0]} eq ${cgi_data{$keyz}[0]} 
${query_data{$kee}[1]} eq ${cgi_data{$keyz}[1]}  ${query_data{$kee}[2]}
eq ${cgi_data{$keyz}[2]})
{
push ( @{$update_data{$keyz}}, ${cgi_data{$keyz}[0]},
${cgi_data{$keyz}[1]}, ${cgi_data{$keyz}[2]} );
last;
}


}
}

 insert data from update hash into db

foreach my $up (keys (%update_data))
{
$sth = $dbh-prepare(
use eggsupp
update filesupp set status = '${update_data{$up}[0]}', comment =
'${update_data{$up}[1]}', crashtype = '${update_data{$up}[2]}'
where filename = '$up'
);

$sth-execute;
my $rows_affected = $sth-execute();

my %updates = (file = $up, rows = $rows_affected);
push (@list2, \%updates);
}

$tmpl_up-param({updates=\@list2});
print $cgi-header(text/html), $tmpl_up-output;
exit;
}



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: PERL Question

2002-12-19 Thread Burak Gürsoy
IIS only looks at the extensions I think... I dont remember a configuration
option to enable what you said... I never use the full (and correct) path to
perl executable, but everything works fine (win2k pro)

Apache' s default config requires exact path, but you can change this...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Mark
Bergeron
Sent: 19 Aralik 2002 Persembe 02:44
To: $Bill Luebkert; David Stoltz
Cc: [EMAIL PROTECTED]
Subject: Re: Re: PERL Question


Bill is right of course. However, if you’re running IIS, which I think you
are then you have to fire off the Perl by pointing to the exact location of
Perl.

My system:
C:\Perl\bin\perl.exe

Sometimes and I can't quite remember what script[s] it was, you can leave
off the .exe and just look into the directory. Even when I ran Apache on XP,
I had to point to the absolute path of the interpreter. You can still run
warning though:

C:\Perl\bin\perl.exe -w

Mark`

-Original Message-
From: $Bill Luebkert[EMAIL PROTECTED]
To: David Stoltz[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Date: Wed Dec 18 14:21:40 PST 2002
Subject: Re: PERL Question

David Stoltz wrote:
 I'm a PERL newbie, and have a pretty simply question.

 I am running a Windows 2000 server, with Active States latest version of
 ActivePerl running on it...

 I have a line in a script I need to modify:
 !/usr/bin/perl -w
 ~needs to point to d:\perl

 What's the right syntax?

Depends on who's reading it.  In most cases, you can just leave the
#!/usr/bin/perl.
Apache however will use it and  #!D:/perl/bin/perl or #!D:\perl\bin\perl
should
both work.  tcsh and bash should also work with either.  You can also use
the more generic  #!perl  if perl is on your path.

 Also, if anyone has a easy to use PERL script that allows me to fetch
 an URL from the web and download it to my local server, that's what I
 really need...

The LWP solution already posted will take care of getting the content
of the page.  If you need the raw page, you can use Net::FTP (assuming
there is a FTPD running on the server or the webserver handles ftp://.


--
   ,-/-  __  _  _ $Bill Luebkert   ICQ=162126130
  (_/   /  )// //   DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--  o // //  http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/__/_/_ Castle of Medieval Myth  Magic
http://www.todbe.com/

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Two questions...

2002-12-12 Thread Burak Gürsoy
Well... TextPad is shareware, but it has no time limits and it does not
block any functionality (FYI)... It's a nice editor and does not eat your
system resources...


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: 12 Aralýk 2002 Perþembe 18:02
To: [EMAIL PROTECTED]
Subject: Re: Two questions...


In a message dated 12/12/02 13:48:42 GMT Standard Time,
[EMAIL PROTECTED] writes:



What's a good Perl Editor?
--

Well, there's always notepad.exe.

The rest are from the mailing list. The reason the information varies is
that my knowledge of them varies.

PFE32 is a reasonable programming editor, with line numbering and the
ability to execute the edited script. It's not Perl-specific (no syntax
highlighting). It's also no longer under development, but it's still
available via WinSite. See http://www.lancs.ac.uk/people/cpaap/pfe/. Free.

OpenPerl IDE has line numbering, syntax highlighting, execution, and
debugging. See http://sourceforge.net/projects/open-perl-ide/. Free.

Crimson Editor. line numbering and syntax highlighing. Not sure if it has
execution or debugging. See http://www.crimsoneditor.com/.

XEmacs for Win32 (http://www.xemacs.org/).

MicroEmacs

EditPad (http://www.editpadclassic.com/). Postcardware.

TextPad. www.textpad.com. Shareware.

UltraEdit (www.ultraedit.com).

vim (www.vim.org). Syntax highlighting, regex searching

SciTe (www.scintilla.org).

fte - Folding Text Editor (fte.sourceforge.net)

Komodo ($$, though apparantly there's a non-commercial vestion), includes
regex debugging

CodeWright ($$)

VisualStudio with ActiveState Perl plugins ($$)




There is also the public domain WinPerl (downloadable from my website and no
longer developed) - does anyone know of a later version??

Personally, I use DzSoft's Perl Editor - see a review also on my website for
more information.

For reviews and downloading WinPerl, see:

http://hometown.aol.co.uk/RWAPSoftware/websoftware.htrml

--
Rich Mellor
RWAP Software
35 Chantry Croft, Kinsley, Pontefract, West Yorkshire, WF9 5JH
TEL: 01977 610509
http://hometown.aol.co.uk/rwapsoftware

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Two questions...

2002-12-12 Thread Burak Gürsoy
Free for evaluation...

I dont buy everything I like...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Lee
Goddard
Sent: 12 Aralik 2002 Persembe 19:16
To: Burak Gürsoy; [EMAIL PROTECTED]
Subject: RE: Two questions...




At 18:03 12/12/2002, Burak Gürsoy wrote:
Well... TextPad is shareware, but it has no time limits and it does not
block any functionality (FYI)... It's a nice editor and does not eat your
system resources...

Textpad is only $15. Dodn't they pay you?

Sheesh.


Lee Goddard, BA(Hons), MSc(Sussex)
http://www.LeeGoddard.com/ since 1997.
Direcotr: Little Bits Ltd - Perl / Java / XML / HTML Contractors
Inc. in England #4006170; VAT #755-0139-42

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: web form editor

2002-11-11 Thread Burak Gürsoy
http://webfx.eae.net/dhtml/richedit/richedit.html

no module needed I believe... evething happens on the client side...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:perl-win32-users-admin;listserv.ActiveState.com]On Behalf Of George
Harris
Sent: Monday, November 11, 2002 8:31 PM
To: [EMAIL PROTECTED]
Subject: Re: web form editor



2nd try:

Does anybody know how these inline editors are created
into a web page form, and if there are any perl
modules to support this?

Thanks.

--- George Harris [EMAIL PROTECTED] wrote:
 Hi All,

 I do all of my CGI form handling in perl.

 But I've noticed that there is a way to put a small
 rich text editor into a web page input form. For
 example, this is done with yahoo mail. I've also
 seen
 it done with .NET stuff.

 I'm wondering if anyone knows how to do this?

 And of course, how to handle the output that these
 browser editors generate, maybe using cgi.pm?

 Thanks!

 __
 Do you Yahoo!?
 U2 on LAUNCH - Exclusive greatest hits videos
 http://launch.yahoo.com/u2
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe:
http://listserv.ActiveState.com/mailman/mysubs


__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Random numbers

2002-10-29 Thread Burak Gürsoy
you can use crypt():

#!/usr/bin/perl -w
use strict;

print generate_password(), \n for 1..1000;

sub generate_password

   return(substr(crypt(,join('',(0..9,'A'..'Z','a'..'z')[rand 62,rand
62])), -8 ));
}

if you want to check if the same string is generated, you can write some
control structure...


-Original Message-
From: [EMAIL PROTECTED]
[mailto:perl-win32-users-admin;listserv.ActiveState.com]On Behalf Of
Krishna, Hari
Sent: Tuesday, October 29, 2002 7:48 PM
To: 'FARRINGTON, RYAN'; [EMAIL PROTECTED]
Subject: Random numbers


Hi friends,
I want to generate some 1000 or more passwords for some NT machine.
I should be able to generate an 8 digit alphanumeric random numbers from the
list of characters.

Say I have 3 strings...
First string : 0 - 9 numbers
Second string : A - Z characters
Third string: a - z characters.

Now I should be able to generate strings like:

abCd16Sz
U8Yb90vc
Nt7gO0PL

something like that.

Is there a way to generate such kind of random numbers 8 characters long???

I saw in a bok that there is a module in PERL
MATH::TrulyRandom

but I am not sure if it helps. I will keep trying.


any inputs appreciated.

Hope I can get some help.


Thanks and Regards,
Hari.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: subrooteens/functions within strings.

2002-10-29 Thread Burak Gürsoy
you cant use functions in double quotes. When you pass a string, you must
quote it, and leading ampersand is optional when you call it with
parenthesis...

print Hello ,caps('shain'), Nice to see you today.\n;

sub caps {return uc shift};

-Original Message-
From: [EMAIL PROTECTED]
[mailto:perl-win32-users-admin;listserv.ActiveState.com]On Behalf Of Shain
Edge
Sent: Tuesday, October 29, 2002 10:34 PM
To: perl
Subject: subrooteens/functions within strings.


I know that perl can parse varibles and return the
results if a string has Scaler varibles within them. I
would like to figure out how to do the same with perl
and user defined functions.

Is there a way to do this within a double quoted
string?

example of what I would like to happen:


print Hello caps(shain), Nice to see you today.\n;

sub caps {return uc shift)};

return the result of:

Hello SHAIN, Nice to see you today.



=
Mekton Compendium: http://groups.yahoo.com/subscribe/mekton-c

Nothing is impossible. the supposidly impossible can be made possible by
anyone who determines what you need to do to make it a reality. -Shain Edge

__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: [Perl-unix-users] structuring languge dependent code

2002-08-15 Thread Burak Gürsoy

using seperate files can be better... then you can call them via require().
each module can export a hash to your namespace via Exporter...

if($lang eq 'en') {
   require YourNameSpace::En;
} elsif (...) {
   #...
} else {
   #...
}

print $en{'mes001'};

# etc...


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter
Eisengrein
Sent: Thursday, August 15, 2002 10:03 PM
To: 'Martin Moss'; [EMAIL PROTECTED]
Subject: RE: [Perl-unix-users] structuring languge dependent code


I don't think you need to create separate Module names, just different subs.
Something like this would work, I think. Then you can have the script call
the subs by the specific language.


my $language;


sub hallo
{ 
$language = german; 
do_this; 
} 
sub hello 
{ 
$language = english; 
do_this; 
} 
sub hola 
{ 
$language = spanish; 
do_this; 
} 
sub do_this 
{ 
my %messages = ( 
'english' = 'Hello World', 
'spanish' = 'Hola Mundo', 
'german' = 'Hallo Welt' 
); 
return $messages{$language}; 
} 




 -Original Message- 
 From: Martin Moss [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 15, 2002 14:16 
 To: [EMAIL PROTECTED] 
 Cc: Perl-Unix-Users 
 Subject: [Perl-unix-users] structuring languge dependent code 
 
 
 All, 
 
 Does anybody have any suggestion how the Directory 
 structuring of  Modules. 
 
 For instance I would like to support 3 languages. 
 Therefore I want 3 different versions of the same module, but each one 
 providing error messages and output in a specific language. 
 
 so perhaps:- 
 
 MyName::SubName1::Foo::eng::Object 
 MyName::SubName1::Foo::ger::Object 
 MyName::SubName2::Foo::Bar::eng::Object 
 MyName::SubName2::Foo::Bar::ger::Object 
 MyName::SubName1::Foo::Bar::Haha::eng::Object 
 MyName::SubName1::Foo::Bar::Haha::ger::Object 
 
 or like this:- 
 
 MyName::engSubName1::Foo 
 MyName::ger::SubName1::Foo 
 MyName::eng::SubName2::Foo::Bar 
 MyName::ger::SubName2::Foo::Bar 
 MyName::eng::SubName1::Foo::Bar::Haha 
 MyName::ger::SubName1::Foo::Bar::Haha 
 
 I tend to lean towards the first Set as this keeps all 
 versions of a modules 
 near each other, but does indeed comprise of lot's of Object.pm's. The 
 second method would seem to follow CPAN structure of the moduleName.pm 
 variety. However to take that to the next step I could have a 
 lot of eng.pm, 
 ger.pm's hanging around. 
 
 MyName::SubName1::Foo::Bar::eng 
 MyName::SubName1::Foo::Bar::ger 
 MyName::SubName2::Foo::ger 
 MyName::SubName2::Foo::end 
 
 So, can anybody provide and views pointers on this dilemna? I 
 do want to be 
 able to make it easy to add new Modules for new languages one 
 at a time. My 
 code already works out the language name and pulls it in with 
 a require - at 
 runtime. (any suggested improvements to this are also welcomed), 
 
 Everything is running under mod_perl. 
 
 regards 
 
 Marty 
 
 
 
 
 
 
 
 
 ___ 
 Perl-Unix-Users mailing list 
 [EMAIL PROTECTED] 
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 
 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Use a module from a user param input

2002-07-12 Thread Burak Gürsoy

you cant do that. try require() instead

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Fernando Freire Baez [Medicare)
Sent: Friday, July 12, 2002 8:24 PM
To: [EMAIL PROTECTED]
Subject: Use a module from a user param input


Hello,

I am working in an intranet site that create the pages on the fly. All the
information about the site (ej: scripts, comands, views, etc) is stored in
MySQL database. I am using the MVC (Model, View, Controler) pattern style,
but I want to call the modules to use in the  scripts from the user input.
If for example the URL is:
http://localhost/cgi-bin/script_name.pl?module=newscommand=display I want
to call the module from the value of module parameter, is something like
that:

use strict;
use CGI qw(:standard);

my $module = param('module');

use $module;

The problem is that the use is up at compile time and I can take the
$module value at runtime. I think I can use the block BEGIN{} but I don't
know how. If anybody have any idea how to call a module this way please let
me know. Thanks

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Can't Locate Perl in Registered File Lists

2002-05-16 Thread Burak Gürsoy

adding a new command named NOTEPAD is better IMO

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 3:51 PM
To: [EMAIL PROTECTED]
Subject: RE: Can't Locate Perl in Registered File Lists


How to make .pl files open in Notepad when double clicked yet maintain
current icon.

(Win2k OS)

Open My Computer.
Tools  Folder Options
click the File Associations tab.
Select .pl
Click advanced.
Click New
Type Edit (or foo for that matter) in the Action textbox
Click Browse
Find app of your choice (I navigated to C:\WINNT\notepad.exe) and select it.
Click OK
Select the new Edit Command
Click the button Set Default
click OK
Click Close


Using this method you will retain the original run command that the Perl
installer created along with the original icon, yet have a different default
behavior when it is double clicked.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: MSAccess file format question...

2002-02-28 Thread Burak Gürsoy

*untested just an idea :)*

create a blank access database blank.mdb and if you want to fill it, copy
it to another dir and do what you want :) you'll still have a blank db for
future uses


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Morse,
Richard E.
Sent: Thursday, February 28, 2002 7:02 PM
To: 'Mike DeWolfe'; [EMAIL PROTECTED]
Subject: RE: MSAccess file format question...


H... however, I don't need to just create a blank database -- the idea
is to be able to have a cgi extract data from an Oracle database and create
an Access database with the data in it, and then return that via HTTP
download...  In order to do that, I need to be able to write out to the
Access file format...

Thanks for any help,
Ricky

-Original Message-
From: Mike DeWolfe [mailto:[EMAIL PROTECTED]]
Sent: Thursday 28 February 2002 11:22 AM
To: [EMAIL PROTECTED]
Subject: Re: MSAccess file format question...


What I've done in the past is make a blank database and then copy that file
and rename it as required. As it's only a file (and a small one when it's
empty), that makes it easy to throw around.

- Mike DeWolfe

- Original Message -
From: Morse, Richard E. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 28, 2002 7:42 AM
Subject: MSAccess file format question...


 Hi!  For a particular application (actually, a CGI) I am writing, I want
to
 be able to create a .mdb (access 2000 version) file.  However, if
possible,
 I want to avoid actually opening access.  Is there some reference that
would
 tell me what the Access2000 file format is?  Or, better yet, is there a
 module somewhere that will do this?

 Thanks,
 Ricky

 -
 Richard MorseSystem Administrator
 MGH Biostatistics Center  50 Staniford St. Rm 560
 [EMAIL PROTECTED] 617/724-9830
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: MSAccess file format question...

2002-02-28 Thread Burak Gürsoy

oops!
sorry about the previous message. I didnt see Mike's message...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Adam
Frielink
Sent: Thursday, February 28, 2002 7:18 PM
To: Morse, Richard E.; [EMAIL PROTECTED]
Subject: RE: MSAccess file format question...


Well, to create a mdb on the fly, the easiest way is to Use ACCESS via OLE.
But Mike's suggestions is excellent, simply copy and rename a black one.  In
addition, then use a DSN-Less ODBC connection to access it from there and
transfer all the data you need.

Adam Frielink

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of
 Morse, Richard E.
 Sent: Thursday, February 28, 2002 11:02 AM
 To: 'Mike DeWolfe'; [EMAIL PROTECTED]
 Subject: RE: MSAccess file format question...


 H... however, I don't need to just create a blank database -- the idea
 is to be able to have a cgi extract data from an Oracle database
 and create
 an Access database with the data in it, and then return that via HTTP
 download...  In order to do that, I need to be able to write out to the
 Access file format...

 Thanks for any help,
 Ricky

 -Original Message-
 From: Mike DeWolfe [mailto:[EMAIL PROTECTED]]
 Sent: Thursday 28 February 2002 11:22 AM
 To: [EMAIL PROTECTED]
 Subject: Re: MSAccess file format question...


 What I've done in the past is make a blank database and then copy
 that file
 and rename it as required. As it's only a file (and a small one when it's
 empty), that makes it easy to throw around.

 - Mike DeWolfe

 - Original Message -
 From: Morse, Richard E. [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, February 28, 2002 7:42 AM
 Subject: MSAccess file format question...


  Hi!  For a particular application (actually, a CGI) I am writing, I want
 to
  be able to create a .mdb (access 2000 version) file.  However, if
 possible,
  I want to avoid actually opening access.  Is there some reference that
 would
  tell me what the Access2000 file format is?  Or, better yet, is there a
  module somewhere that will do this?
 
  Thanks,
  Ricky
 
  -
  Richard MorseSystem Administrator
  MGH Biostatistics Center  50 Staniford St. Rm 560
  [EMAIL PROTECTED] 617/724-9830
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: sending a file as an e-mail Attachment using Perl

2002-02-27 Thread Burak Gürsoy

I use MIME::Lite


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bryan
T. O'Malley
Sent: Wednesday, February 27, 2002 8:33 PM
To: [EMAIL PROTECTED]
Subject: sending a file as an e-mail Attachment using Perl


I have used net::smtp to send e-mail. Works great.


I am unable to figure out how to send a file as an e-mail attachment using
Perl.

Any pointers toward the solution to this problem will be greatly
appreciated.

Thank-you,

Bryan.






Bryan O'Malley, Actinide Analytical Chemistry, C-AAC
Quality and Information Management Team, MS G-740
PO Box 1663, MS G740, Los Alamos, NM 87545 Tel 505-665-1769
Fax (Lab Business Only): 505-665-4737
Personal Fax: (605)253-1459


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: use strict and globabl variables

2002-02-23 Thread Burak Gürsoy

% means (as a variable) hash

%my_hash = (blah_1 = value 1, blah_2 = value 3);

etc... nothing to do with globals...

my() and local() make your variable lexical scoped (read perl
documentation).

you must write it as;
my $sFilePat h =  'c:\some\path\file.txt';

if you call some vars from an outer file, and dont use packages, oop etc,
use the vars pragma;

use strict;
use vars '$scalar, %hash';

print $scalar, $hash{'val'};

however, a new function added to replace vars pragma = our(). But it is not
the exactly same as vars...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ken
Swift
Sent: Saturday, February 23, 2002 8:43 PM
To: [EMAIL PROTECTED]
Subject: use strict and globabl variables


Hi,
   The following is a sample of code that i can't seem
to get working:

use strict;
my %sFilePath= 'c:\some\path\file.txt';

mysub();

sub mysub {
   open (MYFILE, $sFilePath);
   foreach my $sLine (MYFILE) {
  print $sLine\n;
   }
   close (MYFILE);
}

When I run this snippet of code it has no idea that
the sFielPath variable is.  I am new to perl, but I
thought that using a % before the variable name
would make it global.  Any help would be appreciated.

Thanks in advance -- Ken



__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs