Delivering Graphics over HTTP

2003-02-28 Thread Nigel Peck - MIS Web Design
I need to deliver graphic files (jpg and gif) over http in the same manner
that a web server would. Can anyone point me in the right direction? Setting
the mime type is no problem but it's the rest that I have no experience of.
In the past I've always simply done a location: /path/to/graphic but the
graphics are getting cached somewhere along the line so I need to set
Cache-control: no-cache and the only way I can think of to do this is if my
script does the delivery itself.

I don't have access to the configuration of the web server. Unless it
possible to do it in .htaccess?

I tried the following in .htaccess but no joy, is there a better way of
doing this with .htaccess? Possibly at HTTP 1.0 server somewhere in the
chain is preventing it from working?


  Header add Cache-Control "no-cache"



  Header add Cache-Control "no-cache"


TIA

Nigel


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



RE: what is this error?

2003-02-28 Thread Dilip v
when I do "set JDK122ROOT=/jdk1.2.2" & then run my
command for loading data it gives following error


/jdk1.2.2/bin/jdb.exe does't exist. Exiting...

If I do "set JDK122ROOT=c/jdk1.2.2

c/jdk1.2.2/bin/jdb.exe does't exist. Exiting..

whereas jdb.exe is present in the above folder

There is one more  folder containing jdb.exe created
by my application which also has jdb.exe I tried that
also again same result
set JDK122ROOT=e:/jre/NT/1.2.2

e:/jre/NT/1.2.2/bin/jdb.exe does't exist. Exiting...

Dilip
-Original Message-
From: R. Joseph Newton [mailto:[EMAIL PROTECTED]
Sent: 28 February 2003 06:57
To: Dilip v
Cc: [EMAIL PROTECTED]
Subject: Re: what is this error?


Dilip v wrote:

> Hi all,

> Try 'set
> JDK122ROOT=/jdk1.2.2' at bin/perl/RunJava.pm line
305.
>   ...
> Try \'set JDK122ROOT=/jdk1.2.2\' at b...') called at
> bin/perl/RunJava.pm line 305

What happened when you followed the advice offered
above?

Joseph




__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



Tieregistry etc on unix server ? possible

2003-02-28 Thread Pradeep Goel
Hi All

Can win32::Tieregistry ( & other win32 modules) be installed on unix boxes

i .e a program that takes information from many remote  windows machines etc 
be reside on a unix server ?

any script examples are most welcome 

Regards & Thanks 
Pradeep 




Re: Perl Application error on windows

2003-02-28 Thread Jenda Krynicky
From: "R. Joseph Newton" <[EMAIL PROTECTED]>
> Madhu Reddy wrote:
> 
> > Hi,
> >   I have following sorting program...
> > basically it will split the large files into small
> > file and creates thread..each thread will sort files
> > after that merge back all sorted files...
> >
> > this program works fine on single CPU machine...
> > same program giving problem on 8 CPU machine...
> >
> It could be that the primary thread goes on to:
> 
> $_->join for(@threads);
> my_print("Sorting completed, merging started\n");
> 
> Before the first sort_it thread returns.  Or the first thread moves on
> before the others finish.  I don't know the fine points of Perl
> threads, but I don't see anything explicitly telling the application
> to wait for all threads to complete.

The ->join waits.
$thread->join() means wait for the $thread to complete and reap it.


From: Madhu Reddy <[EMAIL PROTECTED]>
>   I have following sorting program...
> basically it will split the large files into small
> file and creates thread..each thread will sort files 
> after that merge back all sorted files...
> 
> this program works fine on single CPU machine...
> same program giving problem on 8 CPU machine...
> 
> the problem is , after creating the thread
> one of the thread finishes the job...
> all other threads are still working
> 
> as soon as one thread finishes the job, i am getting 
> perl application error (pops up small window)
> popup window contains following message...
> 
> ==
> perl.exe application errorr
> 
> The instruction at "0x2808335c" referenced memory at 
> "0x0004". The memory couldn't be written
> 
> ===

It seems you use a module that was not made thread safe.
Since you see this when a thread finishes I'd think this is caused by 
some object destruction. It seems that some object is DESTROYed and 
it destroys some shared data.

If you create some objects before the thread creation you may want to 
try to bless() them into a different package to prevent the normal 
DESTROY.

You may either do

@Fake::Object::Class::ISA = qw(Object::Class);
sub Fake::Object::Class::DESTROY {}
bless $object, 'Fake::Object::Class';

as soon as possible in each thread or

bless $object, 'Do not destroy';

before the thread finishes.
It's safer to do the first.

You may also try to pospone loading of some modules AFTER you create 
the threads. So that each thread loads the module separately. 
Sometimes this helps.

Jenda
P.S.: You may want to look at http://Jenda.Krynicky.cz/iThreads.html
It was written in the 5.6.1 times (threads crated by fork()), but it 
stil contains usefull info. IMHO :-)
= [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: Tieregistry etc on unix server ? possible

2003-02-28 Thread Beau E. Cox
Hi -

> -Original Message-
> From: Pradeep Goel [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 11:09 PM
> To: [EMAIL PROTECTED]
> Subject: Tieregistry etc on unix server ? possible
>
>
> Hi All
>
> Can win32::Tieregistry ( & other win32 modules) be installed on unix boxes
>
> i .e a program that takes information from many remote  windows
> machines etc
> be reside on a unix server ?
>
> any script examples are most welcome
>
> Regards & Thanks
> Pradeep
>

As far as I know the Win32 modules are interfaces for
system calls/subsystems that exist ONLY on Windows
(hence the name). For example the Win32::TieRegistry
module allows you to query and manipulate the
_Windows_ registry, which does *not* exist on Unix/Linux.

I think you are out of luck...when you use a Win32 module
you loose Perl's portability; to reclaim it you must
conditionally code equivalent functionally for non-Windows
OSs.

If your target environment is guaranteed to be Windows,
all is well, otherwise there is a lot of work to do... :)

Aloha => Beau;



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



Perl version of xcopy on Win32?

2003-02-28 Thread Scott Ellis
Hi,

I've searched far and wide for this with no success. Is there a win32 perl module with 
the same functionality as the win32 'xcopy' command, i.e. that will recursively copy a 
directory structure from one place to another?

Thanks,

Scott



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



Re: dynamic arrays

2003-02-28 Thread Edmund
John W. Krahn wrote:
Cc wrote:

Hi,


Hello,


I'm a beginner at PERL.  I've used it on and off, but only
just recently got myself back into the picture.  I figured
that if you forget something in PERL, it'd be easy to take
it up again.  So far, I'm not too sure of the ease
of taking up PERL again.  Before, I made a few perl scripts.
Now, when I look back, I find the whole thing overwhelming.
Even with comments...Anyway, I digress..
I have a text file with each line of the following format:

string1  string2  val1 val2 val3

I'm trying to read it into an array of arrays so I can
stick it in the creategraph() function to create a  line
graph.
So far, if I specifically create an array constant:

ie.

my(@data) = ( ["test 1",0.34,0.56,0.33],
["test 2",0.44,0.55,0.22],
 ["final test",0.67,0.22,0.54])
my($grp) = new GD::Graph::linespoints();

and then put that in the $grp->plot([EMAIL PROTECTED]) function, I get
a graph.
But, if I use the following code:

while (){
  chomp($_);
  @info = split(" ",$_);
  my($strngval) = "\"$info[0] $info[1]\"";
  $strval = "$strval,$strngval";
  $m1vals = "$m1vals,$info[2]";
  $m2vals = "$m2vals,$info[3]";
}


From your description, you probably want something like this:

my @data;

while (  ) {
my ( $str1, $str2, @info ) = split;
push @data, [ "$str1 $str2", @info ];
}
I just realized that I had actually seperated the data
into homogenous arrays; that is, one array carries all
the string values, one  consists of one set of values,
and the last array consisting of the maximum values.
I'm beginning to understand where I goofed.
You could use the Data::Dumper module to display the contents of @data:

use Data::Dumper;

print Dumper( [EMAIL PROTECTED] );
Thanks for the help!  Very much appreciated.

Edmund

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


Re: dynamic arrays

2003-02-28 Thread Edmund
Sudarshan Raghavan wrote:
Yes, @data is just an array not an array of arrays. 
Does this do what you want?

# CODE START #
my @data;
while () {
my @info = split;
push (@data, ["$info[0] $info[1]", @info[2..$#info]]);
}
# CODE END #
I'll change my code to see.   But it certainly looks complicated.

You might also want to take a look at the Data::Dumper module to make sure 
your array of arrays is formed correctly.
perldoc Data::Dumper



Thanks for the pointers..

Edmund

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


RE: Perl version of xcopy on Win32?

2003-02-28 Thread Beau E. Cox
Hi -
> -Original Message-
> From: Scott Ellis [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 11:15 AM
> To: [EMAIL PROTECTED]
> Cc: Scott Ellis
> Subject: Perl version of xcopy on Win32?
> 
> 
> Hi,
> 
> I've searched far and wide for this with no success. Is there a 
> win32 perl module with the same functionality as the win32 
> 'xcopy' command, i.e. that will recursively copy a directory 
> structure from one place to another?
> 
> Thanks,
> 
> Scott
> 

Although not just for Win32, have you looked at File::NCopy =>

http://search.cpan.org/author/ERIC/OpenThought-0.63/inc/File/NCopy.pm

I haven't used it, but a quick glance at the documentation
leads me to believe that it might work for you.

Aloha => Beau;


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



execute external program in sever/client enviroment via open

2003-02-28 Thread Roman Mikus
hi all,

I've problem with executing an external program in my perl program. I'm trying to 
build an server for managing pop3 accounts to which I can connect for example via php 
sockets.

For server/client enviroment I'm using Net::Server perl module. Everything works all 
right, until I need to run external 'pw' script. Then client connection to my server 
closes without any errors messages.

If I use the same code (specified below) in my simple test file everything works. 

This code is specified in child process of my server, which is created after 
connection to it (in 'process_request' subroutine of Net::Server::Fork module).

Here is the problematic part of code:


$tmp = "$pw_path useradd";
$tmp .= " -n " . $username;
$tmp .= " -q -m -s " . $shell;
$tmp .= " -h 0";

if( defined(open(PW,"| $tmp")) ) {  # here client closes the connection
print PW $password, "\n";
close PW or warn "$pw_path exited on $?: $!";
} else {
print "$pw_path failure: $! ($?)";
}
1;

'pw' script needs some command line arguments defined in variable $tmp which is passed 
to open.
'-h 0' argument make pw to wait for password to be specified on standart input, so I 
need build an pipe to it.

I'm running FreeBSD 4.7 with perl 5.005_03 and Net-Server-0.83.


Pease help me to figure what I have done wrong. 
Thank you.

roman





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



Re: help to newbie

2003-02-28 Thread Janek Schleicher
On Thu, 27 Feb 2003 16:55:14 +0100, Alexander wrote:

> regexp for
> 3 digits optional "," and if there is a comma 2 digits

Following this description, it's
/\d\d\d(,\d\d)?/

> I've tried this but it simply didn't work "\\d{1,3}[.,]?\\d{0,2}"

while seeing this one, it could be you meant:

/\d{1,3}([.,]\d{0,2})?/


However, there are two main problems in your trial:
First it seems to be wrong to escape the backslash,
as \\d is very different from \d.
Second, the optional , followed (if necessary) by digits is best expressed
completely as one optional group ([.,]\d{0,2})?


Best Wishes,
Janek

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



RE: execute external program in sever/client enviroment via open

2003-02-28 Thread Dan Muey
> hi all,
> 
> I've problem with executing an external program in my perl 
> program. I'm trying to build an server for managing pop3 
> accounts to which I can connect for example via php sockets.
> 
> For server/client enviroment I'm using Net::Server perl 
> module. Everything works all right, until I need to run 
> external 'pw' script. Then client connection to my server 
> closes without any errors messages.
> 
> If I use the same code (specified below) in my simple test 
> file everything works. 
> 
> This code is specified in child process of my server, which 
> is created after connection to it (in 'process_request' 
> subroutine of Net::Server::Fork module).
> 
> Here is the problematic part of code:
> 
> 
> $tmp = "$pw_path useradd";
Is $pw_path the entire path or relative.
I've found on my freebsd box that I had to have the entire path to htpasswd to modift 
.htpasswd files.

Not sure if pw is the same as passwd in the sense that :
1) Unless you're root passwd changes the current user's passwd only, so you may be 
trying to change nobody or www password
2) Even if the script is running setuid you would still be changing only the script's 
owner's password.
But if it is then the script may be trying to change a passord it has no permission to.
FreeBSd is great about security and it wouldn't be too secure to let one script change 
everyone's passwords  via some evil troll.

> $tmp .= " -n " . $username;
> $tmp .= " -q -m -s " . $shell;
> $tmp .= " -h 0";
> 
> if( defined(open(PW,"| $tmp")) ) {  # here client 
> closes the connection
> print PW $password, "\n";
> close PW or warn "$pw_path exited on $?: $!";
> } else {
> print "$pw_path failure: $! ($?)";
> }
> 1;

What's the one for, is this in a library?

> 
> 'pw' script needs some command line arguments defined in 
> variable $tmp which is passed to open. '-h 0' argument make 
> pw to wait for password to be specified on standart input, so 
> I need build an pipe to it.
> 
> I'm running FreeBSD 4.7 with perl 5.005_03 and Net-Server-0.83.
> 
> 
> Pease help me to figure what I have done wrong. 
> Thank you.
> 
> roman
> 
> 
> 
> 
> 
> -- 
> 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: Perl version of xcopy on Win32?

2003-02-28 Thread Dan Muey
http://search.cpan.org

Look at the File modules.
Not sure about an exact command named xcopy but I'm 
sure there the same functionality somewhere.

Dan Muey

> -Original Message-
> From: Scott Ellis [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 3:15 PM
> To: [EMAIL PROTECTED]
> Cc: Scott Ellis
> Subject: Perl version of xcopy on Win32?
> 
> 
> Hi,
> 
> I've searched far and wide for this with no success. Is there 
> a win32 perl module with the same functionality as the win32 
> 'xcopy' command, i.e. that will recursively copy a directory 
> structure from one place to another?
> 
> Thanks,
> 
> Scott
> 
> 
> 
> -- 
> 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: parsing uploaded csv file from HTTP

2003-02-28 Thread Janek Schleicher
On Wed, 26 Feb 2003 17:34:10 +1100, Clinton wrote:

> I'm trying to parse an uploaded csv file. From the HTTP info I have a string
> that looks like this
> ...
> Unfortunately if the CSV file has punctuation (Wilfred De'Silva) everything
> falls in a heap.
> How can I pull out the data without relying on  $2 ([\w+\,\w+\s\w+\r\n]+)
> which seems to be the bit that grabs the CSV values

Don't reinvent the wheel.
I would suggest to use an existing module,
e.g.
Text::CSV
Text::CSV_XS
Tie::CSV_File


Greetings,
Janek

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



RE: Delivering Graphics over HTTP

2003-02-28 Thread Dan Muey
I assume what you're trying to do is have in your html


And maybe except paramkaters and display accordingly?

If so all you need to remember is to print the proper headers and don't try to print 
and text.

#!/usr/bin/perl

use File::Slurp;
use CGI qw/:standard/;
 
print header("image/gif");
print read_file("/path/to/img.gif");


Of course you can do all kinds of things like check for 
errors modify the images using various image modules display different images based on 
inout, etc, etc

DMuey

> 
> I need to deliver graphic files (jpg and gif) over http in 
> the same manner that a web server would. Can anyone point me 
> in the right direction? Setting the mime type is no problem 
> but it's the rest that I have no experience of. In the past 
> I've always simply done a location: /path/to/graphic but the 
> graphics are getting cached somewhere along the line so I need to set
> Cache-control: no-cache and the only way I can think of to do 
> this is if my script does the delivery itself.
> 
> I don't have access to the configuration of the web server. 
> Unless it possible to do it in .htaccess?
> 
> I tried the following in .htaccess but no joy, is there a 
> better way of doing this with .htaccess? Possibly at HTTP 1.0 
> server somewhere in the chain is preventing it from working?
> 
> 
>   Header add Cache-Control "no-cache"
> 
> 
> 
>   Header add Cache-Control "no-cache"
> 
> 
> TIA
> 
> Nigel
> 
> 
> -- 
> 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: Mail::sendmail

2003-02-28 Thread Dan Muey
> 
> Steve Few wrote:
> > Hi guys,
> > 
> > I tried to send this little test script, but my error at my 
> NT command
> > line was,
> > 
> >   "cant' locate Mail::Sendmail.pm in @inc (@inc contains d:/perl/lib
> > D:/perl/site/lib at   sendmail.pl at line 3".
Maybe I'm missing a previous thread but this usually means that 
1) the module is not installed 
2) You've misspelled the installe dmodule by accident.

DMuey

> > 
> > The *.pl below is sendmail.pl.
> > 
> > Any suggestions? I use Netscape, ActivePerl 5.8, NT.
> > 
> > Thanks,
> > Steve Few
> > NC DENR
> > [EMAIL PROTECTED]
> > 
> > 
> > -- sendmail.pl - 
> > #!/usr/bin/perl -w #Or Mail::Sendmail, which can be used 
> like this: ;
> >  use Mail::Sendmail;
> >%mail = ( To  => '[EMAIL PROTECTED]',
> > From=> '[EMAIL PROTECTED]',
> > Message => "This is a minimalistic message -- from
> > [EMAIL PROTECTED]"
> >  );
> > if (sendmail %mail) { print "Mail sent OK.\n" }
> > else { print "Error sending mail: $Mail::Sendmail::error \n"
> > }
> > 
> > exit;
> 
> Steve,
>   Took exactly what you have and changed to me and it 
> went like you would have expected.  I am running on w2k, AS 
> 5.6.0. A liitle older, but should work.  You have checked 
> that it is loaded? 
> 
> Wags ;)
> 
> 
> **
> This message contains information that is confidential
> and proprietary to FedEx Freight or its affiliates.
> It is intended only for the recipient named and for
> the express purpose(s) described therein.
> Any other use is prohibited.
> 
> 
> 
> -- 
> 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: execute external program in sever/client enviroment via open

2003-02-28 Thread Roman Mikus
hello,

- $pw_path contains the absolute path to pw: /usr/sbin/pw
- I run server as root, if I try to print $< in program it returns 0 which is ok, so 
privileges should be ok
- one on the end isn't important - it's just for setting an return value from 
subroutine

As I write, code should be ok, because if I run it allone, outside my program it 
works. I think there is maybe some restrictions which I don't know, for example under 
fork I can't execute external command, or when I use strict mode I can't run it or 
something similar.

- I did mistake in comment of code.. of course server closes connection, not client. 
I'm testing my server by telneting to its port.

anyway thank you for your answer.

roman

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:22 PM
To: Roman Mikus; [EMAIL PROTECTED]
Subject: RE: execute external program in sever/client enviroment via
open


> hi all,
> 
> I've problem with executing an external program in my perl 
> program. I'm trying to build an server for managing pop3 
> accounts to which I can connect for example via php sockets.
> 
> For server/client enviroment I'm using Net::Server perl 
> module. Everything works all right, until I need to run 
> external 'pw' script. Then client connection to my server 
> closes without any errors messages.
> 
> If I use the same code (specified below) in my simple test 
> file everything works. 
> 
> This code is specified in child process of my server, which 
> is created after connection to it (in 'process_request' 
> subroutine of Net::Server::Fork module).
> 
> Here is the problematic part of code:
> 
> 
> $tmp = "$pw_path useradd";
Is $pw_path the entire path or relative.
I've found on my freebsd box that I had to have the entire path to htpasswd to modift 
.htpasswd files.

Not sure if pw is the same as passwd in the sense that :
1) Unless you're root passwd changes the current user's passwd only, so you may be 
trying to change nobody or www password
2) Even if the script is running setuid you would still be changing only the script's 
owner's password.
But if it is then the script may be trying to change a passord it has no permission to.
FreeBSd is great about security and it wouldn't be too secure to let one script change 
everyone's passwords  via some evil troll.

> $tmp .= " -n " . $username;
> $tmp .= " -q -m -s " . $shell;
> $tmp .= " -h 0";
> 
> if( defined(open(PW,"| $tmp")) ) {  # here client 
> closes the connection
> print PW $password, "\n";
> close PW or warn "$pw_path exited on $?: $!";
> } else {
> print "$pw_path failure: $! ($?)";
> }
> 1;

What's the one for, is this in a library?

> 
> 'pw' script needs some command line arguments defined in 
> variable $tmp which is passed to open. '-h 0' argument make 
> pw to wait for password to be specified on standart input, so 
> I need build an pipe to it.
> 
> I'm running FreeBSD 4.7 with perl 5.005_03 and Net-Server-0.83.
> 
> 
> Pease help me to figure what I have done wrong. 
> Thank you.
> 
> roman
> 
> 
> 
> 
> 
> -- 
> 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: grabbing mime type

2003-02-28 Thread Dan Muey

> 
> If this is a proper mail , why dont you use ready Mail Parsers 
> MIME::Parser for one ( excellent module )

I have looked at it but am still unable to get my little brain figuring it out.
Here is what I gathered via CPAN but an uncertain as to whether I'm looking at it right
And , if I am, where to go next ::
I have 3 questions in the code below, any input would be most appreciated

Thanks

Dan

use MIME::Parser;

my $parser = new MIME::Parser;

$parser->output_to_core(1); # 1) do I need this set to true to be able to get the 
result into a variable ??

# 2) these are set to true to avoid using memory instead of disk right??
$parser->tmp_recycling(1);   
$parser->tmp_to_core(1);   
$parser->use_inner_files(1);   

$entity = $parser->parse_data([EMAIL PROTECTED]); # where @lines contains the headless 
body from Mail::Internet in the previous post
 
# 3) so now what do i do eith $entity to actually set the text/plain part to a 
variable ??

> 
> Ram
> 
> 
> -- 
> 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]



[Fwd: ezmlm response] Remove request

2003-02-28 Thread Justin Cameron
 Pardon for the OT post, but would the list admin kindly remove me from 
this mailing list.  I'm having no luck with the autoresponder.

- Justin Cameron

 Original Message 
Subject: ezmlm response
Date: 28 Feb 2003 15:22:27 -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]


Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.
I'm working for my owner, who can be reached
at [EMAIL PROTECTED]
I'm sorry, I've been unable to carry out your request,
since the address
  [EMAIL PROTECTED]

was not on the beginners mailing list when I received
your request and is not a subscriber of this list.
If you unsubscribe, but continue to receive mail, you're subscribed
under a different address than the one you currently use.
Please look at the header for:
'Return-Path: '

This shows that the subscription address is [EMAIL PROTECTED]''.
The unsubscribe address for this user would be:
'[EMAIL PROTECTED]'.
Just mail to that address, adjusted for the real subscription address.

If the message has a ``List-Unsubscribe:'' header, you can send
a message to the address in that header. It contains the subscription
already coded into it.
For some mail programs, you need to make the headers visible to
see the return path:
For Eudora 4.0, click on the "Blah blah ..." button.
For PMMail, click on "Window->Show entire message/header". 

If this still doesn't work, I'm sorry to say that I can't help you.
Please FORWARD a list message together with a note about what you're
trying to achieve and a list of addresses that you might be subscribed
under to my owner:
   

who will take care of it. My owner is a little bit slower than I am, 
so please be patient.

--- Administrative commands for the beginners list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:
For help and a description of available commands, send a message to:
  

To subscribe to the list, send a message to:
  

To remove your address from the list, just send a message to
the address in the ``List-Unsubscribe'' header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
  

or for the digest to:
  

For addition or removal of addresses, I'll send a confirmation
message to that address. When you receive it, simply reply to it
to complete the transaction.
If you need to get in touch with the human owner of this list,
please send a message to:
   

Please include a FORWARDED list message with ALL HEADERS intact
to make it easier to help you.
--- Enclosed is a copy of the request I received.

Return-Path: 
Received: (qmail 25596 invoked by uid 76); 28 Feb 2003 15:22:27 -
Received: from [EMAIL PROTECTED] (HELO ran-out.mx.develooper.com) (64.81.84.115) by onion.perl.org (qpsmtpd/0.20) with SMTP; 2003-02-28 15:22:27Z
Received: (qmail 28989 invoked by uid 225); 28 Feb 2003 15:22:26 -
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 28984 invoked by uid 507); 28 Feb 2003 15:22:26 -
Received: from out006pub.verizon.net (HELO out006.verizon.net) (206.46.170.106) by one.develooper.com (qpsmtpd/0.21-dev) with SMTP; Fri, 28 Feb 2003 07:22:24 -0800
Received: from verizon.net ([65.122.110.130]) by out006.verizon.net  (InterMail vM.5.01.05.27 201-253-122-126-127-20021220) with ESMTP  id <[EMAIL PROTECTED]>  for ;  Fri, 28 Feb 2003 09:21:57 -0600
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 28 Feb 2003 10:21:56 -0500
From: Justin Cameron 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:  [EMAIL PROTECTED]
Subject: Re: confirm unsubscribe from [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Authentication-Info: Submitted using SMTP AUTH at out006.verizon.net from [65.122.110.130] at Fri, 28 Feb 2003 09:21:57 -0600
X-SMTPD: qpsmtpd/0.21-dev, http://develooper.com/code/qpsmtpd/
X-Spam-Check-By: one.develooper.com
X-Spam-Status: No, hits=0.4 required=7.0 tests=CARRIAGE_RETURNS,CLICK_BELOW,REFERENCES,SPAM_PHRASE_08_13,USER_AGENT,USER_AGENT_MOZILLA_UA,X_ACCEPT_LANG version=2.44
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/



[EMAIL PROTECTED] wrote:

Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.
I'm working for my owner, who can be reached
at [EMAIL PROTECTED]
To confirm that you would like

  [EMAIL PROTECTED]

removed from the beginners mailing list, please send an empty reply 
to this address:

  [EMAIL PROTECTED]

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.
or click here:
mailto:[EMAIL PROTECTED]
I haven't checked whether your address is currently on the mailing list.
To see what address

RE: image property testing... take II

2003-02-28 Thread Ramón Chávez
I don't know much about the problem you are asking for.
But it seems to me that you're wrong when calling the subroutine wanted.

 # File::Find wanted function
 sub wanted;

It must be:

 # File::Find wanted function
&wanted;

Shouldn't it???
-rm-




- Original Message - 
From: Shawn Wilson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 11:06 AM
Subject: image property testing... take II


> ok, i have cleaned up the code, and fixed all of the mistakes that i can 
> find, but i still can't get this tying to compile and run. and, my code 
> surely isn't written stout enough to handle a 'use strict'. if someone 
> could tell me what i am STILL doing wrong i'd appreciate it. The Code:
> 
> #!/usr/bin/perl
> 
> use warnings;
> # use strict;
> use File::Find;
> use File::Remove qw(remove);
> use Image::Info qw(image_info);
> use File::Scan;
> 
> # File::Find wanted function
> sub wanted;
> 
> # variables
> our ( $file, $dir );
> *file = *File::Find::name;
> *dir = *File::Find::dir;
> 
> 
> print "Where are the pictures/?";
> chomp( my $indir =  );
> 
> File::Find::find(\&wanted, '$indir');
> exit;
> 
> sub wanted {
> unless ($file =~ /\.jpg\z/ or
> $file =~ /\.tif\z/ or
> $file =~ /\.bmp\z/ or
> $file =~ /\.png\z/ ) { # delete every file exept listed image types.
> remove $file;
> }
> else {
> my $info = image_info(\$file); # the attributes of the image file
> $type = $info->(file_ext); # three letter image type
> $w = $info->(width); # pixel width
> $h = $info->(height); # pixel height
> $color = $info->(color_type) # color type
> # delete small images
> if( ($w < 200 and $h < 400) or ($w < 400 and $h < 200) ) {
> remove $file;
> }
> # delete images that try to be a different type from what they say
> if ($type ne 'bmp' or
> $type ne 'jpg' or
> $type ne 'png' or
> $type ne 'tif') {
> remove $file;
> }
> # delete all gray scale images
> if ($color ne 'Gray' or
> $color ne'GrayA') {
> remove $file;
> }
> # check images for viruses
> if ($scanres->scan(\$file) ) {
> if( $scanres->suspicious) {
> print "$file looks like it has a virus, delete/? /(Y//N/)";
> remove $file if  =~ /y|Y/;
> }
> }
> }
> }
> 
> 
> 
> . and the errors:
> 
> Unquoted string "width" may clash with future reserved word at 
> ./bigimg2.pl line 35.
> Unquoted string "height" may clash with future reserved word at 
> ./bigimg2.pl line 36.
> syntax error at ./bigimg2.pl line 39, near ") {"
> syntax error at ./bigimg2.pl line 62, near "}"
> Execution of ./bigimg2.pl aborted due to compilation errors.
> 
> 
> -- 
> 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]



[ADMIN] Re: [Fwd: ezmlm response] Remove request

2003-02-28 Thread Kevin Meltzer
The correct address to send remove requests is
[EMAIL PROTECTED] when you have exhausted all other means.

TIP: Make sure you are trying to subsibscribe the correct address.

Cheers,
Kevin

On Fri, Feb 28, 2003 at 10:27:05AM -0500, Justin Cameron ([EMAIL PROTECTED]) said 
something similar to:
>   Pardon for the OT post, but would the list admin kindly remove me from 
> this mailing list.  I'm having no luck with the autoresponder.
> 
> - Justin Cameron

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
My PID is Inigo Montoya. You kill -9 my parent process. Prepare to vi.

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



RE: image property testing... take II

2003-02-28 Thread Dan Muey
> 
> I don't know much about the problem you are asking for.
> But it seems to me that you're wrong when calling the 
> subroutine wanted.
> 
>  # File::Find wanted function
>  sub wanted;
> 

It's actauilly not clling the routine it's declaring it. So it is valid perl but it's 
not actually calling it.

perldoc perlsub
For details about what it does and why/when/where you can use it.


> It must be:
> 
>  # File::Find wanted function
> &wanted;
> 
> Shouldn't it???
> -rm-
> 
> 
> 
> 
> - Original Message - 
> From: Shawn Wilson <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 11:06 AM
> Subject: image property testing... take II
> 
> 
> > ok, i have cleaned up the code, and fixed all of the 
> mistakes that i 
> > can
> > find, but i still can't get this tying to compile and run. 
> and, my code 
> > surely isn't written stout enough to handle a 'use strict'. 
> if someone 
> > could tell me what i am STILL doing wrong i'd appreciate 
> it. The Code:
> > 
> > #!/usr/bin/perl
> > 
> > use warnings;
> > # use strict;
> > use File::Find;
> > use File::Remove qw(remove);
> > use Image::Info qw(image_info);
> > use File::Scan;
> > 
> > # File::Find wanted function
> > sub wanted;
> > 
> > # variables
> > our ( $file, $dir );
> > *file = *File::Find::name;
> > *dir = *File::Find::dir;
> > 
> > 
> > print "Where are the pictures/?";
> > chomp( my $indir =  );
> > 
> > File::Find::find(\&wanted, '$indir');
> > exit;
> > 
> > sub wanted {
> > unless ($file =~ /\.jpg\z/ or
> > $file =~ /\.tif\z/ or
> > $file =~ /\.bmp\z/ or
> > $file =~ /\.png\z/ ) { # delete every file exept listed 
> image types. 
> > remove $file; }
> > else {
> > my $info = image_info(\$file); # the attributes of the image file
> > $type = $info->(file_ext); # three letter image type
> > $w = $info->(width); # pixel width
> > $h = $info->(height); # pixel height
> > $color = $info->(color_type) # color type
> > # delete small images
> > if( ($w < 200 and $h < 400) or ($w < 400 and $h < 200) ) {
> > remove $file;
> > }
> > # delete images that try to be a different type from what they say
> > if ($type ne 'bmp' or
> > $type ne 'jpg' or
> > $type ne 'png' or
> > $type ne 'tif') {
> > remove $file;
> > }
> > # delete all gray scale images
> > if ($color ne 'Gray' or
> > $color ne'GrayA') {
> > remove $file;
> > }
> > # check images for viruses
> > if ($scanres->scan(\$file) ) {
> > if( $scanres->suspicious) {
> > print "$file looks like it has a virus, delete/? /(Y//N/)";
> > remove $file if  =~ /y|Y/;
> > }
> > }
> > }
> > }
> > 
> > 
> > 
> > . and the errors:
> > 
> > Unquoted string "width" may clash with future reserved word at
> > ./bigimg2.pl line 35.
> > Unquoted string "height" may clash with future reserved word at 
> > ./bigimg2.pl line 36.
> > syntax error at ./bigimg2.pl line 39, near ") {"
> > syntax error at ./bigimg2.pl line 62, near "}"
> > Execution of ./bigimg2.pl aborted due to compilation errors.
> > 
> > 
> > --
> > 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: Perl Application error on windows

2003-02-28 Thread david
Madhu Reddy wrote:

>> > -
>> 
>> if you do perl -V, do you see a line that looks
>> like:
>> 
>> usethreads=define use5005threads=undef
>> useithreads=define
>> usemultiplicity=define
>> 
>> 
> 
> NO, I didn't see that one...
> 
> following is my perl -v output

actually can you try:

perl -V

with the capital V (not the small v) and see if you see a line similar to 
the above? I can't duplicate your problem in my Linux box with 5.8. I 
suspect the error is Windos specific (especially the error is coming from 
Windos in that error box). if that's the case, you can rewrite your 
application to be a multi-process application which might be easier for you 
to understand.

david

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



convert pdf files to text using Perl

2003-02-28 Thread William.Ampeh
Hello,

How do I convert pdf file (Acrobat readable format) to text, or simple read
these file types using Perl?  Do I treat these file types as binary or
what?

Any pointers will be appreciated.

Thank you,


__

William Ampeh (x3939)
Federal Reserve Board


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



DBI install problems

2003-02-28 Thread Scott Taylor
Hello all,

I had a power outage that I think somehow damaged my Perl install, I've 
been trying like crazy to repair it, I upgraded to the latest, 5.8.0 for 
I686 Linux, now I am trying to repair the DBI bundle and I can't seem to 
get past this:

t/zz_80proxy_ppskipped
all skipped: modules required for proxy are probably not installed
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
---
t/40profile.t2   51256   56 100.00%  1-56
9 tests skipped.
Failed 1/36 test scripts, 97.22% okay. 56/1140 subtests failed, 95.09% okay.
make: *** [test_dynamic] Error 11
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force
DBD::Multiplex is up to date.
Bundle summary: The following items in bundle Bundle::DBI had installation
problems:
  RPC::PlServer DBI
Any one know what's going on, or if there is a better place for me to ask 
this, or a FAq that I have over looked.  I'm having a very hard time 
tracking this down, and suggestions would be great.

Thanks.

Scott.

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


how to mimic cursor movement in a Perl script

2003-02-28 Thread Jim Yu

Hi,

I am try to automate a analysis process, In which I used a windows box to telnet a 
UNIX box and do the job on the telnet consol. I need to use move the cursor down or up 
and also need to use Control key plus a certain cahracter key to do the operation. 
Ideally I sould type a few characters after move the cursor to a centain position.

My question is how to write a Perl script to do it? I do not want to sit here do it 
over and over for weeks!

Thanks

Jim



-
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

RE: how to mimic cursor movement in a Perl script

2003-02-28 Thread Bob Showalter
Jim Yu wrote:
> Hi,
> 
> I am try to automate a analysis process, In which I used a
> windows box to telnet a UNIX box and do the job on the telnet
> consol. I need to use move the cursor down or up and also
> need to use Control key plus a certain cahracter key to do
> the operation. Ideally I sould type a few characters after
> move the cursor to a centain position.
> 
> My question is how to write a Perl script to do it? I do not
> want to sit here do it over and over for weeks!

The keys you press may be either:

1. Interpreted by your Windows terminal emulation software and handled by it
in some fashion, or

2. Passed over to the UNIX side and handled by the device driver and/or
application program running there.

For (1) (and possibly (2)), you would need to look at scripting capabilities
built into your terminal emulation software.

For (2), you can use Perl's Net::Telnet (from the client) or Expect (from
the server) modules to write a script to manipulate the application. This
script would stand in the place of your terminal emulator.

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



RE: how to mimic cursor movement in a Perl script

2003-02-28 Thread Dan Muey



> 
> Hi,
> 
> I am try to automate a analysis process, In which I used a 
> windows box to telnet a UNIX box and do the job on the telnet 
> consol. I need to use move the cursor down or up and also 

Are you trying to get coordinants then enter those keys?
A little more info would help On exactly the steps you are 
needing and why/what they are supposed to accomplish.

> need to use Control key plus a certain cahracter key to do 
> the operation. Ideally I sould type a few characters after 
> move the cursor to a centain position.
> 
> My question is how to write a Perl script to do it? I do not 
> want to sit here do it over and over for weeks!
> 
> Thanks
> 
> Jim
> 
> 
> 
> -
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, and more
> 

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



RE: convert pdf files to text using Perl

2003-02-28 Thread Dan Muey
 Hello,
> 
> How do I convert pdf file (Acrobat readable format) to text, 
Convert to text not sure..
Have you looked at http://search.cpan.org and searched for pdf under modules?

Using/getting pdf into your script is easy :

#!/usr/bin/perl

use File::Slurp;
use CGI qw/:standard/;
 
print header("application/pdf");
print read_file("/path/to/my.pdf");

# or 
# $pdf_guts = read_file("/path/to/my.pdf");
# do what you want with pdf guts, like translate them into text or html if possible!
 
If you don't want to output he pdf to the screen 
but want other output ( html ) then do print header();

Of course you can do all kinds of things like check for 
errors modify the pdf using various image modules display 
different pdfs based on input, email the odf as an attchment etc, etc

This is a two for one reply! 
( If any one read the exact sam one about images an hour or so ago. )

DMuey

> or simple read these file types using Perl?  Do I treat these 
> file types as binary or what?
> 
> Any pointers will be appreciated.
> 
> Thank you,
> 
> 
> __
> 
> William Ampeh (x3939)
> Federal Reserve Board
> 
> 
> -- 
> 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]



Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
Hello, 

Is there any existing module that can list all the subdirectories/files  within a 
given directory? 

TIA
Shishir

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



RE: regex to capture all combinations of .. and [ ]

2003-02-28 Thread Mark Anderson



> This (perl -n -we 'print if /[\[\].]{2}/;' file) almost did the trick, but
> it was also picking up lines  with many .. or many 
flanked
> in between something. So I ammended it to (as there is always a space
> between the characters I am trying to pull out):
>
> perl -n -we 'print if /\s[\[\].]{2}\s/;' file | more

It will also grab [[ and ]] and ][ which don't appear possible from your
original example.  If you only want [ or . in the first position and . or ]
in the second and want to exclude [[, ]], and ][, then try:

perl -n -we 'print if /\s[\[.][\].]\s/;' file | more

> > > > somethingdigits/digits  digitsdigits..digits
> > > > digits..digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits..digits
> > > > digits.]digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits..digits
> > > > digits[.digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits..digits
> > > > digits[]digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[.digits
> > > > digits.] digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[]digits
> > > > digits[]digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[.digits
> > > > digits.. digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[.digits
> > > > digits[]digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[]digits
> > > > digits..digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits.]digits
> > > > digits.. digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits[.digits
> > > > digits[. digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits.]digits
> > > > digits.] digitsdigits.digits
> > > > somethingdigits/digits  digitsdigits.]digits
> > > > digits [.digitsdigits.digits



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



RE: Display DubDirectory/Files

2003-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Shishir K. Singh wrote:
> Hello,
> 
> Is there any existing module that can list all the
> subdirectories/files  within a given directory? 
> 
> TIA
> Shishir

You can use File::Find to pull out what you want. Has decent examples and you 
should be able to get what you need from that.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



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



RE: how to mimic cursor movement in a Perl script

2003-02-28 Thread Dan Muey
Remember to reply to the list!!

> 
> Thanks, Dan!
> 
> No, I only need to choose from the manu, sometimes, I
> have to move the cursor to a specific manu choice and
> type a few words.

Depends on the program that has the menu's
Do they have shortcut keys?

Not sure exactly how you'd do that.
Try http://search.cpan.org

Is there a way to do the same thing as traversing the menu in a command line form?

./program -u bob -p pass -f file.txt -o option

If so all you'd have to do is generate that statement based on input or a config file 
or database entry or something
And execute it. Then it's be a snap.

DMuey

> 
> The program provodes several screens of manu, I have
> to  choose one from each screen, then use the control
> and "n" key to move to another screen. When finised I
> have to type control key and "z" to exit.
> 
> 
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > 
> > > 
> > > Hi,
> > > 
> > > I am try to automate a analysis process, In which
> > I used a
> > > windows box to telnet a UNIX box and do the job on
> > the telnet
> > > consol. I need to use move the cursor down or up
> > and also
> > 
> > Are you trying to get coordinants then enter those
> > keys?
> > A little more info would help On exactly the steps
> > you are
> > needing and why/what they are supposed to
> > accomplish.
> > 
> > > need to use Control key plus a certain cahracter
> > key to do
> > > the operation. Ideally I sould type a few
> > characters after
> > > move the cursor to a centain position.
> > > 
> > > My question is how to write a Perl script to do
> > it? I do not
> > > want to sit here do it over and over for weeks!
> > > 
> > > Thanks
> > > 
> > > Jim
> > > 
> > > 
> > > 
> > > -
> > > Do you Yahoo!?
> > > Yahoo! Tax Center - forms, calculators, tips, and
> > more
> > > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more 
http://taxes.yahoo.com/

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



RE: Display DubDirectory/Files

2003-02-28 Thread Dan Muey

> 
> Hello, 
> 
> Is there any existing module that can list all the 
> subdirectories/files  within a given directory? 

Is this homework? You'll never learn anythign if you cheat!

Any who I'll bite even though I think it's howework ::

http://search.cpan.org is your friend

use File::Slurp;
@files_and_directories = read_dir("/dir");

I'll leave it to you to look on cpan for something that 
will list all recursively if that's what you're asking.

Dmuey

> 
> TIA
> Shishir
> 
> -- 
> 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: Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
Aaagh, I am already doing that. However wanted to know if any module exists that 
recursively lists all the sub directories/files within the directory. 

-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 2:26 PM
To: Shishir K. Singh; [EMAIL PROTECTED]
Subject: RE: Display DubDirectory/Files


Shishir K. Singh wrote:
> Hello,
> 
> Is there any existing module that can list all the
> subdirectories/files  within a given directory? 
> 
> TIA
> Shishir

You can use File::Find to pull out what you want. Has decent examples and you 
should be able to get what you need from that.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



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



RE: Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
I am already doing the recursive look up and it works fine. However, if it's a long 
hieararchy, it, it takes up some to traverse the full tree. I was curious to know if 
any module exist so that I can compare the speeds. If the performance is better, I can 
discard my piece. 

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 2:27 PM
To: Shishir K. Singh; [EMAIL PROTECTED]
Subject: RE: Display DubDirectory/Files



> 
> Hello, 
> 
> Is there any existing module that can list all the 
> subdirectories/files  within a given directory? 

Is this homework? You'll never learn anythign if you cheat!

Any who I'll bite even though I think it's howework ::

http://search.cpan.org is your friend

use File::Slurp;
@files_and_directories = read_dir("/dir");

I'll leave it to you to look on cpan for something that 
will list all recursively if that's what you're asking.

Dmuey

> 
> TIA
> Shishir
> 
> -- 
> 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]



formating numbers.

2003-02-28 Thread Christopher M Burger
I have some numbers that I want to format into a 00,000.00 format.  Right
now the numbers are link 0.00 how do I get the commas in there.  I also
do not know how many commas I will need.  As the number may be 000.00
thus it would need two.  

Appreciate any help.

Chris Burger



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



RE: formating numbers.

2003-02-28 Thread Dan Muey
There was a post about this exact thing a few weeks or so ago. I can't remember who 
posted it but
Here is what I use, works like a monkey in heat!

#!/usr/bin/perl
$commify_this_number = $ARGV[0];
$commify_this_number =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
print $commify_this_number;

It will put commas in the proper places on digits to the left of a decimal or letters.


DMuey

> -Original Message-
> From: Christopher M Burger [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 28, 2003 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: formating numbers.
> 
> 
> I have some numbers that I want to format into a 00,000.00 
> format.  Right now the numbers are link 0.00 how do I get 
> the commas in there.  I also do not know how many commas I 
> will need.  As the number may be 000.00 thus it would need two.  
> 
> Appreciate any help.
> 
> Chris Burger
> 
> 
> 
> -- 
> 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: formating numbers.

2003-02-28 Thread Beau E. Cox
Hi -

> -Original Message-
> From: Christopher M Burger [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: formating numbers.
> 
> 
> I have some numbers that I want to format into a 00,000.00 format.  Right
> now the numbers are link 0.00 how do I get the commas in 
> there.  I also
> do not know how many commas I will need.  As the number may be 000.00
> thus it would need two.  
> 
> Appreciate any help.
> 
> Chris Burger
> 

A generalized 'commify' sub looks something like this:

sub commify
{
  my $nbr = reverse shift;
  $nbr =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
  return scalar reverse $nbr;
}

Just call it - baring typos, it should work.

Aloha => Beau;


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



RE: formating numbers.

2003-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Christopher M Burger wrote:
> I have some numbers that I want to format into a 00,000.00 format. 
> Right now the numbers are link 0.00 how do I get the commas in
> there.  I also do not know how many commas I will need.  As the
> number may be 000.00 thus it would need two.
> 
> Appreciate any help.
> 
> Chris Burger

Straight from the Perl Cookbook:

sub commify {
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse $text;
}

Just feed it a number and either print the return or place in a variable to work with.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for 
the express purpose(s) described therein.
Any other use is prohibited.



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



shifting through arrays of line data

2003-02-28 Thread Deb
Hi Guys,

I have an array in which each element is a line commandline data.  It looks
something like this -

@Array contains lines:

post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
post2: -x tel -h post2
post3: -h post3 -x hifi

And so on.  The order of the options varies, and there may or may not be a 
-r $arg on the line.

These lines are parsed from a file with more lines, of which I extracted all
the lines with -h:

open (F, "<$File");

while () {
   if ($_ =~ / -h /) {
  # remove crud
  s/ \"\|//;
  s/\/some\/crud\/path argument //;
  s/\"$//;
  # store what's left
  push @Array, $_;
   }
}

What I really need to do is build a relationship between the first field 
(which is the same as the argument to -h) and the argument to -x.  The -x flag
can be dropped, as they're not needed.

So it looks like I need to build a hash based. 

But I can't can't grok how to parse each line out to do what I need, then
move on to the next line (all lines are unrelated to each other).

I've been using shift, but then I'm doing something like, (psuedo code):

if ($_[0] eq "-r") { $r = (shift);}

but if sub 0 doesn't eq -r, and I shift until I get to -x, say, and use that
for the $x = (shift), how can I be efficient to check again for -r, which I
still haven't found?

Is this making any sense?

Thanks,

deb



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  There are 010 types of people in the world:
   those who understand binary, and those who don't.
ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
 ~ 







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



RE: shifting through arrays of line data

2003-02-28 Thread Dan Muey
perldoc -f split

Will fic you up!

Dmuey

> Hi Guys,
> 
> I have an array in which each element is a line commandline 
> data.  It looks something like this -
> 
> @Array contains lines:
> 
> post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> post2: -x tel -h post2
> post3: -h post3 -x hifi
> 
> And so on.  The order of the options varies, and there may or 
> may not be a 
> -r $arg on the line.
> 
> These lines are parsed from a file with more lines, of which 
> I extracted all the lines with -h:
> 
> open (F, "<$File");
> 
> while () {
>if ($_ =~ / -h /) {
>   # remove crud
>   s/ \"\|//;
>   s/\/some\/crud\/path argument //;
>   s/\"$//;
>   # store what's left
>   push @Array, $_;
>}
> }
> 
> What I really need to do is build a relationship between the 
> first field 
> (which is the same as the argument to -h) and the argument to 
> -x.  The -x flag can be dropped, as they're not needed.
> 
> So it looks like I need to build a hash based. 
> 
> But I can't can't grok how to parse each line out to do what 
> I need, then move on to the next line (all lines are 
> unrelated to each other).
> 
> I've been using shift, but then I'm doing something like, 
> (psuedo code):
> 
> if ($_[0] eq "-r") { $r = (shift);}
> 
> but if sub 0 doesn't eq -r, and I shift until I get to -x, 
> say, and use that for the $x = (shift), how can I be 
> efficient to check again for -r, which I still haven't found?
> 
> Is this making any sense?
> 
> Thanks,
> 
> deb
> 
> 
> 
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=-=-
>   There are 010 types of people in the world:
>those who understand binary, and those who don't.
> ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
>  ~ 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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: shifting through arrays of line data

2003-02-28 Thread Deb
Thanks, I know how to use split (I think).  Since the data comes in
any order, and I have to corellate it, I can't think of a way that split
will fix me up - Maybe I'm missing something.  Can you give me an example?

deb


Dan Muey <[EMAIL PROTECTED]> had this to say,

> perldoc -f split
> 
> Will fic you up!
> 
> Dmuey
> 
> > Hi Guys,
> > 
> > I have an array in which each element is a line commandline 
> > data.  It looks something like this -
> > 
> > @Array contains lines:
> > 
> > post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> > post2: -x tel -h post2
> > post3: -h post3 -x hifi
> > 
> > And so on.  The order of the options varies, and there may or 
> > may not be a 
> > -r $arg on the line.
> > 
> > These lines are parsed from a file with more lines, of which 
> > I extracted all the lines with -h:
> > 
> > open (F, "<$File");
> > 
> > while () {
> >if ($_ =~ / -h /) {
> >   # remove crud
> >   s/ \"\|//;
> >   s/\/some\/crud\/path argument //;
> >   s/\"$//;
> >   # store what's left
> >   push @Array, $_;
> >}
> > }
> > 
> > What I really need to do is build a relationship between the 
> > first field 
> > (which is the same as the argument to -h) and the argument to 
> > -x.  The -x flag can be dropped, as they're not needed.
> > 
> > So it looks like I need to build a hash based. 
> > 
> > But I can't can't grok how to parse each line out to do what 
> > I need, then move on to the next line (all lines are 
> > unrelated to each other).
> > 
> > I've been using shift, but then I'm doing something like, 
> > (psuedo code):
> > 
> > if ($_[0] eq "-r") { $r = (shift);}
> > 
> > but if sub 0 doesn't eq -r, and I shift until I get to -x, 
> > say, and use that for the $x = (shift), how can I be 
> > efficient to check again for -r, which I still haven't found?
> > 
> > Is this making any sense?
> > 
> > Thanks,
> > 
> > deb
> > 
> > 
> > 
> > -- 
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > =-=-=-=-=-=-=-=-=-
> >   There are 010 types of people in the world:
> >those who understand binary, and those who don't.
> > ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
> >  ~ 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  There are 010 types of people in the world:
   those who understand binary, and those who don't.
ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
 ~ 







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



RE: shifting through arrays of line data

2003-02-28 Thread Dan Muey


> 
> Thanks, I know how to use split (I think).  Since the data 
> comes in any order, and I have to corellate it, I can't think 
> of a way that split will fix me up - Maybe I'm missing 
> something.  Can you give me an example?
> 

Ok I'll give her a go

my %results;
my $cnt = 1;
foreach $line(@Array) {

my %tmp;
my $switch;
my $value;

%tmp = split(/\s/, $line); 

# this assumes that every piece of data has a switch so it wouldn't work on  '-I love 
you' because -I and love 
# would be together but then you would be lonely , it would especially be bad if it 
had switches after it 
# '-I love you -j enny -I mforestgump'
# if this is the case you may have to put it in an array and process that somehow to 
get the switch/value combos 
# and then do something with the bare values ( I guess I should be calling them 
arguments oh well )

foreach $switch(keys %tmp) {
$results{$cnt}{$switch} = $value;
}
$cnt++
}

print $results{'1'}{'-h'}; # would print post1 from your three line example below

Give that a go and see if it doesn't help!

DMuey

> deb
> 
> 
> Dan Muey <[EMAIL PROTECTED]> had this to say,
> 
> > perldoc -f split
> > 
> > Will fic you up!
> > 
> > Dmuey
> > 
> > > Hi Guys,
> > > 
> > > I have an array in which each element is a line commandline
> > > data.  It looks something like this -
> > > 
> > > @Array contains lines:
> > > 
> > > post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> > > post2: -x tel -h post2
> > > post3: -h post3 -x hifi
> > > 
> > > And so on.  The order of the options varies, and there may or
> > > may not be a 
> > > -r $arg on the line.
> > > 
> > > These lines are parsed from a file with more lines, of which
> > > I extracted all the lines with -h:
> > > 
> > > open (F, "<$File");
> > > 
> > > while () {
> > >if ($_ =~ / -h /) {
> > >   # remove crud
> > >   s/ \"\|//;
> > >   s/\/some\/crud\/path argument //;
> > >   s/\"$//;
> > >   # store what's left
> > >   push @Array, $_;
> > >}
> > > }
> > > 
> > > What I really need to do is build a relationship between the
> > > first field 
> > > (which is the same as the argument to -h) and the argument to 
> > > -x.  The -x flag can be dropped, as they're not needed.
> > > 
> > > So it looks like I need to build a hash based.
> > > 
> > > But I can't can't grok how to parse each line out to do what
> > > I need, then move on to the next line (all lines are 
> > > unrelated to each other).
> > > 
> > > I've been using shift, but then I'm doing something like,
> > > (psuedo code):
> > > 
> > > if ($_[0] eq "-r") { $r = (shift);}
> > > 
> > > but if sub 0 doesn't eq -r, and I shift until I get to -x,
> > > say, and use that for the $x = (shift), how can I be 
> > > efficient to check again for -r, which I still haven't found?
> > > 
> > > Is this making any sense?
> > > 
> > > Thanks,
> > > 
> > > deb
> > > 
> > > 
> > > 
> > > --
> > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > > =-=-=-=-=-=-=-=-=-
> > >   There are 010 types of people in the world:
> > >those who understand binary, and those who don't.
> > > ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
> > >  ~ 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> 
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=-=-
>   There are 010 types of people in the world:
>those who understand binary, and those who don't.
> ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
>  ~ 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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]



Crypt::Blowfish errors on line 56

2003-02-28 Thread Tyler Longren
Hi Folks,

The code at http://longren.no-ip.org/tyler/blowfish.pl encrypts some $data.
Once the data is encrypted, the hex value should be stored in $ciphertext.
$plaintext should have the original data that's in $data.

When I run this code, I recieve this error:
"input must be 8 bytes long at
/usr/lib/perl5/site_perl/i386-linux/Crypt/Blowfish.pm line 56."

Does anybody know why this happens?

You can view the code here:
http://longren.no-ip.org/tyler/blowfish.pl

Thanks,
Tyler


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



Re: Crypt::Blowfish errors on line 56

2003-02-28 Thread Tyler Longren
I found that if I change $data to "12345678", it works.  How can I encrypt a
string that has more than 8 characters?

Thanks,
Tyler

- Original Message -
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 3:47 PM
Subject: Crypt::Blowfish errors on line 56


> Hi Folks,
>
> The code at http://longren.no-ip.org/tyler/blowfish.pl encrypts some
$data.
> Once the data is encrypted, the hex value should be stored in $ciphertext.
> $plaintext should have the original data that's in $data.
>
> When I run this code, I recieve this error:
> "input must be 8 bytes long at
> /usr/lib/perl5/site_perl/i386-linux/Crypt/Blowfish.pm line 56."
>
> Does anybody know why this happens?
>
> You can view the code here:
> http://longren.no-ip.org/tyler/blowfish.pl
>
> Thanks,
> Tyler
>
>
> --
> 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: Crypt::Blowfish errors on line 56

2003-02-28 Thread Dan Muey
> Hi Folks,
> 
> The code at http://longren.no-ip.org/tyler/blowfish.pl 
> encrypts some $data. Once the data is encrypted, the hex 
> value should be stored in $ciphertext. $plaintext should have 
> the original data that's in $data.
> 
> When I run this code, I recieve this error:

At the risk of sounding condescending...
I'm going to go out on a limb here and say that one of those vars 
needs to be 8 bytes long and is not.
I'd say find out which $variable it's using in line 56 of th 
Blowfish.pm file and make sure it's 8 bits long.

DMuey

> "input must be 8 bytes long at 
> /usr/lib/perl5/site_perl/i386-linux/Crypt/Blowfish.pm line 56."
> 
> Does anybody know why this happens?
> 
> You can view the code here: http://longren.no-ip.org/tyler/blowfish.pl
> 
> Thanks,
> Tyler
> 
> 
> -- 
> 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: Crypt::Blowfish errors on line 56

2003-02-28 Thread Frank Wiles
 .--[ Tyler Longren wrote (2003/02/28 at 16:15:27) ]--
 | 
 |  I found that if I change $data to "12345678", it works.  How can I encrypt a
 |  string that has more than 8 characters?
 |  
 `-

You'll want to look at Crypt::CBC which can use many of the other
encryption types found in Crypt::* such as Blowfish.  CBC stands for
Chaining Block Cipher (IIRC). 

It is because Blowfish is a block cipher that only handles 8 bits at
a time, CBC handles this "chaining" of these 8 byte sections
together for you. 

 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 -


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



Re: Crypt::Blowfish errors on line 56

2003-02-28 Thread Frank Wiles
 .--[ Frank Wiles wrote (2003/02/28 at 16:20:37) ]--
 | 
 |   .--[ Tyler Longren wrote (2003/02/28 at 16:15:27) ]--
 |   | 
 |   |  I found that if I change $data to "12345678", it works.  How can 
 |   |  I encrypt a string that has more than 8 characters?
 |   |  
 |   `-
 |  
 |  You'll want to look at Crypt::CBC which can use many of the other
 |  encryption types found in Crypt::* such as Blowfish.  CBC stands for
 |  Chaining Block Cipher (IIRC). 
 |  
 |  It is because Blowfish is a block cipher that only handles 8 bits at
 |  a time, CBC handles this "chaining" of these 8 byte sections
 |  together for you. 
 |  
 |   -
 | Frank Wiles <[EMAIL PROTECTED]>
 | http://frank.wiles.org
 |   -
 |  
 `-

Oops I menat ot say 8 bytes at a time... not bits sorry. 

 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 -


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



Re: Crypt::Blowfish errors on line 56

2003-02-28 Thread John W. Krahn
Tyler Longren wrote:
> 
> Hi Folks,

Hello,

> The code at http://longren.no-ip.org/tyler/blowfish.pl encrypts some $data.
> Once the data is encrypted, the hex value should be stored in $ciphertext.
> $plaintext should have the original data that's in $data.
> 
> When I run this code, I recieve this error:
> "input must be 8 bytes long at
> /usr/lib/perl5/site_perl/i386-linux/Crypt/Blowfish.pm line 56."
> 
> Does anybody know why this happens?
> 
> You can view the code here:
> 
> #!/usr/bin/perl -w
> use strict;
> use Crypt::Blowfish;
> my $key = pack("H16", "F0AA2pa8");
> my $cipher = new Crypt::Blowfish $key;
> my $data = "54321";
> my $ciphertext = $cipher->encrypt($data);
> my $plaintext = $cipher->decrypt($ciphertext);
> print "Ciphertext: ", unpack("H16", $ciphertext), "\n";
> print "Plaintext: $plaintext\n";
> exit;

According to the documentation for this module:

NOTES 

 The module is capable of being used with Crypt::CBC. You're encouraged
to read
 the perldoc for Crypt::CBC if you intend to use this module for Cipher
Block
 Chaining modes. In fact, if you have any intentions of encrypting more
than
 eight bytes of data with this, or any other block cipher, you're going
to need
 some type of block chaining help. Crypt::CBC tends to be very good at
this. If

^^
 you're not going to encrypt more than eight bytes, your data must be
exactly


 eight bytes long. If need be, do your own padding. "\0" as a null byte
is

^
 perfectly valid to use for this. Additionally, the current maintainer
for
 
 Crypt::Blowfish may or may not release Crypt::CBC_R which replaces the
default
 'RandomIV' initialization vector in Crypt::CBC with a random
initialization
 vector. (to the limits of /dev/urandom and associates) In either case,
please
 email [EMAIL PROTECTED] for Crypt::CBC_R. 


Your data is only five bytes long.

my $data = pack 'a8', '54321';



John
-- 
use Perl;
program
fulfillment

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



Re: shifting through arrays of line data

2003-02-28 Thread John W. Krahn
Deb wrote:
> 
> Hi Guys,
> 
> I have an array in which each element is a line commandline data.  It looks
> something like this -
> 
> @Array contains lines:
> 
> post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> post2: -x tel -h post2
> post3: -h post3 -x hifi
> 
> And so on.  The order of the options varies, and there may or may not be a
> -r $arg on the line.
> 
> These lines are parsed from a file with more lines, of which I extracted all
> the lines with -h:
> 
> open (F, "<$File");
> 
> while () {
>if ($_ =~ / -h /) {
>   # remove crud
>   s/ \"\|//;
>   s/\/some\/crud\/path argument //;
>   s/\"$//;
>   # store what's left
>   push @Array, $_;
>}
> }
> 
> What I really need to do is build a relationship between the first field
> (which is the same as the argument to -h) and the argument to -x.  The -x flag
> can be dropped, as they're not needed.
> 
> So it looks like I need to build a hash based.

If you want to put the data into a hash this may do what you want:

$ perl -le'
@array = (
"post1: -r [EMAIL PROTECTED] -x cat-100 -h post1",
"post2: -x tel -h post2",
"post3: -h post3 -x hifi"
);
for ( @array ) {
  %hash = /(-[a-z])\s*((?!-)\S*)/g;
  $" = " <*> ";
  print "*> @{[%hash]} <*";
  }'
*> -r <*> [EMAIL PROTECTED] <*> -h <*> post1 <*> -x <*> cat-100 <*
*> -h <*> post2 <*> -x <*> tel <*
*> -h <*> post3 <*> -x <*> hifi <*



John
-- 
use Perl;
program
fulfillment

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



Re: what is this error?

2003-02-28 Thread R. Joseph Newton
Dilip v wrote:

> If I do "set JDK122ROOT=c/jdk1.2.2

Try:
set JDK122ROOT=c:/jdk1.2.2
Drive specifiers in DOS/Windows always take colons.  The forward slashes are probably 
alright, though, if you are using a recent version of Perl.
Let us know if that helps.


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



Re: grabbing mime type

2003-02-28 Thread R. Joseph Newton
Dan Muey wrote:

> I have a need to grab specific Mime sections of an array.
>
> I've looked at and tried different Mime Modules but can't seem to get it to go.
> I thought about parsing it manually but I'm not sure if every message will be 
> formatted exactly the same, hence the module.
>
> The array contains the lines of a multipart email body, not the header, just the 
> body.
>
> I have the boundary line in a variable by then.
>
> What I need to do is grab the text/plain section into a variable or array.
> In the example below I just want to grab 'I am monkey hear me roar'
>
> These aren't actually like this in the script, they are set by a
> function in a module but this illustrates what they contain.
>
> $boundary = '--=_NextPart_000_000B_01C2D9A1.22427D20';
> @body = '
> --=_NextPart_000_000B_01C2D9A1.22427D20
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable

Can you count on the header lines always stating with "Content-", unless the preceding 
line has a semicolon as a line-continuation character?  If  so, then you can scan 
through the headers [preferably on initial input], looking for the first instance 
where a line does not start with "Content-", and is not a continuation of another line 
starting with that string.

Also, we know from doing CGI that the header section must always be followed by an 
empty line.  When your program detects that it is reading a header, it can watch for 
that empty line to mark the start of the content described in the header.  For the end 
of the content of any given mime, you already have the flag line to watch for.  When 
you read it, you can discrad all empty lines between the end of content and the 
divider.

HTH

Joseph


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



Re: Perl Application error on windows

2003-02-28 Thread R. Joseph Newton
Madhu Reddy wrote:

> > > -
> >
> > if you do perl -V,

> NO, I didn't see that one...

Is this:

> perl -v

The same as:
perl -V
?

As it turns out, no.  Even though DOS/Win handles filenames as case insensitive, it 
hands the switches and parameters to Perl verbatim, and Perl is very much case 
sensitive.

Observe:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>perl -v

This is perl, v5.8.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2002, Larry Wall

Binary build 805 provided by ActiveState Corp. http://www.ActiveState.com
Built 18:08:02 Feb  4 2003


Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.


C:\>perl -V
Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=
ine
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOL
DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DU
PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lsee
ze=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf  -libpath:
\Perl\lib\CORE"  -machine:x86'
libpth="C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib" "C:\Progra
iles\Microsoft Visual Studio\VC98\lib" "C:\Perl\lib\CORE"
libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdl
.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib w
k32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  c
lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.l
wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
gnulibc_version='undef'
  Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf
libpath:"C:\Perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLIC
CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
ActivePerl Build 805
  Built under MSWin32
  Compiled at Feb  4 2003 18:08:02
  @INC:
C:/Perl/lib
C:/Perl/site/lib
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>perl -v

This is perl, v5.8.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2002, Larry Wall

Binary build 805 provided by ActiveState Corp. http://www.ActiveState.com
Built 18:08:02 Feb  4 2003


Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.


C:\>perl -V
Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=
ine
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOL
DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DU
PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4

Re: Display DubDirectory/Files

2003-02-28 Thread R. Joseph Newton
"Shishir K. Singh" wrote:

> I am already doing the recursive look up and it works fine. However, if it's a long 
> hieararchy, it, it takes up some to traverse the full tree. I was curious to know if 
> any module exist so that I can compare the speeds. If the performance is better, I 
> can discard my piece.
>
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]
>
> http://search.cpan.org is your friend
>
> use File::Slurp;
> @files_and_directories = read_dir("/dir");
>
>

Yes.  The module is File::Find. You should search for the Find.pm file in a File 
directory in one of your lib directories.  You can then test your script against that 
benchmark to evaluate it.

Since Perl is an open-source language, you can also open the file up in a text or code 
editor, and study the way it executes its work.  This may give you some insight into 
the recursive process.  Since recursion most closely reflect the nature of the veast 
being processed, it is very likely that the module performs its work through recursion.

Joseph


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



Re: shifting through arrays of line data

2003-02-28 Thread R. Joseph Newton
Deb wrote:

> Hi Guys,
>
> I have an array in which each element is a line commandline data.  It looks
> something like this -
>
> @Array contains lines:
>
> post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> post2: -x tel -h post2
> post3: -h post3 -x hifi
>
> What I really need to do is build a relationship between the first field
> (which is the same as the argument to -h) and the argument to -x.  The -x flag
> can be dropped, as they're not needed.

Hi Deb,

Is this something like what you are looking for?

sub getRelationship($, $) {
  my ($commandline, $relationships) = @_
  my @commands = split /\s -/, $commandline = @_;
  my $key = shift(@commands);
  foreach (@commands) {
if (/^x/) {
  s/^x\s+//;
  $$relationships{$key} = $commandline;
}
  }
}

This should put a string containing all parameter to any -x command into the hash 
referenced by $relationships.

[snip]

>   There are 010 types of people in the world:
>those who understand binary, and those who don't.--agreed so far
> ô¿ô   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)

It mgght be interesting also to show how you can just LOOK at a number like 
2,305,843,008,159,952,128 and know that it has about about a one-in-four chance of 
being one of the eight "perfect numbers" found within the range from zero to that 
number.

Joseph


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



Re: shifting through arrays of line data

2003-02-28 Thread John W. Krahn
"R. Joseph Newton" wrote:
> 
> Deb wrote:
> >
> > I have an array in which each element is a line commandline data.  It looks
> > something like this -
> >
> > @Array contains lines:
> >
> > post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> > post2: -x tel -h post2
> > post3: -h post3 -x hifi
> >
> > What I really need to do is build a relationship between the first field
> > (which is the same as the argument to -h) and the argument to -x.  The -x flag
> > can be dropped, as they're not needed.
> 
> Is this something like what you are looking for?
> 
> sub getRelationship($, $) {
  
What is the comma doing there?

>   my ($commandline, $relationships) = @_
  ^
Missing semicolon.

>   my @commands = split /\s -/, $commandline = @_;
 ^^
Why are you assigning the array size to $commandline?

>   my $key = shift(@commands);
>   foreach (@commands) {
> if (/^x/) {
>   s/^x\s+//;

There is no need to do a match AND a substitution.

  if ( s/^x\s+// ) {


>   $$relationships{$key} = $commandline;
> }
>   }
> }


John
-- 
use Perl;
program
fulfillment

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



Re: shifting through arrays of line data

2003-02-28 Thread R. Joseph Newton
"John W. Krahn" wrote:

> "R. Joseph Newton" wrote:
> >
> > Deb wrote:
> > >
> > > I have an array in which each element is a line commandline data.  It looks
> > > something like this -
> > >...
> > > post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> > > post2: -x tel -h post2
> > > post3: -h post3 -x hifi
> > >
> ...  
> What is the comma doing there?
>
> ..  ^
> Missing semicolon.
>

Hi John,

Thanks for catching that.  I guess i shold run my psuedocode through the command line 
instead of composing it in the mailer.  Cleaned it up a little, ut it in a test stub, 
and now it achieves the functionality described:

#!/usr/bin/perl -w

use strict;
use warnings;

my $string = "post1: -r [EMAIL PROTECTED] -x cat-100 -h post1";
my %relationships;

sub getRelationship($$);
getRelationship($string, \%relationships);


sub getRelationship ($$) {
  my ($commandline, $relationships) = @_;
  print "$commandline\n";
  my @commands = split /\s+-/, $commandline;
  my $key = shift(@commands);
  foreach (@commands) {
if (s/^x\s+//) {$$relationships{$key} = $_;}
  }
}
foreach my $key (keys %relationships) {
   print "$key:=$relationships{$key}\n";
}

Joseph



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



Re: shifting through arrays of line data

2003-02-28 Thread R. Joseph Newton
Deb wrote:

> Hi Guys,
>
> I have an array in which each element is a line commandline data.  It looks
> something like this -
>
> @Array contains lines:
>
> post1: -r [EMAIL PROTECTED] -x cat-100 -h post1
> post2: -x tel -h post2
> post3: -h post3 -x hifi

The getRelationships sub here has a few less typos, and the test stub runs well.

#!/usr/bin/perl -w

use strict;
use warnings;

sub getRelationship($$);

testGetRelationships();

sub testGetRelationships {
  my $string = "post1: -r [EMAIL PROTECTED] -x cat-100 -h post1";
  my %relationships;

  getRelationship($string, \%relationships);

  foreach my $key (keys %relationships) {
 print "$key:=$relationships{$key}\n";
  }
}

sub getRelationship ($$) {
  my ($commandline, $relationships) = @_;
 # print "$commandline\n";   #debug
  my @commands = split /\s+-/, $commandline;
  my $key = shift(@commands);
  foreach (@commands) {
if (s/^x\s+//) {$$relationships{$key} = $_;}
  }
}





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



Help me about DBM file

2003-02-28 Thread lielie meimei
Hi... me is still newbie..

Would u help me to explain:
1. How the DBM file work??
2. How to delete all data in a DBM file?
3. What can i do with the *.dir and *.pag file that
DBM produce???, because if i open the *.dir and *.pag
file, it's text not clear to read.
4. What is the use of *.dir and *.pag file??


 Please help me explain complete about the DBM file, 
because i don't have complete tutorial and reference.

If u have the url of complete tutorial DBM ..give to
me please...:)


Thanks for your help.

Lielie

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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