Re: Appending array from HoA elements into one single array

2004-08-25 Thread balaji venkat
Hi Edward,

Source Code :

#! /usr/bin/perl

%hash1 = (
A => ["fred", "barney"],
B => ["George", "jane", "elroy"]
 );

foreach $sub (sort (keys(%hash1))) {
print "$sub\n";
$temp = @hash1{$sub};
for ($i=0;$i<=$#$temp;$i++) {
push(@array1,$temp->[$i]);
}
}
print "@array1\n";


This code will do the intended work.

Regards,
V.Balaji.

 --- Edward WIJAYA <[EMAIL PROTECTED]> wrote: 
> Hi,
> 
> Suppose I have this Hash of array:
> 
> %HoA = {
> A => ["fred", "barney"],
> B => ["george", "jane", "elroy"],
> };
> 
> Is there any efficient way to append
> each of this HoA's array into one
> single array, e.g:
> 
> @name = ("fred", "barney", "george", "jane",
> "elroy");
> 
> Regards,
> Edward WIJAYA
> SINGAPORE
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

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




Re: seek help!!

2004-08-25 Thread babulGogoi
r u trying to get a report type page out of the xml file (like access db)?

On Tue, 24 Aug 2004 07:17:56 -0400 (EDT), Chris Devers
<[EMAIL PROTECTED]> wrote:
> On Tue, 24 Aug 2004, Puppala, Satheesh Kumar (Satheesh)** CTR ** wrote:
> 
> > Can anybody help me to convert XML document into MS-DOC file in
> > Solaris enviornment using perl.
> 
> This isn't a free script writing service.
> 
> Please share with the list what you have tried so far, as well as what
> the XML data you're starting with is like and what format (do you mean
> Word Documents?) you're trying to end up with.
> 
> Demonstrate that you've tried to solve this on your own and people on
> mailing lists will be more willing to lend you a hand.
> 
> --
> Chris Devers
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 


-- 
www.Shillong.com

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




Getting network error codes using perl

2004-08-25 Thread Ben Crane
Hi all,

Does anyone know of a library/module that deals with
network errors? I am pinging (using net::ping) a
couple networks over a period of hours and I want to
log the ACTUAL network error code that is generated
when it fails/even passess. At the moment I just have
a self-built error net but it isn't very helpful
except for telling me when it failed.

Regards
Ben



___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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




problems while building Tk

2004-08-25 Thread Christian Stalp
Hello out there...
I have some trouble building the Tk for HPUX. 
My Eviroment is:
HPUX 10.20 on PA-RISC
Perl V 5.8.3
gcc 3.3.2
After the call of perl Makefile.PL I got this dumped:

perl is installed in /usr/local/lib/perl5/5.8.3/PA-RISC2.0 okay
PPM for perl5.008003
Test Compiling config/signedchar.c
Test Compiling config/Ksprintf.c
Test Compiling config/tod.c
Generic gettimeofday()
Using -L/usr/lib/X11R6 to find /usr/lib/X11R6/libX11.2
Cannot find X include files via /include
Cannot find X include files anywhere at ./myConfig line 332.
Compilation failed in require at Makefile.PL line 36.
BEGIN failed--compilation aborted at Makefile.PL line 38.

We have X installed and the headers are under /usr/include/X11 but there is  
only one sub-directory called bitmaps. Inside this there are serveral headers 
but without a ".h"-suffix. 
Is this normal? And what can I do to solf the problem?

Thank you

Gruss Christian

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




Re: Getting network error codes using perl

2004-08-25 Thread John W. Krahn
Ben Crane wrote:
Hi all,
Hello,
Does anyone know of a library/module that deals with
network errors? I am pinging (using net::ping) a
couple networks over a period of hours and I want to
log the ACTUAL network error code that is generated
when it fails/even passess. At the moment I just have
a self-built error net but it isn't very helpful
except for telling me when it failed.
Read the documentation on Net::Cmd which Net::Ping inherits from.
perldoc Net::Cmd
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Appending array from HoA elements into one single array

2004-08-25 Thread John W. Krahn
[please do not top-post.  TIA]
balaji venkat wrote:
#! /usr/bin/perl
You should enable warnings and strictures.
use warnings;
use strict;

%hash1 = (
A => ["fred", "barney"],
B => ["George", "jane", "elroy"]
 );
foreach $sub (sort (keys(%hash1))) {
print "$sub\n";
$temp = @hash1{$sub};
Warnings would have told you that assigning a hash slice to a scalar is 
probably a mistake.


for ($i=0;$i<=$#$temp;$i++) {
That is usually written as:
 for my $i ( 0 .. $#$temp ) {

push(@array1,$temp->[$i]);
}
}
print "@array1\n";

John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



What is perl equivalent of scanf in C

2004-08-25 Thread TapasranjanMohapatra
All,
Can somebody let me know what is the Perl equivalent of scanf in C.
Is it String::Scanf or there are some other options by which we can take key board 
input.
Thank You.
Tapas

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




RE: pulling out "a","an", "the" from beginning of strings

2004-08-25 Thread Bob Showalter
Errin Larsen wrote:
> Hey,
> 
> Ok, looking through this ... I'm confused.
> 
> << SNIP >>
> 
> > > 
> > > Perhaps:
> > > 
> > >$scalar =~ s/^(a|an|the)\s*\b//i;
> > > 
> > > would work better.
> 
> <>
> 
> Is this capturing into $1 the a|an|the (yes)

Yes, but that's only a side effect. I'm not doing anything with $1.

> and the rest of the title
> into $2 (no?).

No.

>  After doing so, will it reverse the two ( i.e.
> s/^(a|an|the)\s+(.*)\b/$2, $1/i )?  

No.

> Also, what is the "\b"?

A word boundary assertion. See perldoc perlre.

>  it seems
> that the trailing "i" is for ignoring case; is that correct?

Yes.

It's not concerned with capturing anything; it's just matching a pattern and
then replacing the text matched with an empty string. The parens are used to
delimit the alternation a|an|the.

What I'm trying to match is:

   ^   beginning of line, followed by
   (a|an|the)  one of these sequences, followed by
   \s* any amount of whitespace, followed by
   \b  a word boundary (see perldoc perlre)

The \s* is there so the whitespace following the leading word "a, an, or
the" will be removed along with the word. The \b ensures that the end of
what we capture either is at the start of a new word or is the end of the
string.

If I left off the \b, it would match the "a" in "acme", since \s* can match
the zero-length string between the "a" and the "c". With \b in there, the
match fails, because \b will not match at the "c", since it's not a word
boundary.

An alternative to \s*\b would be \s+ (i.e. match at least one whitespace
char). However, this won't match a single word title like "the", because \s+
doesn't match at the end of the string, while \s*\b does. (How such a title
should be handled is up to the OP; if it should be left alone, then \s+
would be appropriate.)

HTH

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




Re: What is perl equivalent of scanf in C

2004-08-25 Thread Randal L. Schwartz
> "TapasranjanMohapatra" == TapasranjanMohapatra  <[EMAIL PROTECTED]> writes:

TapasranjanMohapatra> Can somebody let me know what is the Perl
TapasranjanMohapatra> equivalent of scanf in C.

A good regex can beat the pants off of scanf.  I'm so happy
never to be constructing a scanf expression again!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> 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: pulling out "a","an", "the" from beginning of strings

2004-08-25 Thread Bob Showalter
John W. Krahn wrote:
> Bob Showalter wrote:
> > Jose Alves de Castro wrote:
> > 
> > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote:
> > > 
> > > > I need to pull out articles "a", "an", and "the" from the
> > > > beginning of title strings so that they sort properly in MySQL.
> > > > What is the best way to accomplish that if I have a single
> > > > $scalar with the whole title in it?
> > > 
> > > I would go with substitutions:
> > > 
> > > $scalar =~ s/^(?:a|an|the)//i;
> > 
> > Two problems:
> > 
> > 1. This doesn't remove just the whole words; it removes parts of
> > words as well. i.e. "Analyzing Widgets" would become "alyzing
> > Widgets" 
> 
> Actually it would become "nalyzing Widgets" because 'a' is the first
> alternative.  :-)

Smarty pants :~) 

My brain said "longest, leftmost", but the short-circuiting behavior is
clearly documented in perldoc perlre. If the alternation is written as
(an?|the), the "an" is matched.

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




Re: What is perl equivalent of scanf in C

2004-08-25 Thread balaji venkat
Hi,
 is available to take the keyboard input.

Sample Program for you is

#! /usr/bin/perl

print "Enter the value:\n";
$a = ;
print "The value of \$a is $a\n"

Regards,
V.Balaji.

 --- TapasranjanMohapatra
<[EMAIL PROTECTED]> wrote: 
> All,
> Can somebody let me know what is the Perl equivalent
> of scanf in C.
> Is it String::Scanf or there are some other options
> by which we can take key board input.
> Thank You.
> Tapas
> 
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

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




Image::Magic / Perl::Magick

2004-08-25 Thread Brian Volk
I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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




RE: Image::Magic / Perl::Magick

2004-08-25 Thread Hanson, Rob
Maybe this will help... maybe it won't.

I just tried installing Image::Magick (on Win2K/AS perl 5.6.1 build 635),
and had no issues.  The install showed that it installed Magick.dll, and
where it was installed to.  Note that I used "Image-Magick", which is how AS
has it stored in the repository.

[session follows]
H:\>ppm install Image-Magick
Installing package 'Image-Magick'...
Downloading
http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr
ead/Image-Magick.tar.gz ...
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.bs
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.dll
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.exp
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.lib
Installing C:\perl2\html\site\lib\Image\Magick.html
Installing C:\perl2\site\lib\Image\Magick.pm
Installing C:\perl2\site\lib\auto\Image\Magick\autosplit.ix

The I queried it using the "query" command...

H:\>ppm query Image-Magick
Image-Magick [0]

Also tried using the module (which should load the DLL you mentioned) with
no problems.

H:\>perl -e "use Image::Magick"

Rob



-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:48 PM
To: Beginners (E-mail)
Subject: Image::Magic / Perl::Magick 


I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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


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




Re: What is perl equivalent of scanf in C

2004-08-25 Thread Jenda Krynicky
From: "TapasranjanMohapatra" <[EMAIL PROTECTED]>
> All,
> Can somebody let me know what is the Perl equivalent of scanf in C. Is
> it String::Scanf or there are some other options by which we can take
> key board input. Thank You. Tapas

We usualy read a line of input by
$line = ;

remove the newline with
chomp($line)

and parse it using regexps:
my ($id, $name) = ($line =~ /ID: (\d+), Name: ([^,]+)/);

The chomp() step is often not necessary.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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




Help With OLE

2004-08-25 Thread DiGregorio, Dave
Hey All,

So I am building this app that parses and Excel spreadsheet for
a value based on the last column in the file.  But, I seam to return the
Numeric value as opposed to the Alpha Value.  Is there an easy way to get
around this??

 

$LastCol = $ReadSheet->UsedRange->Find({What=>"*",

SearchDirection=>xlPrevious,

SearchOrder=>xlByColumns})->{Column};

 

 

print "$LastCol\n" ; 

$ReadData = $ReadSheet->Range($LastCol.'4')->{Value} ;

 

 

 

Thanks

 

 

 

David R. DiGregorio

703 Rodi Road

Pittsburgh, PA 15235

p. 412-349-2440

[EMAIL PROTECTED]

 



Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-25 Thread JupiterHost.Net
Hmm, no takers eh? :)
Does anyone know if its possible to use Pod::Html to view a .pm file 
with pod documentation in it as a web page?

If not that module does anyone know any other modules/methods to do that?
Thanks :)
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: is possible start some actions with Perl without Cron?

2004-08-25 Thread Errin Larsen
Ok, since no one wanted to help me with this, I needed to look through
some googled stuff to find the answer myself.  In the spirit of
helping beginers (which of course I am) I'll post what I found! (This
material is from page 2 of the tutorial there):

<>


There are several rules or characteristics that most daemons possess.
If a daemon does not follow these basic rules, it will most likely
become a demon and wreak havoc on your system.
Fork and Exit

The first thing a daemon should do is fork() a child process and have
the parent process exit(). This is necessary for several reasons.
First, it disassociates the process from the controlling terminal, or
the login shell. Second, it removes the process from the process group
that initiated the program. This ensures that the process is not a
process group leader, which is required for setsid() to run
successfully.
Call setsid()

setsid() is a POSIX function that turns the process into a session
leader, group leader, and ensures that it doesn't have a controlling
terminal.
Change Working directory

The current working directory should be changed with chdir to the root
directory (/). This is necessary to avoid using a working directory
that resides on a mounted partition. If the process is started on a
mounted partition, the system administrator wouldn't be able to
unmount the partition until the process was halted. You could, of
course, specify a different working directory as long as it doesn't
reside on a remotely mounted partition.
File Creation Mode

The umask determines the default permissions new files are assigned.
Setting umask to 0 removes the defaults that might otherwise disable
permissions the daemon intended to enable when creating files.
Close Unneeded File Handles

Besides closing any filehandles that might have been opened, daemons
often redirect STDIN to read from, and STDOUT and STDERR to write to
/dev/null.

open STDIN,  '/dev/null' or die "Can't read /dev/null: $!";
open STDOUT, '>/dev/null';
open STDERR, '>/dev/null';

Logging Messages

In some cases, you may want to record an error or messages to a log
file on the system. This can be accomplished by redirecting STDOUT and
STDERR to one or more log files.

open STDOUT, ">>$access_log" or die "Can't write to $access_log: $!";
open STDERR, ">>$error_log" or die "Can't write to $error_log: $!";


<>

This material was all found at the following link:

http://www.webreference.com/perl/tutorial/9/

  and is authored by  ... well, here's a cut-n-paste of the about page:

About Mother of Perl - Mother of Perl is a free biweekly how-to
devoted to all things Perl. Perl has been an integral part of the Web
developer's toolkit for years now. There are probably more Perl
scripts, tools, and libraries available for Web Development than any
other modern language. This column will attempt to address the needs
and concerns of the Desparate Perl HackerĀ© by providing practical,
powerful, and elegant solutions to everyday problems in 100 lines of
code or less. If you would like to see a topic or problem area covered
in Mother of Perl, please let me know by sending me some feedback.

The Author - Jonathan Eisenzopf is an author, teacher, and consultant
who has worked with companies like Netscape, Chrysler, Mecklermedia,
Bell Atlantic, and Litton/PRC to deploy large scale Web-based
information systems. He is presently a Principal Software Engineer and
VP of Technology at Whirlwind Interactive, based in the Washington
D.C. area. Jonathan is active in the Perl and XML communities by
delivering presentations to user groups, contributing articles to
publications such as The Perl Journal, authoring modules for CPAN, and
maintains www.perlxml.com, an information clearinghouse for Perl and
XML resources. Jonathan is also a co-author of an upcoming book from
O'Reilly and Associates covering Perl and XML.

On Tue, 24 Aug 2004 15:59:57 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Can you help me understand the below a little better.
> 
> As I understand what's going on, the Process (let's say PID=100)
> spawns a child with the fork() function (let's say PID=200).  This
> (200) is assigned to $pid in the parent, and zero (0) is assigned to
> $pid in the child.  So, what does "my $pid=fork()" resolve to in each
> case?  I'll assume that it resolves to the PID that fork returns.  So,
> in the parent, the statement resolves to 200 and the unless statement
> doesn't resolve.  In the child, the statement resolves to 0 and the
> unless statement DOES resolve.  So, the parent prints a message to
> STDOUT and quits, while the child keeps on running (in the little
> do/while loop) doing that stuff that's in there :)  Ok ... so, um, why
> go through all this?  Why not just write your do/while block and just
> execute it in the background on the command line?  is fork() doing
> something else that helps a daemon that I'm not aware of?
> 
> --Errin
> 
> On Sat, 21 Aug 2004 09:53:23 -0400, Adam Rosi-Kessel
> <[EMAIL PR

Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-25 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]>
> Is there an easy way to view the POD from a local module in a browser
> to see what it will look like in CPAN?

I would generate the HTML file by the pod2html script and then look 
at the created file.

pod2html --infile=The/Module.pm --outfile=The/Module.html

You may need to play with the other options if the module docs try to 
reference other modules.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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




RE: Image::Magic / Perl::Magick

2004-08-25 Thread Hanson, Rob
> Error installing package 'PerlMagick': Read a PPD
> for 'PerlMagick', but it is not intended for this
> build of Perl (MSWin32-x86-multi-thread)

The error just means that ActiveState has this module in their repository,
but they don't have a version compiled for Windows.

So you are out of luck, unless you happen to have Microsoft's C++ compiler.
I believe not only do you need the MS C++ compiler, but it may also need to
be the same version the ActiveState uses to compile the perl executable
(someone, please correct me if I am wrong).

I took a look at the package on CPAN
(http://search.cpan.org/src/JCRISTY/PerlMagick-6.02/), and the README.txt
says that it does include a Makefile just for Windows... so it should
compile if you have the compiler.

Other than that all you can do is ask if someone already has it compiled,
and can send you the files.

Maybe you could even send a mail to ActiveState, I'm not sure but maybe if
they are in a good mood they might get it added to the repository (there may
even be some AS employees on this list, I see one poster's name that looks
familiar, but I'm not sure if he still works there).

Rob


-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 5:42 PM
To: Hanson, Rob; Beginners (E-mail)
Subject: RE: Image::Magic / Perl::Magick 


Rob,

Did you have any problems installing PerlMagick?  Below is the error I
received.  Any suggestions?

Thanks again for your help.  ImageMagick is now working.

Brian


PPM> install PerlMagick
Install package 'PerlMagick?' (y/N): y
Installing package 'PerlMagick'...
Error installing package 'PerlMagick': Read a PPD for 'PerlMagick', but it
is no
t intended for this build of Perl (MSWin32-x86-multi-thread)

-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:39 PM
To: 'Brian Volk'; Beginners (E-mail)
Subject: RE: Image::Magic / Perl::Magick 


Maybe this will help... maybe it won't.

I just tried installing Image::Magick (on Win2K/AS perl 5.6.1 build 635),
and had no issues.  The install showed that it installed Magick.dll, and
where it was installed to.  Note that I used "Image-Magick", which is how AS
has it stored in the repository.

[session follows]
H:\>ppm install Image-Magick
Installing package 'Image-Magick'...
Downloading
http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr
ead/Image-Magick.tar.gz ...
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.bs
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.dll
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.exp
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.lib
Installing C:\perl2\html\site\lib\Image\Magick.html
Installing C:\perl2\site\lib\Image\Magick.pm
Installing C:\perl2\site\lib\auto\Image\Magick\autosplit.ix

The I queried it using the "query" command...

H:\>ppm query Image-Magick
Image-Magick [0]

Also tried using the module (which should load the DLL you mentioned) with
no problems.

H:\>perl -e "use Image::Magick"

Rob



-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:48 PM
To: Beginners (E-mail)
Subject: Image::Magic / Perl::Magick 


I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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

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




utility to install modules

2004-08-25 Thread Joe Echavarria
hell there,

  I want to know if there is an utility that i could
use to install the perl modules directly from CPAN on
a sun solaris box.
  It is something like ppm on windows activeperl.

Thanks.



__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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




Re: utility to install modules

2004-08-25 Thread Jenda Krynicky
From: Joe Echavarria <[EMAIL PROTECTED]>
> hell there,

Yes there is. Quite often.

>   I want to know if there is an utility that i could
> use to install the perl modules directly from CPAN on
> a sun solaris box.
>   It is something like ppm on windows activeperl.

Yes there is. It's called cpan.

See
perldoc cpan

HTH, Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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




get last record in a file

2004-08-25 Thread loan tran
I would like to know if there is any way to process a
file using perl to get rid of extra records based on a
key value.
My key is the 1st field and in my output file I only
want 1 record per key and it has to be the last record
in the file. 

So for example here is my file:
1  5  4
1  0  2
1  2  2
2  0  2
3  0  3
3  4  6
And here is the output file I want:
1  2  2
2  0  2
3  4  6




___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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




Trouble installing Win32::API package with ppm on Windows

2004-08-25 Thread Bernie Davidovics
I am trying to install the Win32::API package on an Active state perl 
5.8.4 on windows

this worked on a win 2k box running 5.8.2
on 5.8.4 - get the following:
ppm> search Win32-API
1. Win32-API[0.41] Perl Win32 API Import Facility
2. Win32-API-OutputDebugString  [0.03] OutputDebugString Win32 API 
support
ppm> install 1
Error: no suitable installation target found for package Win32-API.
ppm>Repos
Repositories:
[1] ActiveState PPM2 Repository
[2] ActiveState Package Repository
[3] Calpini

Bernie


Re: get last record in a file

2004-08-25 Thread Gunnar Hjalmarsson
Loan Tran wrote:
I would like to know if there is any way to process a
file using perl to get rid of extra records based on a
key value.
My key is the 1st field and in my output file I only
want 1 record per key and it has to be the last record
in the file.
So for example here is my file:
1  5  4
1  0  2
1  2  2
2  0  2
3  0  3
3  4  6
And here is the output file I want:
1  2  2
2  0  2
3  4  6
As usual, use a hash:
my %hash;
while () {
my ($k, $v) = split ' ', $_, 2;
$hash{$k} = $v;
}
print "$_  $hash{$_}" for sort keys %hash;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-25 Thread JupiterHost.Net

Jenda Krynicky wrote:
From: "JupiterHost.Net" <[EMAIL PROTECTED]>
Is there an easy way to view the POD from a local module in a browser
to see what it will look like in CPAN?

I would generate the HTML file by the pod2html script and then look 
at the created file.

	pod2html --infile=The/Module.pm --outfile=The/Module.html
The trick is, if I do that the html is the pod for pod2html.
It doesn't seem to like .pm files, only .pod :(
I will continue to play around with it, thanks Jenda you rock as usual :)
You may need to play with the other options if the module docs try to 
reference other modules.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: utility to install modules

2004-08-25 Thread Owen
On Wed, 25 Aug 2004 14:54:58 -0700 (PDT)
Joe Echavarria <[EMAIL PROTECTED]> wrote:

> hell there,
> 
>   I want to know if there is an utility that i could
> use to install the perl modules directly from CPAN on
> a sun solaris box.
>   It is something like ppm on windows activeperl.


yes, it is inperldoc CPAN



Owen


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




Re: is possible start some actions with Perl without Cron?

2004-08-25 Thread Adam Rosi-Kessel
On Tue, Aug 24, 2004 at 03:59:57PM -0500, Errin Larsen wrote:
> As I understand what's going on, the Process (let's say PID=100)
> spawns a child with the fork() function (let's say PID=200).  This
> (200) is assigned to $pid in the parent, and zero (0) is assigned to
> $pid in the child.  So, what does "my $pid=fork()" resolve to in each
> case?  I'll assume that it resolves to the PID that fork returns.  So,
> in the parent, the statement resolves to 200 and the unless statement
> doesn't resolve.  In the child, the statement resolves to 0 and the
> unless statement DOES resolve.  So, the parent prints a message to
> STDOUT and quits, while the child keeps on running (in the little
> do/while loop) doing that stuff that's in there :)  

That sounds about right.  At the fork() call the program spawns into two
processes; the child gets 0 back from fork() (if it wants to know its own
pid, it can just look at $$) and the parent gets the child's pid back (in
case it wants to send signals to the child).  You'll notice a lot of
daemons store the child pid in /var/run, e.g., apache.pid, so when you
call the daemon script later it can send the proper signal to the
now-detached child.

Usually, you'll want to implement custom signal handling in the child
(i.e., local $SIG{HUP} = \&SomeCode).

> Ok ... so, um, why go through all this?  Why not just write your
> do/while block and just execute it in the background on the command
> line?  is fork() doing something else that helps a daemon that I'm not
> aware of?  

I guess primarily because you don't want your user to have to background
the task.  If you're writing a daemon script thats going to go in
/etc/init.d, it has to detach itself--the initscripts aren't going to
put it in the background for you.

If you background a task from the shell, then the shell will be its
parent.  If you detach a daemon like my code sample below, the parent
dies and the child is adopted by init (pid 1).  I can't think off the top
of my head why this is important, but it is a difference.

I think just as a matter of good programming style, if your program is
always suppose to background itself, you should have the program
background itself, rather than relying on the user to background it.

> On Sat, 21 Aug 2004 09:53:23 -0400, Adam Rosi-Kessel
> > Here's the skeleton of it:
> > 
> > 
> > unless (my $pid = fork()) {
> >   do {
> >  &SendEmailToUsers;
> >  sleep 3 * 24 * 60 * 60;
> >   } while (1);
> > }
> > 
> > print "Starting email daemon...\n";
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org

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




RE: Image::Magic / Perl::Magick

2004-08-25 Thread Brian Volk
Rob,

Did you have any problems installing PerlMagick?  Below is the error I
received.  Any suggestions?

Thanks again for your help.  ImageMagick is now working.

Brian


PPM> install PerlMagick
Install package 'PerlMagick?' (y/N): y
Installing package 'PerlMagick'...
Error installing package 'PerlMagick': Read a PPD for 'PerlMagick', but it
is no
t intended for this build of Perl (MSWin32-x86-multi-thread)

-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:39 PM
To: 'Brian Volk'; Beginners (E-mail)
Subject: RE: Image::Magic / Perl::Magick 


Maybe this will help... maybe it won't.

I just tried installing Image::Magick (on Win2K/AS perl 5.6.1 build 635),
and had no issues.  The install showed that it installed Magick.dll, and
where it was installed to.  Note that I used "Image-Magick", which is how AS
has it stored in the repository.

[session follows]
H:\>ppm install Image-Magick
Installing package 'Image-Magick'...
Downloading
http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr
ead/Image-Magick.tar.gz ...
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.bs
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.dll
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.exp
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.lib
Installing C:\perl2\html\site\lib\Image\Magick.html
Installing C:\perl2\site\lib\Image\Magick.pm
Installing C:\perl2\site\lib\auto\Image\Magick\autosplit.ix

The I queried it using the "query" command...

H:\>ppm query Image-Magick
Image-Magick [0]

Also tried using the module (which should load the DLL you mentioned) with
no problems.

H:\>perl -e "use Image::Magick"

Rob



-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:48 PM
To: Beginners (E-mail)
Subject: Image::Magic / Perl::Magick 


I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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

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




Re: get last record in a file

2004-08-25 Thread Jeremy Kister
On Wednesday, August 25, 2004 5:57 PM,  loan tran wrote:

> So for example here is my file:
> 1  5  4
> 1  0  2
> 1  2  2
> 2  0  2
> 3  0  3
> 3  4  6
> And here is the output file I want:
> 1  2  2
> 2  0  2
> 3  4  6

not extensively tested: 

#!/usr/local/bin/perl

open(F, "file.txt");
while(){
 chop(my $line = $_);
 my ($key) = $line =~ /^(\d)\s/;
 $hash{$key} = $line;
}
close F;

foreach my $value (values %hash){
   print "$value\n";
}

JeremyKister
http://jeremy.kister.net/


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




RE: Image::Magic / Perl::Magick

2004-08-25 Thread Brian Volk
Sorry for the fire alarm, I tried another demo script and it is working just
fine.  I must have typed something incorrectly.  Thanks again for your help.

Brian

-Original Message-
From: Brian Volk 
Sent: Wednesday, August 25, 2004 3:57 PM
To: 'Beginners (E-mail)'
Subject: RE: Image::Magic / Perl::Magick 


Rob, Thanks!

I changed my version of ActiveState perl from 5.8 to 5.6 and I am no longer
getting the error.  Thank you!  

Next question.. :-) 

I'm using the ImageMagick demo file to see how IM works, but nothing seems
to be happening.  The script is finishing fine, but the image file is not
being created.

Any suggestion?

Thanks,

Brian 

#!/usr/bin/perl -w
use strict;
use Image::Magick;

my $image = Image::Magick->new(magick=>'JPEG');

my $x = $image->Read('H:/bvolk/My Pictures/Sylvania/L10119.gif');

$x = $image->Set(magick => 'JPG');
$x = $image->Write('C:/perl/bin/output/brian.jpg');

exit(); 

-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:39 PM
To: Brian Volk; Beginners (E-mail)
Subject: RE: Image::Magic / Perl::Magick 


Maybe this will help... maybe it won't.

I just tried installing Image::Magick (on Win2K/AS perl 5.6.1 build 635),
and had no issues.  The install showed that it installed Magick.dll, and
where it was installed to.  Note that I used "Image-Magick", which is how AS
has it stored in the repository.

[session follows]
H:\>ppm install Image-Magick
Installing package 'Image-Magick'...
Downloading
http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr
ead/Image-Magick.tar.gz ...
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.bs
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.dll
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.exp
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.lib
Installing C:\perl2\html\site\lib\Image\Magick.html
Installing C:\perl2\site\lib\Image\Magick.pm
Installing C:\perl2\site\lib\auto\Image\Magick\autosplit.ix

The I queried it using the "query" command...

H:\>ppm query Image-Magick
Image-Magick [0]

Also tried using the module (which should load the DLL you mentioned) with
no problems.

H:\>perl -e "use Image::Magick"

Rob



-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:48 PM
To: Beginners (E-mail)
Subject: Image::Magic / Perl::Magick 


I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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


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



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




Re: get last record in a file

2004-08-25 Thread Jeremy Kister
On Wednesday, August 25, 2004 6:15 PM, I wrote:
> not extensively tested: 
 
 this is a bit more tested:
 
#!/usr/local/bin/perl

open(F, "file.txt");
while(){
 chomp(my $line = $_);
 my ($key) = $line =~ /^(\S+)\s/;
 $hash{$key} = $line;
}
close F;

foreach my $value (values %hash){
   print "$value\n";
}

Jeremy Kister
http://jeremy.kister.net/

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




RE: Image::Magic / Perl::Magick

2004-08-25 Thread Brian Volk
Rob, Thanks!

I changed my version of ActiveState perl from 5.8 to 5.6 and I am no longer
getting the error.  Thank you!  

Next question.. :-) 

I'm using the ImageMagick demo file to see how IM works, but nothing seems
to be happening.  The script is finishing fine, but the image file is not
being created.

Any suggestion?

Thanks,

Brian 

#!/usr/bin/perl -w
use strict;
use Image::Magick;

my $image = Image::Magick->new(magick=>'JPEG');

my $x = $image->Read('H:/bvolk/My Pictures/Sylvania/L10119.gif');

$x = $image->Set(magick => 'JPG');
$x = $image->Write('C:/perl/bin/output/brian.jpg');

exit(); 

-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:39 PM
To: Brian Volk; Beginners (E-mail)
Subject: RE: Image::Magic / Perl::Magick 


Maybe this will help... maybe it won't.

I just tried installing Image::Magick (on Win2K/AS perl 5.6.1 build 635),
and had no issues.  The install showed that it installed Magick.dll, and
where it was installed to.  Note that I used "Image-Magick", which is how AS
has it stored in the repository.

[session follows]
H:\>ppm install Image-Magick
Installing package 'Image-Magick'...
Downloading
http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr
ead/Image-Magick.tar.gz ...
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.bs
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.dll
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.exp
Installing C:\perl2\site\lib\auto\Image\Magick\Magick.lib
Installing C:\perl2\html\site\lib\Image\Magick.html
Installing C:\perl2\site\lib\Image\Magick.pm
Installing C:\perl2\site\lib\auto\Image\Magick\autosplit.ix

The I queried it using the "query" command...

H:\>ppm query Image-Magick
Image-Magick [0]

Also tried using the module (which should load the DLL you mentioned) with
no problems.

H:\>perl -e "use Image::Magick"

Rob



-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 12:48 PM
To: Beginners (E-mail)
Subject: Image::Magic / Perl::Magick 


I've asked this question on the ImageMagick bugs mailing list...w/ no reply.
If anyone has any suggestion, I would greatly appreciate it.  
I have both ImageMagick and PerlMagick installed. I can view pictures fine
w/ ImageMagick,  I just can't use the Image::Magick module...  Do I have the
modules installed correctly?  I let the ImageMagick software install them.
I checked ppm> but I didn't see them installed.  Was I doing something
wrong?  ppm> search Image::Magick ...ppm returned no match.  Same w/
PerlMagick.  
Is there another way to check the ppm?

- 
C:\Program Files\ImageMagick-6.0.5-Q16\PerlMagick\demo>perl shapes.pl 
Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Mag 
ick: load_file:One of the library files needed to run this application
cannot be 
found at C:/Perl/lib/DynaLoader.pm line 229. 
at shapes.pl line 4 
Compilation failed in require at shapes.pl line 4. 
BEGIN failed--compilation aborted at shapes.pl line 4. 

- 

Thanks in advance! 

Brian 
[EMAIL PROTECTED] 



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


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



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




FW: ppm Error: nosuitable installation target found for package Win32-API

2004-08-25 Thread Harry Johnson



-Original Message-
From: Harry Johnson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 25, 2004 1:25 PM
To: [EMAIL PROTECTED]
Subject: ppm Error: nosuitable installation target found for package
Win32-API


Can anyone explain this ppm3 error ?  The commands worked yesterday on a
Windows 2K machine.  Similar machine today gets the following...

ppm> search Win32-API
1. Win32-API[0.41] Perl Win32 API Import Facility
2. Win32-API-OutputDebugString  [0.03] OutputDebugString Win32 API support
ppm> install 1
Error: no suitable installation target found for package Win32-API.
ppm>Repos
Repositories:
[1] ActiveState PPM2 Repository
[2] ActiveState Package Repository
[3] Calpini

Note: Calpini is http://dada.perl.it/ I added it.



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




Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-25 Thread JupiterHost.Net

[EMAIL PROTECTED] wrote:
Well I don't know if it is possible, however the POD::HTML module is
very skimpy on documentation, so try this one instead.
http://search.cpan.org/~sburke/Pod-Simple-3.02/lib/Pod/Simple/HTML.pm
it appears to be very easy to use, however I cannot test.
Just give it a try and if you have problems then mail the list, but most
people don't want to help someone that hasn't even tried yet.
I understand, however I did try it and posted all my code last week in
this thread and no one said a word so I figured I'd simplify my question :)
I'll see if I can't get the Pod::Simple::HTML one to do it :)
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: utility to install modules

2004-08-25 Thread Chris Devers
On Wed, 25 Aug 2004, Joe Echavarria wrote:
 I want to know if there is an utility that i could
use to install the perl modules directly from CPAN on
a sun solaris box.
 It is something like ppm on windows activeperl.
You seem to be thinking of the CPAN shell.
Run this command to set it up:
perl -MCPAN -e shell
You will need root / sudo access to run this. The first time you run it, 
you will spend five minutes or so answering questions about your setup; 
in most cases the defaults will be fine, but if you're asked if you want 
to upgrade Perl itself, *don't* let it -- there's a bug in some old 
versions of CPAN.pm that will make a royal mess if you let it do this.

Once the CPAN shell is set up, you can just do things like this:
perl -MCPAN -e 'install Bundle::Whatever'
or
$ sudo perl -MCPAN -e shell
cpan> install Bundle::Whatever
etc.
Very useful...

--
Chris Devers  [EMAIL PROTECTED]
http://devers.homeip.net:8080/blog/
np: 'C'Era Una Volta Il West - Titoli'
 by Ennio Morricone
 from 'Le Colonne Sonore Originali Dei Film Di Sergio Leone'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: get last record in a file

2004-08-25 Thread balaji venkat
The following code will do the required task.

#! /usr/bin/perl

open (FILE,"test789.pl");
@array1 = ;
$last = pop(@array1);
print $last;


 --- Jeremy Kister
<[EMAIL PROTECTED]> wrote: 
> On Wednesday, August 25, 2004 6:15 PM, I wrote:
> > not extensively tested: 
>  
>  this is a bit more tested:
>  
> #!/usr/local/bin/perl
> 
> open(F, "file.txt");
> while(){
>  chomp(my $line = $_);
>  my ($key) = $line =~ /^(\S+)\s/;
>  $hash{$key} = $line;
> }
> close F;
> 
> foreach my $value (values %hash){
>print "$value\n";
> }
> 
> Jeremy Kister
> http://jeremy.kister.net/
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
>  





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

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




RE: get last record in a file

2004-08-25 Thread Tim Johnson
Another way to go:
 
my $lastline;
open(FILE,"test789.pl") || die "Couldn't open \"test789.pl\" for reading!\n";
while(){
   $lastline = $_;
}
print "\"$lastline\"\n is the last line.\n";

-Original Message- 
From: balaji venkat [mailto:[EMAIL PROTECTED] 
Sent: Wed 8/25/2004 8:56 PM 
To: Jeremy Kister; [EMAIL PROTECTED] 
Cc: 
Subject: Re: get last record in a file



The following code will do the required task.

#! /usr/bin/perl

open (FILE,"test789.pl");
@array1 = ;
$last = pop(@array1);
print $last;


 --- Jeremy Kister
<[EMAIL PROTECTED]> wrote:
> On Wednesday, August 25, 2004 6:15 PM, I wrote:
> > not extensively tested:
> 
>  this is a bit more tested:
> 
> #!/usr/local/bin/perl
>
> open(F, "file.txt");
> while(){
>  chomp(my $line = $_);
>  my ($key) = $line =~ /^(\S+)\s/;
>  $hash{$key} = $line;
> }
> close F;
>
> foreach my $value (values %hash){
>print "$value\n";
> }
>
> Jeremy Kister
> http://jeremy.kister.net/
>
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
>
>
> 


   
   
   
___ALL-NEW Yahoo! 
Messenger - all new features - even more fun!  http://uk.messenger.yahoo.com

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






Re: get last record in a file

2004-08-25 Thread John W. Krahn
loan tran wrote:
I would like to know if there is any way to process a
file using perl to get rid of extra records based on a
key value.
My key is the 1st field and in my output file I only
want 1 record per key and it has to be the last record
in the file. 

So for example here is my file:
1  5  4
1  0  2
1  2  2
2  0  2
3  0  3
3  4  6
And here is the output file I want:
1  2  2
2  0  2
3  4  6
This will do what you want:
#!/usr/bin/perl
use warnings;
use strict;
my %last;
while (  ) {
my $key = ( split )[ 0 ];
if ( not exists $last{ $key } ) {
print values %last;
%last = ( $key, $_ );
}
elsif ( eof DATA ) {
print;
}
else {
$last{ $key } = $_;
}
}
__DATA__
1  5  4
1  0  2
1  2  2
2  0  2
3  0  3
3  4  6

John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Log::Log4perl and Log::Dispatch::Email

2004-08-25 Thread Christopher J. Bottaro
hello,
i'm having trouble understanding how to make an appender send an email? 
appearently, i'm suppose to make an appender based on
Log::Dispatch::Email*.  the problem is which one?  there are 4:

Log::Dispatch::Email
Log::Dispatch::Email::MailSendmail
Log::Dispatch::Email::MailSender
Log::Dispatch::Email::MailSend

also, how am i suppose to specify which smtp server to use?

from the man page of Log::Dispatch::Email::MailSend:
"Since Mail::Send is a subclass of Mail::Mailer, you can change how mail is
sent from this module by simply useing Mail::Mailer in your code before
mail is sent. For example, to send mail via smtp, you could do:
use Mail::Mailer 'smtp', Server => 'foo.example.com';"

well that doesn't compile in my code.  and furthermore it doesn't seem
clean.  when if i want multiple email appenders, using different smtp
servers?

i looked around the source code, and i saw Mail::Mailer's (which
Log::Dispatch::Email::MailSend is derived from) constructor takes a scalar
then a hash of arguments.  well that scalar allows you specify smtp.  the
problem is that Log::Log4perl::Appender's constructor provides no mechanism
for specifying that scalar when it constructs an instance of
Log::Dispatch::Email::MailSend.

this is all so confusing...why don't they give concrete examples in the
Log::Log4perl documentation?  arg.

thanks for the help.


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




Re: Help With OLE

2004-08-25 Thread Colm Gallagher
Hi David,

First post to this list, so hi folks, pleasure to meet you all.

To get the text (i..e showing currency symbols etc.)  out of a field
instead of the numeric value, use the Text property instead of Value
property.

sub toLetter {
return chr(64+$_[0]);
}
$ReadData = $ReadSheet->Range(&toLetter($LastCol).'1')->{Value};
print "$ReadData\n";
my $ReadData = $ReadSheet->Range(&toLetter($LastCol).'1')->{Text};
print "$ReadData\n";

On another note, I couldn't get your sample code to work because
$LastCol was returning as a number, not a column letter reference, so
I knocked together a quick and dirty converter - you may need to
expand this slightly to handle AA etc, or post back to let me know how
you do cell referencing.

I learned from your code how to use named parameters with OLE, so thanks!
i.e.SearchDirection=>xlPrevious,

--
Colm Gallagher

On Wed, 25 Aug 2004 15:41:00 -0400, DiGregorio, Dave
<[EMAIL PROTECTED]> wrote:
> Hey All,
> 
>So I am building this app that parses and Excel spreadsheet for
> a value based on the last column in the file.  But, I seam to return the
> Numeric value as opposed to the Alpha Value.  Is there an easy way to get
> around this??
> 
> $LastCol = $ReadSheet->UsedRange->Find({What=>"*",
> 
>SearchDirection=>xlPrevious,
> 
>SearchOrder=>xlByColumns})->{Column};
> 
> print "$LastCol\n" ;
> 
> $ReadData = $ReadSheet->Range($LastCol.'4')->{Value} ;
> 
> Thanks
> 
> David R. DiGregorio
> 
> 703 Rodi Road
> 
> Pittsburgh, PA 15235
> 
> p. 412-349-2440
> 
> [EMAIL PROTECTED]
> 
> 


-- 
Colm

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




how can I |more output.

2004-08-25 Thread Etienne Ledoux
Greetings,

I have a program that does a search on a db and prints the output to the 
screen. If there is a lot of output how can I a stop/continue displaying it. 
like 'ls -l |more' would do. or anything |more for that matter.

tx

e.

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