Re: Does optimizing Perl speed up Perl programs?

2001-07-31 Thread Paul Johnson

On Mon, Jul 30, 2001 at 11:43:25AM -0500, Steve Snyder wrote:

>If I improve the performance 
> of perl itself (by building it with different compiler switches) will this 
> translate into improved runtime performance in the perl program itself?  

Yes.

Add -Doptimize='FLAGS' to your Configure line.  But make sure perl still
passes all its tests.

Historically some compilers have had problems optimising some parts of
perl, although this is rarer nowadays.

> My (dim) understanding is that perl works as a sort of runtime compiler.  
> This leave me uncertain if a faster perl build/installation will actually 
> run the programs faster or simply "compile" them faster at startup, leaving 
> the runtime performance unchanged.

It should do both.  It's probably worth benchmarking if it's important
to you.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

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




Standard O/I problems

2001-07-31 Thread Narvàez Rommel

Dear Sirs,

I had problems with O/I in Perl way of programming. When I used shell scripts it was 
very easy I put only in this form "./build_aux $1 > $file 2>&1&" and I got a file with 
standard error as well.
In perl I had running a shell script inside a variable this shell scripts is 
generating an error but I can't got the error to my file that contents my standart 
output. I woul be gratful to get tips in the way about How to resolve this litle issue.

I look to hearing from you

Rommel Narváez

_
Rommel Narváez M.Sc.
Volvo IT
Product Data Managment
Dept 9112, PVÖS32
SE-405 08  Gothenburg, Sweden
Telephone: +46 31 32 144 37
E-mail: [EMAIL PROTECTED]



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




Part II of the OO tutorial is available

2001-07-31 Thread Jos I. Boumans

L.S,

For those who read and enjoyed part one of my OO tutorial, part two is now available 
at http://japh.nu

also, thanks a lot for the feedback on my materials, it was most helpfull!

regards,

Jos Boumans

PS. My appologies for those that are 'spammed' by this.



cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Narendran Kumaraguru Nathan

Hai Guys,

  I am compiling a perl code (arround 200 lines). I run it with perl -w (so that I can 
see all the
warnings). It
reports no warnings and executes. All is fine till I give one input ( like 1..5 ) 
meaning that I
need actions 1 to 5
to be done. Atonce the following error is printed in the screen and the program quits.
error>> Bus error (core dumped)

  The user can specify a command or a series of command if the input is >1 then only 
one command
(for 1)
is executed. if the input is >1 2 , then execution of 2 follows execution of 1 . If 
the input is
>1..5 , then
I wish actions 1 to 5 to be executed one after another.

Now, the way I have implemented  is below
foreach (@line) {
if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
 ($s, $e) = split /\.\./, $_;  # split with the dots to get start and end
 push @line, $s;  # append to the input line
 while ( $s <= $e ) { push @line, $s++; };
}elsif ($_ ==  #  next comparison
# specify to execute commands some input
}

Can anyone give me a clue why this happens?? Or is there a better way of doing this?
Thanks & Regards,
Naren.


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




DBI question ...

2001-07-31 Thread Elie De Brauwer

Hello,
I have a little problem relating a program that I'm writing. This program 
involves getting data from mysql databases.

According to some docs the code should be like

use DBI;
$dbh = BDI->connect('DBI:mysql:databasename:database:host','username','pass') 
or die $DBI::errst;

Now my problem is the following, in order to connect you have to know the 
databasename but I want it to be that the users get a list of possible 
databases, picks one of them and then uses that database.  So simply putting 
a sql show database; to the screen and letting the user pick one out.

BUT before connecting  you already have to know the databasename ... how do i 
solve this ? Or can i stupidly give no databasename ?

-- 
<==>
 requiem aeternam dona eis

 De Brauwer Elie 
   [EMAIL PROTECTED]
<==>

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




Re: DBI question

2001-07-31 Thread eDeveloper

Consider this example :
$drh = DBI->install_driver("mysql");
@databases = $drh->func($host, $port, '_ListDBs');

Now the databases will be assigned into "databases" array

Regards,
eDeveloper
 - Original Message -
From: "Elie De Brauwer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 4:16 PM
Subject: DBI question ...


> Hello,
> I have a little problem relating a program that I'm writing. This program
> involves getting data from mysql databases.
>
> According to some docs the code should be like
>
> use DBI;
> $dbh =
BDI->connect('DBI:mysql:databasename:database:host','username','pass')
> or die $DBI::errst;
>
> Now my problem is the following, in order to connect you have to know the
> databasename but I want it to be that the users get a list of possible
> databases, picks one of them and then uses that database.  So simply
putting
> a sql show database; to the screen and letting the user pick one out.
>
> BUT before connecting  you already have to know the databasename ... how
do i
> solve this ? Or can i stupidly give no databasename ?
>
> --
> <==>
>  requiem aeternam dona eis
>
>  De Brauwer Elie
>[EMAIL PROTECTED]
> <==>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>




substitution

2001-07-31 Thread COLLINEAU Franck FTRD/DMI/TAM

Hi!

I have a file where there is a line whitch begans by the string "".
I would like to remove the string "" by nothing.
How can i do ?

Thanks

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




RE: DBI question ...

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: Elie De Brauwer [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: DBI question ...
> 
> 
> Hello,
> I have a little problem relating a program that I'm writing. 
> This program 
> involves getting data from mysql databases.
> 
> According to some docs the code should be like
> 
> use DBI;
> $dbh = 
> BDI->connect('DBI:mysql:databasename:database:host','username'
> ,'pass') 
> or die $DBI::errst;
> 
> Now my problem is the following, in order to connect you have 
> to know the 
> databasename but I want it to be that the users get a list of 
> possible 
> databases, picks one of them and then uses that database.  So 
> simply putting 
> a sql show database; to the screen and letting the user pick one out.
> 
> BUT before connecting  you already have to know the 
> databasename ... how do i 
> solve this ? Or can i stupidly give no databasename ?

Look at the DBI method data_sources(). Look also at the caveats for this
method in the DBI documentation. I use Oracle, at it works for that, but I
don't know if it works for MySQL. Try the following:

   perl -MDBI -e 'print "$_\n" for DBI->data_sources("mysql")'

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




RE: substitution

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: COLLINEAU Franck FTRD/DMI/TAM 
> [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 8:15 AM
> To: Perl (E-mail)
> Subject: substitution
> 
> 
> Hi!
> 
> I have a file where there is a line whitch begans by the 
> string "". I would like to remove the string 
> "" by nothing. How can i do ?

   perl -pe 's/^//' myfile

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




RE: Expect

2001-07-31 Thread Kipp, James

yes and yes :-)
Thanks

> -Original Message-
> From: Rachel Coleman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 29, 2001 2:07 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Expect
> 
> 
> > Does anyone know where to find good information on the 
> expect module?
> > the camel book did not say much about it.
> 
> Try http://theoryx5.uwinnipeg.ca/CPAN/data/Expect.pm/Expect.html
> 
> Found by my usual route for finding out more about a module, which is:
> 
> 1. Go to www.cpan.org
> 2. Follow the link 'Perl core and CPAN modules documentation 
> (Randy Kobes)'
> 3. Search for module name, usually by 'module name or description'
> 4. If I get a result that looks like what I'm after, following the [
> documentation ] link
> 
> Hope that helps you now, and in the future :)
> 
> Best wishes,
> 
> Rachel
> 
> 
> -- 
> 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: read query string with multiple instances of name/values intohash

2001-07-31 Thread Birgit Kellner

--On Dienstag, 31. Juli 2001 08:13 -0400 "Jeff 'japhy/Marillion' Pinyan" 
<[EMAIL PROTECTED]> wrote:

> On Jul 30, Randal L. Schwartz said:
>
>> Stop right there.  This is not a valid form.  There's no guarantee to
>> the return ordering of form fields. You're lucky if it has worked so
>> far, but I wouldn't even begin to bet an e-commerce site on it.
>>
>> Just generate unique form fields, and all will be well.
>
> From CGI.pm:
>
>  NOTE: As of version 1.5, the array of parameter names
>  returned will be in the same order as they were submitted by
>  the browser.  Usually this order is the same as the order in
>  which the parameters are defined in the form (however, this
>  isn't part of the spec, and so isn't guaranteed).
>
> Perhaps it should be part of the spec.  It seems like browsers do it all
> the time.

Thanks for the information. If it is indeed necessary to have unique 
fields, I reckon I could just use the database key as a name of the input 
field for the number of copies:


$db_key will be numerical, so i'll get a query string like this:
"thisorder=1&15=27&34=0&45=&2=678&db=default"

I can then extract of all key/value-pairs with numerical keys to a hash in 
order to get all values of $db_key, i.e. all entered numbers of copies:

use CGI qw(:standard);
$query = new CGI;
@names = $query->param;
my %copies;
foreach $name (@names) {
if (param($name)) { # exclude cases where the user has not entered a 
number of copies
if (($name =~ /^\d+/) && (param($name) =~ /^[1-9]/)) {
$copies{'$name'} = param($name);
}
}

The regexps in the second if-condition should specify that (a) the name in 
the query-string is numerical, and that (b) it has a numeric value (we 
exclude cases where silly users write words into the copies-field) other 
than 0 (i.e. one that does not start with zero).

For all I can tell, this works. Any ideas for further simplification?

Birgit Kellner



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




check array element (HELP)

2001-07-31 Thread GRANATA ROBERTA

--- Erhalten von  ZBM.ZAGTA 089/32000-414   31-07-01 15.28

hi All,

I have an array of 0...n elements.

I want to check that each element of the array,
must be different to each other.

if it is so -> error,
 else  ->  go on.
please,
Can somebody help me,to write this code.?
thanks in advance,
Best Regards,
roberta

 31-07-01 15.28  Gesendet an   
  -> beginners(A)perl.org

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




simple

2001-07-31 Thread Rahul Garg

Hello,

How can we disable the hyperlink?

Waiting for Reply,
Thanx in advance,
Rahul



RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1

I would probably do this, although i'm sure some smarty-pants could come up
with a one-liner  ;)

sub repeated_elements
{
my %found_one;
for (@_)
{
return 1 if $found_one{$_}++;
}
return 0;
}

if (repeated_elements @whatever)
{
# there are repeated elements
}
else
{
# there are no repeated elements
}

-Original Message-
From: GRANATA ROBERTA [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:28 AM
To: [EMAIL PROTECTED]
Subject: check array element (HELP)


--- Erhalten von  ZBM.ZAGTA 089/32000-414   31-07-01 15.28

hi All,

I have an array of 0...n elements.

I want to check that each element of the array,
must be different to each other.

if it is so -> error,
 else  ->  go on.
please,
Can somebody help me,to write this code.?
thanks in advance,
Best Regards,
roberta

 31-07-01 15.28  Gesendet an   
  -> beginners(A)perl.org

-- 

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]




zipping files with Active State Perl

2001-07-31 Thread Rich Fernandez

Does anyone know how to zip files with Perl on a windows platform?
I have a couple of directories that I want to zip up and archive
periodically.

Thanks!

richf


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




How do I extract 2 elements....

2001-07-31 Thread Santosh M Hulkund


 Hi,
I am new to perl, this is question is very silly and stupid. So,
Please spare me.

Program.
#!/usr/bin/perl -w
@foo = qw ( s a n t o s h )

 Now I want to store the 2nd and 5th element ( i.e. n and s ) from
the array foo to array fo. How do i do it ?

@fo = $foo[ what do i type here]

 With Regards,
 Santosh M Hulkund



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




RE: How do I extract 2 elements....

2001-07-31 Thread Mooney Christophe-CMOONEY1

@fo=@foo[2,5];
^

-Original Message-
From: Santosh M Hulkund [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:02 AM
To: [EMAIL PROTECTED]
Subject: How do I extract 2 elements



 Hi,
I am new to perl, this is question is very silly and stupid. So,
Please spare me.

Program.
#!/usr/bin/perl -w
@foo = qw ( s a n t o s h )

 Now I want to store the 2nd and 5th element ( i.e. n and s ) from
the array foo to array fo. How do i do it ?

@fo = $foo[ what do i type here]

 With Regards,
 Santosh M Hulkund



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




AW: simple

2001-07-31 Thread Alessandro Lenzen

What do you mean by "How can we disable the hyperlink?"
al

-Ursprüngliche Nachricht-
Von: Rahul Garg [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 31. Juli 2001 15:24
An: [EMAIL PROTECTED]
Betreff: simple


Hello,

How can we disable the hyperlink?

Waiting for Reply,
Thanx in advance,
Rahul


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




WG: How do I extract 2 elements....

2001-07-31 Thread Alessandro Lenzen

Try this:

@fo = @foo[2,5];

al

-Ursprüngliche Nachricht-
Von: Santosh M Hulkund [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 31. Juli 2001 16:02
An: [EMAIL PROTECTED]
Betreff: How do I extract 2 elements



 Hi,
I am new to perl, this is question is very silly and stupid. So,
Please spare me.

Program.
#!/usr/bin/perl -w
@foo = qw ( s a n t o s h )

 Now I want to store the 2nd and 5th element ( i.e. n and s ) from
the array foo to array fo. How do i do it ?

@fo = $foo[ what do i type here]

 With Regards,
 Santosh M Hulkund



--
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: How do I extract 2 elements....

2001-07-31 Thread Brett W. McCoy

On Tue, 31 Jul 2001, Santosh M Hulkund wrote:

>   Program.
>   #!/usr/bin/perl -w
>   @foo = qw ( s a n t o s h )
>
>Now I want to store the 2nd and 5th element ( i.e. n and s ) from
> the array foo to array fo. How do i do it ?
>
>   @fo = $foo[ what do i type here]

@fo = @foo[2,5];

(note that array slices use the @ operator)

-- Brett
   http://www.chapelperilous.net/btfwk/

I don't do it for the money.
-- Donald Trump, Art of the Deal


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




RE: check array element (HELP)

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 9:44 AM
> To: [EMAIL PROTECTED]
> Subject: RE: check array element (HELP)
> 
> 
> I would probably do this, although i'm sure some smarty-pants 
> could come up with a one-liner  ;)
> 
> sub repeated_elements
> {
>   my %found_one;
>   for (@_)
>   {
>   return 1 if $found_one{$_}++;
>   }
>   return 0;
> }

One-liner:

   print "Duplicates!" if keys %{{ map { ($_ => 1) } @arr }} != @arr;

Note: Do NOT use this! Along with being quite unreadable, it's also
inefficient. Use the iterative approach above.

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




"multipart/form-data" Method "POST" to cgi script not working

2001-07-31 Thread mlists

Hello all,

If anyone could shed some light on this I would be in there debt. I know
what the BIG problem is...these scripts where written in perl5.004 and we
have moved or are moving to 5.6.0, but I don't know where to start looking
to fix the code so that is works with 5.6.0.

This is a "multipart/form-data" form, using method "POST" I'm unable to
retrieve the params passed to the cgi via "$cgi->param('PARAM')", HOWEVER,
if the method is "GET" the "$cgi->param('PARAM')" works, but "GET" is not
supposed to work with "multipart/form-data" and doesn't in actually getting
the file sent by the user via an upload script.

I've even gone over the httpd.conf in hopes that it could be in there.
Everything is install RPM, but I've also tried source with the same results.
I will try to include everything that will be of help, but if I forget
something just e-mail me and I'll get it for you.



Thanks in advance,
Chris



# From rpm -qa

apache-1.3.19-5
mod_perl-1.24_01-2
perl-5.6.0-12

# From the error_log after apache startup
#
Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6
mod_perl/1.24_01 ApacheJServ/1.1.2 configured -- resuming normal operations

# From "perl -v"
##
This is perl, v5.6.0 built for i386-linux

Copyright 1987-2000, Larry Wall

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.0 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.


 This is for that application in httpd.conf
###

## Contract Underwriting test##

Options Includes FollowSymLinks ExecCGI
AllowOverride FileInfo AuthConfig Limit Indexes

AuthName DBI
AuthType Basic

PerlAuthenHandler Apache::AuthenDBI
PerlAuthzHandler Apache::AuthzDBI

PerlSetVar Auth_DBI_data_source dbi:Oracle:something.something.tgic.com
PerlSetVar Auth_DBI_usernamesomething
PerlSetVar Auth_DBI_passwordsomething
PerlSetVar Auth_DBI_pwd_table   user_tbl
PerlSetVar Auth_DBI_grp_table   user_tbl
PerlSetVar Auth_DBI_uid_field   USER_NAME
PerlSetVar Auth_DBI_pwd_field   USER_PSWD
PerlSetVar Auth_DBI_pwd_whereclause CU='Y'


order allow,deny
allow from all
require valid-user




SetHandler perl-script
PerlHandler Apache::Registry
Options Includes FollowSymLinks ExecCGI

## End Contract test##



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




Re: substitution

2001-07-31 Thread Stephen P. Potter

Lightning flashed, thunder crashed and COLLINEAU Franck FTRD/DMI/TAM  whispered:
| I have a file where there is a line whitch begans by the string "".
| I would like to remove the string "" by nothing.
| How can i do ?

I'm pretty sure a question almost exactly like this was asked and answered
yesterday, the day before that, the day before that, and probably two days
before that.  The answer is always going to be some variant of

perl -i.bak -pe 's/^//' filename

This will first create a backup file called filename.bak (-i.bak).  This
will loop over the file printing all the lines after they've been worked
with (-pe).  If a line starts with , the  will be removed.

-spp
--
Stephen P Potter [EMAIL PROTECTED]
"You can't just magically invoke Larry and expect that to prove your point.
Or prove that you have a point."-Simon Cozens
UNIX, Perl, PHP, Web Consulting and Training  http://www.unixlabs.net/~spp/

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




Security Question

2001-07-31 Thread Customer Service

Dear Sirs,
I first of all wanted to apologize about sending so many redundant questions
to the list.  I wasn’t aware that my wife was downloading my mail also and I
didn’t see all of your replies to previous questions.  Won’t happen again
;-))

I was reading a reply to a question this morning that stated that the open()
call is a big security hole because someone could put in ";rm -rf ."  as the
value for $email.
What does ";rm -rf ." do?  Why is it so dangerous?

Nathan Garlington
[EMAIL PROTECTED] 




Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Stephen P. Potter

Lightning flashed, thunder crashed and Narendran Kumaraguru Nathan  whispered:
| Now, the way I have implemented  is below
| foreach (@line) {
| if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
|  ($s, $e) = split /\.\./, $_;  # split with the dots to get start and end
|  push @line, $s;  # append to the input line
|  while ( $s <= $e ) { push @line, $s++; };
| }elsif ($_ ==  #  next comparison
| # specify to execute commands some input
| }

Without seeing all your code, it is difficult to really say what exactly is
happening.  The first thing I see here is that your code is incomplete:

}elsif ($_ ==

That would cause major problems right there.

The second thing I notice is that you are modifying the array @line inside
the loop.  That is certain to confuse the parser.  You may need to rethink
how you are doing this so that you don't have to modify the array inside
the loop.

-spp
--
Stephen P Potter [EMAIL PROTECTED]
"You can't just magically invoke Larry and expect that to prove your point.
Or prove that you have a point."-Simon Cozens
UNIX, Perl, PHP, Web Consulting and Training  http://www.unixlabs.net/~spp/

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




RE: Security Question

2001-07-31 Thread Mooney Christophe-CMOONEY1

'rm -rf .' is a unix command that removes everything in the current
direcotry PERMANENTLY and UNCONDITIONALLY

-Original Message-
From: Customer Service [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:44 AM
To: Perl Beginners
Subject: Security Question


Dear Sirs,
I first of all wanted to apologize about sending so many redundant questions
to the list.  I wasn't aware that my wife was downloading my mail also and I
didn't see all of your replies to previous questions.  Won't happen again
;-))

I was reading a reply to a question this morning that stated that the open()
call is a big security hole because someone could put in ";rm -rf ."  as the
value for $email.
What does ";rm -rf ." do?  Why is it so dangerous?

Nathan Garlington
[EMAIL PROTECTED] 


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




Exec cgi

2001-07-31 Thread Tiago Almeida Spritzer

Hi,

 Anybody help me with this question?
 I have two folders at the server, one with perl files and other with
html files. I need that the page index.html execute perl file, and I know
that this TAG do that .  But I try and don't obtain
any result.

Regards,




Tiago Almeida Spritzer
IBM - Sales Operations Support - Brasil
E-mail: [EMAIL PROTECTED]


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




RE: Security Question

2001-07-31 Thread Mooney Christophe-CMOONEY1

Actually, open is only a security hole if you allow the user to tell you
what to open at the command line.

i don't have the exact message in front of me, but my guess is that someone
said something like:

$_=;
open(IN,"$_|");

In which case if the user entered 'rm -rf /', it would try to delete
everything.  This would be especially disastrous if the script were run as a
superuser, in which case everything on the system would irretrievably vanish
in the blink of an eye.

So don't be afraid to use 'open' if you know exactly what you're opening ...
;)

-Original Message-
From: Mooney Christophe-CMOONEY1
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:41 AM
To: Perl Beginners
Subject: RE: Security Question


'rm -rf .' is a unix command that removes everything in the current
direcotry PERMANENTLY and UNCONDITIONALLY

-Original Message-
From: Customer Service [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:44 AM
To: Perl Beginners
Subject: Security Question


Dear Sirs,
I first of all wanted to apologize about sending so many redundant questions
to the list.  I wasn't aware that my wife was downloading my mail also and I
didn't see all of your replies to previous questions.  Won't happen again
;-))

I was reading a reply to a question this morning that stated that the open()
call is a big security hole because someone could put in ";rm -rf ."  as the
value for $email.
What does ";rm -rf ." do?  Why is it so dangerous?

Nathan Garlington
[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: Security Question

2001-07-31 Thread Brett W. McCoy

On Tue, 31 Jul 2001, Customer Service wrote:

> I was reading a reply to a question this morning that stated that the open()
> call is a big security hole because someone could put in ";rm -rf ."  as the
> value for $email.
> What does ";rm -rf ." do?  Why is it so dangerous?

rm -rf deletes everything from the current directory and all
sub-directories below it recursively.  It's a Unix command, and in Unix
also, you can run multiple commands sequentially by separating them with a
semi-colon.

-- Brett
   http://www.chapelperilous.net/btfwk/

"Nuclear war would really set back cable."
-- Ted Turner


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




Splitting a string into a Array of Arrays

2001-07-31 Thread Will Muir

I know this is simpler then what I am making it but I am stumped.  I used 
LWP::UserAgent to fetch some data from a web page, What I need to do is to load the 
data which I believe is just one long string that I got from calling content() into an 
array of arrays by splitting on "\n" and ",".

Like I said I don't think this is that hard to do but I am not seeing the light here, 
I am pretty new to this so please be gentle with me.

Here is the relevant code.

sub quotes{
 my $content = get_content();
 my (@data,$i);
 my @rows=split/\n/,$content;
 $i=0;
 foreach my $element (@rows){
  $data[$i]=split(/,/,$element);
  $i++;
  }  
  return @data;
 }

Thanks in advance.

Will



RE: Security Question (follow-up question)

2001-07-31 Thread Bob Mangold

This is somewhat alarming to me because I hadn't realized this potential
before, but is there an easy way to check what is being opened. Would using a
-f() or -d() to verify that you were actually opening a file or directory do
the trick?

-Bob

--- Mooney Christophe-CMOONEY1 <[EMAIL PROTECTED]> wrote:
> Actually, open is only a security hole if you allow the user to tell you
> what to open at the command line.
> 
> i don't have the exact message in front of me, but my guess is that someone
> said something like:
> 
> $_=;
> open(IN,"$_|");
> 
> In which case if the user entered 'rm -rf /', it would try to delete
> everything.  This would be especially disastrous if the script were run as a
> superuser, in which case everything on the system would irretrievably vanish
> in the blink of an eye.
> 
> So don't be afraid to use 'open' if you know exactly what you're opening ...
> ;)
> 
> -Original Message-
> From: Mooney Christophe-CMOONEY1
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 9:41 AM
> To: Perl Beginners
> Subject: RE: Security Question
> 
> 
> 'rm -rf .' is a unix command that removes everything in the current
> direcotry PERMANENTLY and UNCONDITIONALLY
> 
> -Original Message-
> From: Customer Service [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 9:44 AM
> To: Perl Beginners
> Subject: Security Question
> 
> 
> Dear Sirs,
> I first of all wanted to apologize about sending so many redundant questions
> to the list.  I wasn't aware that my wife was downloading my mail also and I
> didn't see all of your replies to previous questions.  Won't happen again
> ;-))
> 
> I was reading a reply to a question this morning that stated that the open()
> call is a big security hole because someone could put in ";rm -rf ."  as the
> value for $email.
> What does ";rm -rf ." do?  Why is it so dangerous?
> 
> Nathan Garlington
> [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]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




RE: Splitting a string into a Array of Arrays

2001-07-31 Thread Mooney Christophe-CMOONEY1

You're actually very close.  I would just change a couple of things.

First of all, you don't need @data as well as @rows.  $element is aliased to
each element in the array as it loops, so you can re-assign right back into
the same array when you split.  This will cause the loop to independent of
the order in which it reads the elements from @rows, which means you don't
need '$i' as well.

Second, when you create your nested array, you need to use [].

sub quotes
{
my $content = get_content();
my @rows=split/\n/,$content;
foreach my $element (@rows)
{
$element=[split(/,/,$element)];
}
return @rows;
}

As a matter of personal style, i prefer to take advantage of the default
variable, since i find it easier to read, though others may not:

sub quotes
{
my @rows = split /\n/, get_content;
$_=[split /,/] for @rows;
return @rows;
}

Or if you want to be COOL like Bob  ;)

sub quotes {map {[split /,/]} split /\n/, get_content}

And i think in this case using 'map' would be okay, since it's going to have
to loop over the entire array anyway.  Am i wrong ... ?

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




module File::Copy

2001-07-31 Thread COLLINEAU Franck FTRD/DMI/TAM

Hello!

I have a problem with this code:

#!/usr/bin/perl -w
use File::Copy;
open (CONCAT,"lmi/concat.htm") || die "impossible d'ouvrir concat.htm:
$!\n";
open (CONCAT2,">lmi/concat2.htm") || die "impossible d'ouvrir concat2.htm:
$!\n";
while()
{
s///i;
print (CONCAT2 $_);
}
 close (CONCAT);
 close (CONCAT2);
copy("lmi/concat.htm","lmi/concat2.htm");
unlink("lmi/concat2.htm");


there are two problems: the instruction s///i doesn't work and
copying files doesn't work too.

can anybody help me ?

Thanks 

Franck

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




connecting to program

2001-07-31 Thread Peter

hi all,

 i am trying to call a c program (main.exe) using these. 
the c program resides in a different machine from the script.

the comline scalar just adds on different parameters for the program.

i feel like im doing something wrong with my system call.  is a call to
a url allowed?  

---
&ReadParse(*para);
$| = 1;
&checkSCode;
foreach $name ( keys(%para) ) {
push(@query, "$name=$para{$name}");
}
$comline = join("\&", @query);
# print $comline;
# generate the chart by calling 'gifChart'
system("http:///cgichart/main.exe $comline");
---

thanks,
peter


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




RE: Exec cgi

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: Tiago Almeida Spritzer [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: Exec cgi
> 
> 
> Hi,
> 
>  Anybody help me with this question?
>  I have two folders at the server, one with perl files 
> and other with html files. I need that the page index.html 
> execute perl file, and I know that this TAG do that .  But I 
> try and don't obtain any result.

Are you sure the server is configured for server side includes? Does
something simple the following work?

   

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




RE: Exec cgi

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: Tiago Almeida Spritzer [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: Exec cgi
> 
> 
> Hi,
> 
>  Anybody help me with this question?
>  I have two folders at the server, one with perl files 
> and other with html files. I need that the page index.html 
> execute perl file, and I know that this TAG do that .  But I 
> try and don't obtain any result.

Forgot to add: the argument to #exec cgi is a URL, not a filespec.

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




Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Ken

When I remove the incomplete elsif this runs fine on my system (with an
added line before the while to read in @line @line =
scalar();)

What version of Perl are you running?  Did you install it?  Did it past all
of the tests?

Can you send us a complete sample program that gives this same error?

Ken

- Original Message -
From: "Narendran Kumaraguru Nathan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 5:09 AM
Subject: cannot fix an error - "Bus error (core dumped) "


> Hai Guys,
>
>   I am compiling a perl code (arround 200 lines). I run it with perl -w
(so that I can see all the
> warnings). It
> reports no warnings and executes. All is fine till I give one input ( like
1..5 ) meaning that I
> need actions 1 to 5
> to be done. Atonce the following error is printed in the screen and the
program quits.
> error>> Bus error (core dumped)
>
>   The user can specify a command or a series of command if the input is >1
then only one command
> (for 1)
> is executed. if the input is >1 2 , then execution of 2 follows execution
of 1 . If the input is
> >1..5 , then
> I wish actions 1 to 5 to be executed one after another.
>
> Now, the way I have implemented  is below
> foreach (@line) {
> if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
>  ($s, $e) = split /\.\./, $_;  # split with the dots to get start and
end
>  push @line, $s;  # append to the input line
>  while ( $s <= $e ) { push @line, $s++; };
> }elsif ($_ ==  #  next comparison
> # specify to execute commands some input
> }
>
> Can anyone give me a clue why this happens?? Or is there a better way of
doing this?
> Thanks & Regards,
> Naren.
>
>
> --
> 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: connecting to program

2001-07-31 Thread Brett W. McCoy

On Tue, 31 Jul 2001, Peter wrote:

>  i am trying to call a c program (main.exe) using these.
> the c program resides in a different machine from the script.
>
> the comline scalar just adds on different parameters for the program.
>
> i feel like im doing something wrong with my system call.  is a call to
> a url allowed?

Not through system.  You will need to use LWP to run executables through a
URL (assuming that the remote machine will let you run that program this
way).  Otherwise you will need to run the program through some other, and
hopefully secure, means of executing remote programs, like ssh.

- Brett
   http://www.chapelperilous.net/btfwk/

I disagree with what you say, but will defend to the death your right to
tell such LIES!


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




automatically naming scalars

2001-07-31 Thread Ron Woodall

Hi:

I'm trying to take a word from a file and naming a scalar with that word. 
i.e. I find the word "target" in a file. I then need to create $target = 
"xxx" and various other variables related to target. Any suggestions?

Thanks for the help.

Ron


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




Re: automatically naming scalars

2001-07-31 Thread Brett W. McCoy

On Tue, 31 Jul 2001, Ron Woodall wrote:

>   I'm trying to take a word from a file and naming a scalar with
> that word.  i.e. I find the word "target" in a file. I then need to
> create $target = "xxx" and various other variables related to target.
> Any suggestions?

Create a hash containing the keywords in the file:

$akey = 'target';

$file_data{$akey} = 'xxx';

Or even a more complex data structure:

$file_data{$akey} = { xxx => 'stuff',
 yyy => [1, 2, 3]
};

How exactly is the data in the file organized?

-- Brett
   http://www.chapelperilous.net/btfwk/

"Die?  I should say not, dear fellow.  No Barrymore would allow such a
conventional thing to happen to him."
-- John Barrymore's dying words


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




Re: DBI question ...

2001-07-31 Thread smoot

> Elie De Brauwer <[EMAIL PROTECTED]> said:

> use DBI;
> $dbh = BDI->connect('DBI:mysql:databasename:database:host','username','pass') 
> or die $DBI::errst;
> 
> Now my problem is the following, in order to connect you have to know the 
> databasename but I want it to be that the users get a list of possible 
> databases, picks one of them and then uses that database.  So simply putting 
> a sql show database; to the screen and letting the user pick one out.

> BUT before connecting  you already have to know the databasename ... how do i 
> solve this ? Or can i stupidly give no databasename ?

You can leave the database name empty.  Then you can do the following to get
the database list:

$db_ref = $dbh->selectcol_arrayref("SHOW DATABASES;");

Another connect call with the database name filled in selects the correct 
database.

I wrote a generic CGI package to do this for MySQL and it works quite well.

-- 
Smoot Carl-Mitchell
Consultant




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




beginners@perl.org

2001-07-31 Thread Christiam Camacho

Hello,
 Is the only difference between "and" and "&&" and
"or" and "||" the precedence of the operators?
In other words, how do these statements differ (e.g.:
is any more efficient than the other?):

open(FH,$in_file) or die "Couldn't open $in_file: $!"
open(FH,$in_file) || die "Couldn't open $in_file: $!"

Thanks,

Christiam


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




beginners@perl.org

2001-07-31 Thread Jeff 'japhy/Marillion' Pinyan

On Jul 31, Christiam Camacho said:

> Is the only difference between "and" and "&&" and
>"or" and "||" the precedence of the operators?

&& has higher precedence (it binds more tightly) than 'and'.

  $x = 2 and 5;  # ($x = 2) and 5;
  $x = 2 &&  5'  # $x = (2 && 5);

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


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




Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Karthik Krishnamurthy

you seem to be using a SUN SPARC. A bus error is often induced on these architectures 
when pointer 
access is not aligned on word boundary. 

whether this is caused by the Perl binary itself or the script i don't know
/kk

On Tue, Jul 31, 2001 at 04:39:54PM +0530, Narendran Kumaraguru Nathan wrote:
> Hai Guys,
> 
>   I am compiling a perl code (arround 200 lines). I run it with perl -w (so that I 
>can see all the
> warnings). It
> reports no warnings and executes. All is fine till I give one input ( like 1..5 ) 
>meaning that I
> need actions 1 to 5
> to be done. Atonce the following error is printed in the screen and the program 
>quits.
> error>> Bus error (core dumped)
> 
>   The user can specify a command or a series of command if the input is >1 then only 
>one command
> (for 1)
> is executed. if the input is >1 2 , then execution of 2 follows execution of 1 . If 
>the input is
> >1..5 , then
> I wish actions 1 to 5 to be executed one after another.
> 
> Now, the way I have implemented  is below
> foreach (@line) {
> if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
>  ($s, $e) = split /\.\./, $_;  # split with the dots to get start and end
>  push @line, $s;  # append to the input line
>  while ( $s <= $e ) { push @line, $s++; };
> }elsif ($_ ==  #  next comparison
> # specify to execute commands some input
> }
> 
> Can anyone give me a clue why this happens?? Or is there a better way of doing this?
> Thanks & Regards,
> Naren.
> 
> 
> -- 
> 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]




How can you tell what version of a Perl Module you're using?

2001-07-31 Thread mlists



How can you tell what version of a Perl Module you're using? i.e. CGI.pm


Thanks

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




Incorporating script

2001-07-31 Thread Najamuddin, Junaid

Hi,
If someone can help me out please
I wrote a perl script which opens two text files and then compares them and
spit out the difference. It is an error checking program which runs on NT
Platform. The first file has all the required processes listed and the
second file lists current running processes.
The second file is being generated at time intervals thru running a bat file
manually. When you run that batch file it generates the second text file
which has the current processes running.
I want to ask you how I can incorporate that batch file in my script so that
it can run on specified time intervals. After running the bat file the
resultant text file is going to be my second file in the script.
I want my script to kick off automatically at predefined time intervals, run
bat file and then use the text file generated by bat file as the second file
in the script.

Can someone help me on this please

Thanks
Junaid

Here is the script

use Win32;

my($snapshot, $baseline);   # Defining txt files 

# First file
$snapshot = "./secondfile.txt"; # List of Svcs currently running, should be
generated by the bat file

# Second file
$baseline = "./firstfile.txt";  # List of All Svcs which should be running

my(@arr1, @arr2, @result);  # Defining arrays
my($fld1, $fld2, $fld3, $fld4); # Defining variables for fields
my($match, $cnt, $val1, $val2, $finalresult); # Defining scalar variables
$match = "N"; 

#Open snapshot file and insert every line into @arr1
open(SNAPSHOT, $snapshot) or die "Unable to open $snapshot."; # Open the txt
file and place it in filehandle   

$cnt = 0;
while (  ) # Looping thru the filehandle snapshot
 {
$arr1[$cnt] = $_;
$cnt = $cnt + 1;
  } 
  close (SNAPSHOT); # close the filehandle snapshot

#Open baseline file and insert every line into @arr2
open(BASELINE, $baseline) or die "Unable to open $baseline."; # Open the txt
file and place it in filehandle  

$cnt = 0;
while (  ) # Looping thru the filehandle baseline
{
$arr2[$cnt] = $_;
$cnt = $cnt + 1;
  } 
  close (BASELINE); # close filehandle baseline

# Outer loop is for baseline file
# Inner loop is for snapshot file
# Taking one element from @arr2 (baseline) and comparing it with all the
elements in @arr1(snapshot) and 
# If their is no match then insert that name into finalresult.

$cnt = 0;
foreach $val2 (@arr2) # referring to baseline
{
foreach $val1 (@arr1) # referring to snapshot
{
if ($val1 eq $val2) 
{
$match = "Y";
}
}
if  ($match eq "N") 
{
$result[$cnt] = $val2;
$cnt = $cnt + 1;
}

$match = "N";
}

$finalresult = 0; # initializing to zero
foreach $val1 (@result)
{
$finalresult = $finalresult + 1;
}

if ($finalresult >  0 ) 
{
print "\nList of process not running \n\n"; # If some svc is not
functioning
foreach $val1 (@result)
{
($fld1,$fld2,$fld3,$fld4) =  split(/\|/,"$val1");#
separating req fields for output

}
}
else
{
print "\nAll process are running \n"; # When all svcs are running
fine
}


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




Re: How can you tell what version of a Perl Module you're using?

2001-07-31 Thread Peter Scott

At 12:14 PM 7/31/2001 -0700, mlists wrote:


>How can you tell what version of a Perl Module you're using? i.e. CGI.pm

print $::VERSION, e.g. (Windows example):

C:>perl -MCGI -le "print $CGI::VERSION"
2.56




Peter Scott
[EMAIL PROTECTED]
http://www.perldebugged.com


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




perl and graphics

2001-07-31 Thread Matt Behrens

Hi all-

I'm currently trying to find a way to batch the conversion of thousands of
tiff files to jpg files.  I have written perl before, but I haven't been
able to find much on graphics with PERL.  Is this possible?  Is it worth the
time to try it?  Any helpful hints?

Thanks for any comments!!

Matt

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




Re: Security Question (follow-up question)

2001-07-31 Thread smoot

> Bob Mangold <[EMAIL PROTECTED]> said:

> This is somewhat alarming to me because I hadn't realized this potential
> before, but is there an easy way to check what is being opened. Would using a
> -f() or -d() to verify that you were actually opening a file or directory do
> the trick?

Be mindful that you can only execute a command when doing a pipe open.  What 
perl does under the covers is takes the second argument as a command string 
and executes the command string as a shell command.  The shell is a very 
general purpose scripting language and you can do all sorts of unintended 
stuff with it.

The rule here is do not trust anything the user sends you as input. If you 
really do not trust executing a shell when doing a pipe open, you can roll 
your own interprocess communication primitives with the pipe, exec, and fork 
functions.

-- 
Smoot Carl-Mitchell
Consultant





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




Re: How can you tell what version of a Perl Module you're using?

2001-07-31 Thread Troy Denkinger

On Tuesday 31 July 2001 15:14, mlists wrote:
> How can you tell what version of a Perl Module you're using? i.e. CGI.pm

Hopefully the kind author has defined the $VERSION variable in the module.  
Thus:

print $CGI::VERSION;

will give you the version for CGI.pm.

Regards,

Troy Denkinger


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




RE: perl and graphics

2001-07-31 Thread John Edwards

Take a look at the ImageMagick module.

http://www.simplesystems.org/ImageMagick/www/perl.html

-Original Message-
From: Matt Behrens [mailto:[EMAIL PROTECTED]]
Sent: 31 July 2001 17:19
To: [EMAIL PROTECTED]
Subject: perl and graphics


Hi all-

I'm currently trying to find a way to batch the conversion of thousands of
tiff files to jpg files.  I have written perl before, but I haven't been
able to find much on graphics with PERL.  Is this possible?  Is it worth the
time to try it?  Any helpful hints?

Thanks for any comments!!

Matt

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


--Confidentiality--.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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




RE: perl and graphics

2001-07-31 Thread Mooney Christophe-CMOONEY1

I believe you're looking for Image::Magick from CPAN (www.cpan.org)

-Original Message-
From: Matt Behrens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 11:19 AM
To: [EMAIL PROTECTED]
Subject: perl and graphics


Hi all-

I'm currently trying to find a way to batch the conversion of thousands of
tiff files to jpg files.  I have written perl before, but I haven't been
able to find much on graphics with PERL.  Is this possible?  Is it worth the
time to try it?  Any helpful hints?

Thanks for any comments!!

Matt

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




"multipart/form-data" Method "POST" to cgi script not working

2001-07-31 Thread mlists

Hello all,

If anyone could shed some light on this I would be in there debt. I know
what the BIG problem is...these scripts where written in perl5.004 and we
have moved or are moving to 5.6.0, but I don't know where to start looking
to fix the code so that is works with 5.6.0.

This is a "multipart/form-data" form, using method "POST" I'm unable to
retrieve the params passed to the cgi via "$cgi->param('PARAM')", HOWEVER,
if the method is "GET" the "$cgi->param('PARAM')" works, but "GET" is not
supposed to work with "multipart/form-data" and doesn't in actually getting
the file sent by the user via an upload script.

I've even gone over the httpd.conf in hopes that it could be in there.
Everything is install RPM, but I've also tried source with the same results.
I will try to include everything that will be of help, but if I forget
something just e-mail me and I'll get it for you.



Thanks in advance,
Chris



# From rpm -qa

apache-1.3.19-5
mod_perl-1.24_01-2
perl-5.6.0-12

# From the error_log after apache startup
#
Apache/1.3.19 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6
mod_perl/1.24_01 ApacheJServ/1.1.2 configured -- resuming normal operations

# From "perl -v"
##
This is perl, v5.6.0 built for i386-linux

Copyright 1987-2000, Larry Wall

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.0 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.


 This is for that application in httpd.conf
###

## Contract Underwriting test##

Options Includes FollowSymLinks ExecCGI
AllowOverride FileInfo AuthConfig Limit Indexes

AuthName DBI
AuthType Basic

PerlAuthenHandler Apache::AuthenDBI
PerlAuthzHandler Apache::AuthzDBI

PerlSetVar Auth_DBI_data_source dbi:Oracle:something.something.tgic.com
PerlSetVar Auth_DBI_usernamesomething
PerlSetVar Auth_DBI_passwordsomething
PerlSetVar Auth_DBI_pwd_table   user_tbl
PerlSetVar Auth_DBI_grp_table   user_tbl
PerlSetVar Auth_DBI_uid_field   USER_NAME
PerlSetVar Auth_DBI_pwd_field   USER_PSWD
PerlSetVar Auth_DBI_pwd_whereclause CU='Y'


order allow,deny
allow from all
require valid-user




SetHandler perl-script
PerlHandler Apache::Registry
Options Includes FollowSymLinks ExecCGI

## End Contract test##



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




RE: check array element (HELP)

2001-07-31 Thread Wagner Jeff Civ Logicon/TTMS

Hi,

I am one of the beginners list's many voyeurs.  Can you explain your code?
Where does the "%found_one" hash get its initial value?  I understand that
"@_" represents the list that was passed to the subroutine and that "$_" is
the current list element for each loop iteration.  Does your code assume
that the list is sorted?  How does it compare to this code fragment?

##
sub repeated_elements {

my $list = shift;# passed list reference
my $n= $#{$list};# subscript of last list element

for my $i (0..$n-1) {
for my $j ($i+1..$n) {
if ($list->[$i] eq $list->[$j]) {return 1}
}
}
return 0;
}

if (repeated_elements(\@whatever)) {
print "There are repeated elements\n";
}
else {
print "There are no repeated elements\n";
}
##

Thanks,
Jeff

-Original Message-
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 08:44
To: [EMAIL PROTECTED]
Subject: RE: check array element (HELP)


I would probably do this, although i'm sure some smarty-pants could come up
with a one-liner  ;)

sub repeated_elements
{
my %found_one;
for (@_)
{
return 1 if $found_one{$_}++;
}
return 0;
}

if (repeated_elements @whatever)
{
# there are repeated elements
}
else
{
# there are no repeated elements
}

-Original Message-
From: GRANATA ROBERTA [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:28 AM
To: [EMAIL PROTECTED]
Subject: check array element (HELP)


--- Erhalten von  ZBM.ZAGTA 089/32000-414   31-07-01 15.28

hi All,

I have an array of 0...n elements.

I want to check that each element of the array,
must be different to each other.

if it is so -> error,
 else  ->  go on.
please,
Can somebody help me,to write this code.?
thanks in advance,
Best Regards,
roberta

 31-07-01 15.28  Gesendet an   
  -> beginners(A)perl.org

-- 

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: module File::Copy

2001-07-31 Thread Chris Milligan



COLLINEAU wrote:

> copy("lmi/concat.htm","lmi/concat2.htm");
> unlink("lmi/concat2.htm");
>
> there are two problems: the instruction s///i doesn't work

I don't know about this one.

> copying files doesn't work too.
>

The problem here is you are doing the copy, with
copy("lmi/concat.htm","lmi/concat2.htm");
But the very next line you delete the new file
unlink("lmi/concat2.htm");

>
> can anybody help me ?
>
> Thanks
>
> Franck

--
Life would be so much easier if we could just look at the source code.



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




RE: module File::Copy

2001-07-31 Thread mark crowe (JIC)

Hi Franck

If copy is doing what I suspect, that could be your problem. I'm guessing
that the function is "copy ('old_file', 'new_file')", rather than, as you've
used it "copy('new_file', 'old_file')". If that is the case (check the
File::Copy documentation) then what your program would seem to do is open
your original file, make all the substitutions and save it (so far so good).
Then it copies the original file over top of the new file, and then deletes
this new copy. Oops.

Try swapping round the file names in the copy command, or comment out both
that and the unlink line.

Cheers

Mark

> -Original Message-
> From: COLLINEAU Franck FTRD/DMI/TAM
> [mailto:[EMAIL PROTECTED]]
> Sent: 31 July 2001 16:18
> To: Perl (E-mail)
> Subject: module File::Copy
> 
> 
> Hello!
> 
> I have a problem with this code:
> 
> #!/usr/bin/perl -w
> use File::Copy;
> open (CONCAT,"lmi/concat.htm") || die "impossible d'ouvrir concat.htm:
> $!\n";
> open (CONCAT2,">lmi/concat2.htm") || die "impossible d'ouvrir 
> concat2.htm:
> $!\n";
> while()
> {
>   s///i;
>   print (CONCAT2 $_);
> }
>  close (CONCAT);
>  close (CONCAT2);
> copy("lmi/concat.htm","lmi/concat2.htm");
> unlink("lmi/concat2.htm");
> 
> 
> there are two problems: the instruction s///i doesn't work and
> copying files doesn't work too.
> 
> can anybody help me ?
> 
> Thanks 
> 
> Franck
> 
> -- 
> 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: Standard O/I problems

2001-07-31 Thread John Fox

Rommel,

Please wrap your lines at 75 or 80 columns; it makes things much more
readable!

You wrote:
> I had problems with O/I in Perl way of programming. When I used
> shell scripts it was very easy I put only in this form "./build_aux
> $1 > $file 2>&1&" and I got a file with standard error as well.
>
> In perl I had running a shell script inside a variable this shell
> scripts is generating an error but I can't got the error to my file
> that contents my standart output. I woul be gratful to get tips in
> the way about How to resolve this litle issue.

Because no specifics were given, I'll assume that your perl code
is using perl's system() function to run the shell script.  In that
case, you'd basically use the same methodology as you did in the
shell:

  system("./build_aux $aux_argument >$output_file 2>&1");

You could also get the same results by experimenting with
the backticks and open() methods, but neither is as appropriate
as system().

John
-- 
   John Fox <[EMAIL PROTECTED]>
System Administrator, InfoStructure, Ashland OR USA
  -
"What is loved endures.  And Babylon 5 ... Babylon 5 endures."
  --Delenn, "Rising Stars", Babylon 5

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




Re: read query string with multiple instances of name/values into hash

2001-07-31 Thread Damien Salvador

On Tue, Jul 31, 2001, Birgit Kellner wrote:
> --On Dienstag, 31. Juli 2001 08:13 -0400 "Jeff 'japhy/Marillion' Pinyan" 
> <[EMAIL PROTECTED]> wrote:
> 
> Thanks for the information. If it is indeed necessary to have unique 
> fields, I reckon I could just use the database key as a name of the input 
> field for the number of copies:
> 
> 
> For all I can tell, this works. Any ideas for further simplification?

I would think it's a perfect thingy for XML :-)
HTML forms are so bad for multi-valued fields !
you have to build a string like with your 'form'

 
  1
  Stephenson
  Treasure island
  12
 
 
  2
  Dickens
  Oliver Twist
  10
 


and then parse it :-) but I'm not proficient with the XML parser


but it would generate a tree easy to access for further processing.

Only drawback I see imeediately is the need for the browser to do some
processing (but quite simple) in some script langage to build the string.

-- 
Damien
You can tune a piano, but you can't tuna fish.

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




RE: connecting to program

2001-07-31 Thread Peter

hi,

  hmm...i'll try backing up a bit.  basically this is what i want to do.

  a webpage that screens for stocks. variables from the webpage is sent
to a perl script which displays (in html format) charts based on the values
and parameters passed.

  the perl script calls upon another script to display the charts. the
second script
makes a system call to main.exe (the charting program).

ie.
from FirstScript.
$basicParam = "/cgi/SecondScript.pl?symbol=${symbol};



from SecondScript
&ReadParse(*para);
foreach $name ( keys(%para) ) {
push(@query, "$name=$para{$name}");
}
#various parameters
$comline = join("\&", @query);
system("/cgi/main.exe $comline");

so my question is...
how do i connect the second script to the charting program?  use an LWP
package?

thanks,
pete





-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 8:52 AM
To: Peter Lee
Cc: [EMAIL PROTECTED]
Subject: Re: connecting to program


On Tue, 31 Jul 2001, Peter wrote:

>  i am trying to call a c program (main.exe) using these.
> the c program resides in a different machine from the script.
>
> the comline scalar just adds on different parameters for the program.
>
> i feel like im doing something wrong with my system call.  is a call to
> a url allowed?

Not through system.  You will need to use LWP to run executables through a
URL (assuming that the remote machine will let you run that program this
way).  Otherwise you will need to run the program through some other, and
hopefully secure, means of executing remote programs, like ssh.

- Brett
   http://www.chapelperilous.net/btfwk/

I disagree with what you say, but will defend to the death your right to
tell such LIES!


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




Mail::IMAPClient::BodyStructure

2001-07-31 Thread Chris Rogers


I am using the Mail::IMAPClient module and the extension BodyStructure to
connect to Exchange Server 5.5.  Everything seems to be working great ( I
love this module ) except for one thing.  When I use the BodyStructure
extension, either nothing is being returned in the object or I don't know
how to access it.  I can log on to server, query the mailbox and all it's
folders without any trouble but I can't seem to get a message bodystructure.
The docs show one example but I can't seem to get it to work for me.  Here's
a snippet of code:
#
use CGI;
use Mail::IMAPClient;
use Mail::IMAPClient::BodyStructure;

$imapp = Mail::IMAPClient->new (
 Server   =>
$servername,
 User =>
$username,
 Password  =>
$password,
 Uid   => 1,
 Debug   => 1
 );
$imapp->select($foldername);
my $struct =
Mail::IMAPClient::BodyStructure->new($imapp->fetch($msguid,"bodystructure"))
;
$btype = $struct->bodytype;
$bsubtype = $struct->bodysubtype;

#

When the code is run, I don't get any errors but I don't get the
bodystructure either.  I have tried this many different ways but none seem
to work.  Having turned on the debug option, I can see that the request is
sent to the server and the server does respond:

3 UID FETCH 12 bodystructure

Sent 30 bytes
Read: * 2 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL
NIL "7BIT" 489 9 NIL NIL NIL) UID 12)
3 OK FETCH completed

If I print $struct, I get the following though the =HASH(...) part varies:
Mail::IMAPClinet::BodyStructure=HASH(0x87d6b64)

If anyone has any ideas, please let me know.  Any help would be greatly
appreciated.

Thanks,
Chris


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




beginners@perl.org

2001-07-31 Thread Brett W. McCoy

On Tue, 31 Jul 2001, Christiam Camacho wrote:

>  Is the only difference between "and" and "&&" and
> "or" and "||" the precedence of the operators?
> In other words, how do these statements differ (e.g.:
> is any more efficient than the other?):
>
> open(FH,$in_file) or die "Couldn't open $in_file: $!"
> open(FH,$in_file) || die "Couldn't open $in_file: $!"

Consider this:

open FH,$in_file or die "Couldn't open $in_file: $!"
open FH,$in_file || die "Couldn't open $in_file: $!"

There's most definitely a difference here, without the parentheses.  The
comma operator has a lower precedence than || (but not or), and it will
change how these statements are evaluated.

-- Brett
   http://www.chapelperilous.net/btfwk/

We are what we are.


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




RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1

'%found_one' starts off empty.  Everytime we find a new element, we add one
to '$found_one{$_}' via '++'.  Since '++' is postfix, it occurs AFTER the
value is returned.  In otherwords, '$found_one{$_}++' returns the current
value and then adds one.

Now, if the current element has never been read before, then
'$found_one{$_}' doesn't exist, and so returns false.  '$found_one{$_}++' in
this case is equivalent to '$found_one{$_}=1'.  In otherwords, we create an
entry in '%found_one' with  key of '$_'.  If, on the other hand, the element
was read before, then '$found_one{$_}' returns true.  It then increments the
value and sets it equal to 2, but we don't care about that, since we've
already jumped out of the sub via return.  By the end of the loop, if we
haven't returned out, we know that each element in '@_' is unique, and
'%found_one' has exactly one key for each $_ in @_, each set to 1.  So, we
just return false.

Besides the fact that you introduce a lot of unnecessary variables, the only
difference between your sub and mine is that yours performs '$n log $n'
comparisons (is that right ... ?) whereas mine only performs '$n'.  I don't
know enough about perl to know which method is more efficient.  It could be
that the overhead involved in hashing outweighs the comparisons and array
lookups that you used.  I don't know.  I use this method because it's less
cluttered and makes more sense to me.

Although, if i were going to write this sub for script i were using, i would
DEFINITELY use array-refs like you did.

Oh yeah, and another thing; i think
for (my $i=0; $i<$n; $i++)
is preferable to
for my $i (0...$n-1)
since the latter creates the entire array and then goes through the
elements, instead of merely going from one integer to the next.

hth!
christopher

-Original Message-
From: Wagner Jeff Civ Logicon/TTMS
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 11:40 AM
To: [EMAIL PROTECTED]
Subject: RE: check array element (HELP)


Hi,

I am one of the beginners list's many voyeurs.  Can you explain your code?
Where does the "%found_one" hash get its initial value?  I understand that
"@_" represents the list that was passed to the subroutine and that "$_" is
the current list element for each loop iteration.  Does your code assume
that the list is sorted?  How does it compare to this code fragment?

##
sub repeated_elements {

my $list = shift;# passed list reference
my $n= $#{$list};# subscript of last list element

for my $i (0..$n-1) {
for my $j ($i+1..$n) {
if ($list->[$i] eq $list->[$j]) {return 1}
}
}
return 0;
}

if (repeated_elements(\@whatever)) {
print "There are repeated elements\n";
}
else {
print "There are no repeated elements\n";
}
##

Thanks,
Jeff

-Original Message-
From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 08:44
To: [EMAIL PROTECTED]
Subject: RE: check array element (HELP)


I would probably do this, although i'm sure some smarty-pants could come up
with a one-liner  ;)

sub repeated_elements
{
my %found_one;
for (@_)
{
return 1 if $found_one{$_}++;
}
return 0;
}

if (repeated_elements @whatever)
{
# there are repeated elements
}
else
{
# there are no repeated elements
}

-Original Message-
From: GRANATA ROBERTA [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 9:28 AM
To: [EMAIL PROTECTED]
Subject: check array element (HELP)


--- Erhalten von  ZBM.ZAGTA 089/32000-414   31-07-01 15.28

hi All,

I have an array of 0...n elements.

I want to check that each element of the array,
must be different to each other.

if it is so -> error,
 else  ->  go on.
please,
Can somebody help me,to write this code.?
thanks in advance,
Best Regards,
roberta

 31-07-01 15.28  Gesendet an   
  -> beginners(A)perl.org

-- 

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: Incorporating script

2001-07-31 Thread Jerry Preston

Junaid,

It looks to me that need to setup your bat and program to run as cron jobs. 
This way you can control the time and date you want them to run.

Regards,

Jerry

"Najamuddin, Junaid" wrote:
> 
> Hi,
> If someone can help me out please
> I wrote a perl script which opens two text files and then compares them and
> spit out the difference. It is an error checking program which runs on NT
> Platform. The first file has all the required processes listed and the
> second file lists current running processes.
> The second file is being generated at time intervals thru running a bat file
> manually. When you run that batch file it generates the second text file
> which has the current processes running.
> I want to ask you how I can incorporate that batch file in my script so that
> it can run on specified time intervals. After running the bat file the
> resultant text file is going to be my second file in the script.
> I want my script to kick off automatically at predefined time intervals, run
> bat file and then use the text file generated by bat file as the second file
> in the script.
> 
> Can someone help me on this please
> 
> Thanks
> Junaid
> 
> Here is the script
> 
> use Win32;
> 
> my($snapshot, $baseline);   # Defining txt files
> 
> # First file
> $snapshot = "./secondfile.txt"; # List of Svcs currently running, should be
> generated by the bat file
> 
> # Second file
> $baseline = "./firstfile.txt";  # List of All Svcs which should be running
> 
> my(@arr1, @arr2, @result);  # Defining arrays
> my($fld1, $fld2, $fld3, $fld4); # Defining variables for fields
> my($match, $cnt, $val1, $val2, $finalresult); # Defining scalar variables
> $match = "N";
> 
> #Open snapshot file and insert every line into @arr1
> open(SNAPSHOT, $snapshot) or die "Unable to open $snapshot."; # Open the txt
> file and place it in filehandle
> 
> $cnt = 0;
> while (  ) # Looping thru the filehandle snapshot
>  {
> $arr1[$cnt] = $_;
> $cnt = $cnt + 1;
>   }
>   close (SNAPSHOT); # close the filehandle snapshot
> 
> #Open baseline file and insert every line into @arr2
> open(BASELINE, $baseline) or die "Unable to open $baseline."; # Open the txt
> file and place it in filehandle
> 
> $cnt = 0;
> while (  ) # Looping thru the filehandle baseline
> {
> $arr2[$cnt] = $_;
> $cnt = $cnt + 1;
>   }
>   close (BASELINE); # close filehandle baseline
> 
> # Outer loop is for baseline file
> # Inner loop is for snapshot file
> # Taking one element from @arr2 (baseline) and comparing it with all the
> elements in @arr1(snapshot) and
> # If their is no match then insert that name into finalresult.
> 
> $cnt = 0;
> foreach $val2 (@arr2) # referring to baseline
> {
> foreach $val1 (@arr1) # referring to snapshot
> {
> if ($val1 eq $val2)
> {
> $match = "Y";
> }
> }
> if  ($match eq "N")
> {
> $result[$cnt] = $val2;
> $cnt = $cnt + 1;
> }
> 
> $match = "N";
> }
> 
> $finalresult = 0; # initializing to zero
> foreach $val1 (@result)
> {
> $finalresult = $finalresult + 1;
> }
> 
> if ($finalresult >  0 )
> {
> print "\nList of process not running \n\n"; # If some svc is not
> functioning
> foreach $val1 (@result)
> {
> ($fld1,$fld2,$fld3,$fld4) =  split(/\|/,"$val1");#
> separating req fields for output
> 
> }
> }
> else
> {
> print "\nAll process are running \n"; # When all svcs are running
> fine
> }
> 
> --
> 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: Incorporating script

2001-07-31 Thread Najamuddin, Junaid

Hi, Jerry
Thanks for quick response
I am quite new to perl
If you can guide me and let me know how it can be done and what will be the
syntax
It will be a great help 
Thanks

-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 12:55 PM
To: Najamuddin, Junaid
Cc: [EMAIL PROTECTED]
Subject: Re: Incorporating script


Junaid,

It looks to me that need to setup your bat and program to run as cron jobs. 
This way you can control the time and date you want them to run.

Regards,

Jerry

"Najamuddin, Junaid" wrote:
> 
> Hi,
> If someone can help me out please
> I wrote a perl script which opens two text files and then compares them
and
> spit out the difference. It is an error checking program which runs on NT
> Platform. The first file has all the required processes listed and the
> second file lists current running processes.
> The second file is being generated at time intervals thru running a bat
file
> manually. When you run that batch file it generates the second text file
> which has the current processes running.
> I want to ask you how I can incorporate that batch file in my script so
that
> it can run on specified time intervals. After running the bat file the
> resultant text file is going to be my second file in the script.
> I want my script to kick off automatically at predefined time intervals,
run
> bat file and then use the text file generated by bat file as the second
file
> in the script.
> 
> Can someone help me on this please
> 
> Thanks
> Junaid
> 
> Here is the script
> 
> use Win32;
> 
> my($snapshot, $baseline);   # Defining txt files
> 
> # First file
> $snapshot = "./secondfile.txt"; # List of Svcs currently running, should
be
> generated by the bat file
> 
> # Second file
> $baseline = "./firstfile.txt";  # List of All Svcs which should be running
> 
> my(@arr1, @arr2, @result);  # Defining arrays
> my($fld1, $fld2, $fld3, $fld4); # Defining variables for fields
> my($match, $cnt, $val1, $val2, $finalresult); # Defining scalar variables
> $match = "N";
> 
> #Open snapshot file and insert every line into @arr1
> open(SNAPSHOT, $snapshot) or die "Unable to open $snapshot."; # Open the
txt
> file and place it in filehandle
> 
> $cnt = 0;
> while (  ) # Looping thru the filehandle snapshot
>  {
> $arr1[$cnt] = $_;
> $cnt = $cnt + 1;
>   }
>   close (SNAPSHOT); # close the filehandle snapshot
> 
> #Open baseline file and insert every line into @arr2
> open(BASELINE, $baseline) or die "Unable to open $baseline."; # Open the
txt
> file and place it in filehandle
> 
> $cnt = 0;
> while (  ) # Looping thru the filehandle baseline
> {
> $arr2[$cnt] = $_;
> $cnt = $cnt + 1;
>   }
>   close (BASELINE); # close filehandle baseline
> 
> # Outer loop is for baseline file
> # Inner loop is for snapshot file
> # Taking one element from @arr2 (baseline) and comparing it with all the
> elements in @arr1(snapshot) and
> # If their is no match then insert that name into finalresult.
> 
> $cnt = 0;
> foreach $val2 (@arr2) # referring to baseline
> {
> foreach $val1 (@arr1) # referring to snapshot
> {
> if ($val1 eq $val2)
> {
> $match = "Y";
> }
> }
> if  ($match eq "N")
> {
> $result[$cnt] = $val2;
> $cnt = $cnt + 1;
> }
> 
> $match = "N";
> }
> 
> $finalresult = 0; # initializing to zero
> foreach $val1 (@result)
> {
> $finalresult = $finalresult + 1;
> }
> 
> if ($finalresult >  0 )
> {
> print "\nList of process not running \n\n"; # If some svc is not
> functioning
> foreach $val1 (@result)
> {
> ($fld1,$fld2,$fld3,$fld4) =  split(/\|/,"$val1");#
> separating req fields for output
> 
> }
> }
> else
> {
> print "\nAll process are running \n"; # When all svcs are running
> fine
> }
> 
> --
> 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]




Sendmail

2001-07-31 Thread Top Gunner

I have ActivePerl 5.22 installed on an NT server.
SendMail does not work. Is there a place I can download a sendmail component for perl 
or something like that?

I really know very little about it. Any help is appreciated.


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




cgi-bin

2001-07-31 Thread todd

How can I tell if my webmaster has the CGI-Bin directory setup properly?

Thanks

Todd.


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




Determining array length on multidimensional arrays

2001-07-31 Thread Michael Dube

Howdy,

I know that to determine the array length of @array, the following options
are available:
a) $#array (returns last index)
b) scaler(@array) (returns true length)

Now... if I have a multidimensional array, $array[$x][$y], how do I
determine the array length for $array[$x]?  I am trying to provide a
conditional line of code for the last element in the array... any
suggestions?

Thanks,

Mike


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




Re: check array element (HELP)

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 12:36:37PM -0500, Mooney Christophe-CMOONEY1 wrote:
> Oh yeah, and another thing; i think
>   for (my $i=0; $i<$n; $i++)
> is preferable to
>   for my $i (0...$n-1)
> since the latter creates the entire array and then goes through the
> elements, instead of merely going from one integer to the next.

Actually, since 5.005 the foreach (0..$n) syntax has been optimized into a
counting loop, so it no longer creates a list.

I still prefer a for(;;) loop because it is more descriptive of what's going
on, but there's no real technical reason for it anymore.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




binary files

2001-07-31 Thread Tyler Cruickshank

Hello. 

Looking for some binary file help.  I want to read, manipulate, and print (in ascii) a 
binary file on a solaris 7 machine.  I have looked into and tried the binmode() 
function but this seems to be for older machines that differentiate between ascii and 
binary files.  I have tried the following and just get the binary form printed back 
out at me (the expected result):

open(FILE, "mybinaryfile") || or die "error\n";
while(){
print "$_\n";
}

When perl reads a binary file as above, does it understand what it is reading?  How 
can I print the file back out in ascii?

Thank you.

Tyler Cruickshank
UDAQ



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




Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Narendran Kumaraguru Nathan

Hai Karthik,
  Yes, I'm using Sun sparc m/c. I am not sure wether it is
caused by the m/c??  I also some times get a warning saying use of
uninitialised array, when the first element is null and there are valid
other elements. Is this also due to the same reason?
Regards,
Naren.


Karthik Krishnamurthy wrote:

> you seem to be using a SUN SPARC. A bus error is often induced on these 
>architectures when pointer
> access is not aligned on word boundary.
>
> whether this is caused by the Perl binary itself or the script i don't know
> /kk
>
> On Tue, Jul 31, 2001 at 04:39:54PM +0530, Narendran Kumaraguru Nathan wrote:
> > Hai Guys,
> >
> >   I am compiling a perl code (arround 200 lines). I run it with perl -w (so that I 
>can see all the
> > warnings). It
> > reports no warnings and executes. All is fine till I give one input ( like 1..5 ) 
>meaning that I
> > need actions 1 to 5
> > to be done. Atonce the following error is printed in the screen and the program 
>quits.
> > error>> Bus error (core dumped)
> >
> >   The user can specify a command or a series of command if the input is >1 then 
>only one command
> > (for 1)
> > is executed. if the input is >1 2 , then execution of 2 follows execution of 1 . 
>If the input is
> > >1..5 , then
> > I wish actions 1 to 5 to be executed one after another.
> >
> > Now, the way I have implemented  is below
> > foreach (@line) {
> > if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
> >  ($s, $e) = split /\.\./, $_;  # split with the dots to get start and end
> >  push @line, $s;  # append to the input line
> >  while ( $s <= $e ) { push @line, $s++; };
> > }elsif ($_ ==  #  next comparison
> > # specify to execute commands some input
> > }
> >
> > Can anyone give me a clue why this happens?? Or is there a better way of doing 
>this?
> > Thanks & Regards,
> > Naren.
> >
> >
> > --
> > 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: Determining array length on multidimensional arrays

2001-07-31 Thread Peter Scott

At 11:23 AM 7/31/01 -0700, Michael Dube wrote:
>Howdy,
>
>I know that to determine the array length of @array, the following options
>are available:
>a) $#array (returns last index)
>b) scaler(@array) (returns true length)
>
>Now... if I have a multidimensional array, $array[$x][$y], how do I
>determine the array length for $array[$x]?

a) $#{$array[$x]}
b) scalar @{$array[$x]}



--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


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




Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Narendran Kumaraguru Nathan

Ken & Karthik,
  The same algorithm has worked for me even when I use subroutines to
push in the value to the variable in the foreach loop(which is in the calling 
program). I really
doubt the
modularity of my program. I am now combining two of my
programs (one with no subroutine and other well organised), the bad design
might cause it to behave improperly?? I am doing many memory intensive
operations with arrays (like reading a file and shuffling the lines). I would
try with different architectures and let you know the status.
  i think this would take me two days (since I am not working on it full time!! & the 
program is
becomming big).
Thanks for your interests,
Naren.

Ken wrote:

> When I remove the incomplete elsif this runs fine on my system (with an
> added line before the while to read in @line @line =
> scalar();)
>
> What version of Perl are you running?  Did you install it?  Did it past all
> of the tests?
>
> Can you send us a complete sample program that gives this same error?
>
> Ken
>
> - Original Message -
> From: "Narendran Kumaraguru Nathan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 31, 2001 5:09 AM
> Subject: cannot fix an error - "Bus error (core dumped) "
>
> > Hai Guys,
> >
> >   I am compiling a perl code (arround 200 lines). I run it with perl -w
> (so that I can see all the
> > warnings). It
> > reports no warnings and executes. All is fine till I give one input ( like
> 1..5 ) meaning that I
> > need actions 1 to 5
> > to be done. Atonce the following error is printed in the screen and the
> program quits.
> > error>> Bus error (core dumped)
> >
> >   The user can specify a command or a series of command if the input is >1
> then only one command
> > (for 1)
> > is executed. if the input is >1 2 , then execution of 2 follows execution
> of 1 . If the input is
> > >1..5 , then
> > I wish actions 1 to 5 to be executed one after another.
> >
> > Now, the way I have implemented  is below
> > foreach (@line) {
> > if ( $_ =~ /\.\./) {  # if the input has two consecutive .'s
> >  ($s, $e) = split /\.\./, $_;  # split with the dots to get start and
> end
> >  push @line, $s;  # append to the input line
> >  while ( $s <= $e ) { push @line, $s++; };
> > }elsif ($_ ==  #  next comparison
> > # specify to execute commands some input
> > }
> >
> > Can anyone give me a clue why this happens?? Or is there a better way of
> doing this?
> > Thanks & Regards,
> > Naren.
> >
> >
> > --
> > 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: binary files

2001-07-31 Thread Bob Showalter

> -Original Message-
> From: Tyler Cruickshank [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 31, 2001 1:32 PM
> To: [EMAIL PROTECTED]
> Subject: binary files
> 
> 
> Hello. 
> 
> Looking for some binary file help.  I want to read, 
> manipulate, and print (in ascii) a binary file on a solaris 7 
> machine.  I have looked into and tried the binmode() function 
> but this seems to be for older machines that differentiate 
> between ascii and binary files.  I have tried the following 
> and just get the binary form printed back out at me (the 
> expected result):
> 
> open(FILE, "mybinaryfile") || or die "error\n";
> while(){
> print "$_\n";
> }
> 
> When perl reads a binary file as above, does it understand 
> what it is reading?  How can I print the file back out in ascii?

A file is a file. Perl isn't going to do anything special with your files.
It just calls your system read(2), or fread(3) calls to read a file.

A loop like you have above is suitable for reading "text" files broken into
"lines" separated by \n chars (although perl lets you define any kind of
"line" separator you want).

For data that's not divided into "lines", you can use the perl read()
function. If the data is packed into various binary formats, you can use
perl's unpack() function to decode it into individual values.

binmode is for those systems like Win32 that munge around with line endings
on "text" files. For Unix, you don't need to worry about it (although
calling binmode is harmless on Unix).

See:

   perldoc read
   perldoc seek
   perldoc tell
   perldoc sysread
   perldoc unpack

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




RE: Exec cgi

2001-07-31 Thread Tiago Almeida Spritzer


Is this corret:   From: Tiago Almeida Spritzer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: Exec cgi
>
>
> Hi,
>
>  Anybody help me with this question?
>  I have two folders at the server, one with perl files
> and other with html files. I need that the page index.html
> execute perl file, and I know that this TAG do that .  But I
> try and don't obtain any result.

Forgot to add: the argument to #exec cgi is a URL, not a filespec.

--
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: binary files

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 11:31:34AM -0600, Tyler Cruickshank wrote:
> Looking for some binary file help.  I want to read, manipulate, and print
> (in ascii) a binary file on a solaris 7 machine.  I have looked into and
> tried the binmode() function but this seems to be for older machines that
> differentiate between ascii and binary files.  I have tried the following
> and just get the binary form printed back out at me (the expected result):

binmode() is indeed for operating systems that differentiate between ascii
and binary, but such operating systems are not old.  Even the newest
versions of Microsoft Windows differentiate; it's a legacy issue.

 
> open(FILE, "mybinaryfile") || or die "error\n";
> while(){
> print "$_\n";
> }
> 
> When perl reads a binary file as above, does it understand what it is
> reading?  How can I print the file back out in ascii?

You have to make sense of the file; read a chunk at a time and parse it with
unpack.  Perl can DWYM quite often, but it's not psychic.  :)


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Re: DBI connect method dumps core

2001-07-31 Thread David Kirol

Just in case anybody else runs into this problem.
It turns out the machine I am working on has multiple OracleHomes. Using the
oracle tool to switch to the home where the database lives solved this
problem (I made ora8i the Primary home).

"David Kirol" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm using Activestate perl build 626, DBD-Oracle8 1.06 DBI 1.14 on WInNt
> with intel. I loaded all prebuilt binaries. The good stuff on my machine
is
> hiding in Cygwin. When I try to connect to a local Oracle 8.1.5 instance
> DrWatson pops up and blames perl for an access violation. Short of
> converting to Linux, can anybody offer any help.
>
>
>



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




Re: binary files

2001-07-31 Thread Luke Bakken

To read binary files, you need to understand read(), seek() and unpack(),
as well as the underlying binary structure of the file.  Peeking into the
file with a hex editor will help distinguish the ASCII bits from the rest.
If you know the C code that creates the file, that can help a lot!

Luke

email privately for more help


On Tue, 31 Jul 2001, Tyler Cruickshank wrote:

> Hello.
>
> Looking for some binary file help.  I want to read, manipulate, and print (in ascii) 
>a binary file on a solaris 7 machine.  I have looked into and tried the binmode() 
>function but this seems to be for older machines that differentiate between ascii and 
>binary files.  I have tried the following and just get the binary form printed back 
>out at me (the expected result):
>
> open(FILE, "mybinaryfile") || or die "error\n";
> while(){
> print "$_\n";
> }
>
> When perl reads a binary file as above, does it understand what it is reading?  How 
>can I print the file back out in ascii?
>
> Thank you.
>
> Tyler Cruickshank
> UDAQ
>
>
>
> --
> 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: arrays

2001-07-31 Thread Matija Papec

Troy Denkinger <[EMAIL PROTECTED]> wrote:
>which indicates that the first array is empty.  The problem is the undef of 
>@temp.  What you've put into @array is a reference to @temp.  When you undef 
>it, you're undefing the array that the reference in array points to.
>
>In any event, I can't figure out why you'd want to do what I think it is 
>you're trying to do. There certainly may be a vaild reason for it, but there 
>may be a better solution.
>
>Can you say what it is you're trying to accomplish?

I'm working with Gd::graph::bars module and want to hide all values on X
axis. Since I didn't find appropriate attribute for such thing, thought that
array of empty strings is good idea.



-- 
Matija

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




Re: arrays

2001-07-31 Thread Matija Papec

Michael Fowler <[EMAIL PROTECTED]> wrote:
>> @data[0] = ("", "", "");
>> #and
>> @data[1] = (1, 2, 3);
>
>This notation is almost certainly incorrect, what you probably meant to say
>is:
>
>$data[0] = ["", "", ""];
>$data[1] = [ 1,  2,  3];

You're right, I wrote a wrong syntax.

>> I want to make @data[0] on the fly without "for" structure and it should
>> have the same number of elements as @datumi2.
>
>Your restriction that it not use a for loop to construct the data is
>needlessly limiting.  There are several ways to do what you ask, one of them
>is a for loop.

I didn't like idea where "for" is used for adding elements one by one..
otherwise I don't have anything at all against using it. ;)

>push(@{ $data[0] }, "") for (0 .. $#datumi2);
>
>OR
>
>push(@{ $data[0] }, "") for @dataumi2;

Does $_ change in these two examples? (due cycling trough @datumi2)

>$data[0] = [("") x @datumi2];
>
>
>Each has strengths and weaknesses.

Can you explain where are these strengths(which one is the fastest?)



-- 
Matija

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




Re: Determining array length on multidimensional arrays

2001-07-31 Thread Paul


--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> (aside to the rest of the experts: Perl doesn't have multidimensional
>  arrays, people.  Let's please stop confusing the newbies by calling
>  it that.)

A very good point. I hesitate to ask what how we *should* refer to it,
but the apparent multidimensionality of Perl's arrays is functional,
not structural. 

For the Nu-B's:

An array in Perl holds only scalars, and only in one dimension.
References, however, are scalars, and the syntax

  $array[$a][$b]

is actually a reduced/simplified way to say

  $array[$a]->[$b]

which means that $array[$a] is a reference to an array, 
and to go get the [$b] element out of that. This carries to subsequent
levels, and applies for hashes as well, so

  $this[0]{foo}[0]

is really 

  $this[0]->{foo}->[0]

To put that into slightly more easily parsed steps, you could get the
same general effect as

  my $cell = $this[0]{foo}[0];
 
by saying:

  my $ref1 = $this[0]; # the first "dimension" 
  my $ref2 = $ref1->{foo}; # the second, a hash this time
  my $cell = $ref2->[0];   # the zero element of @{ $ref2 }

except that this way requires more variables. The shortened syntax does
all this behind the scenes, but still goes through the general
gyrations to get to the same memory location.

Which is why

  $hash{"$a $b $c"} 

is sometimes much more efficient than

  $hash{$a}{$b}{$c}

The first version just has to do a string catenation and one lookup;
the second has to do three lookups.

(And as always, if I fumbled something, please tell me. =o)

Paul

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




RE: Incorporating script

2001-07-31 Thread Ross, Jonathan C.

> Hi, If someone can help me out please I wrote a perl script which
> opens two text files and then compares them and spit out the
> difference. It is an error checking program which runs on NT
> Platform. The first file has all the required processes listed and
> the second file lists current running processes.  The second file is
> being generated at time intervals thru running a bat file
> manually. When you run that batch file it generates the second text
> file which has the current processes running.  I want to ask you how
> I can incorporate that batch file in my script so that it can run on
> specified time intervals. After running the bat file the resultant
> text file is going to be my second file in the script.  I want my
> script to kick off automatically at predefined time intervals, run
> bat file and then use the text file generated by bat file as the
> second file in the script.

Your check for baseline services is searching the entire array for each
currently running service.  The easiest way to check for the
presence/absence of a string value is with a hash.  So, put both the
baseline and snapshot service list into hashes, and then list everything in
the baseline hash that's not in the snapshot hash.  My example shows a
couple of other useful tricks as well.

use strict;
use warnings;
use FileHandle;

sub read_services
{
my $file = shift;
my $fh = FileHandle->new ($file) or die "can't open $file:
$!\n";
my %hash = map { chomp; ($_,1) } $fh->getlines();  # note (1)
$fh->close();
return %hash;
}

our %baseline = read_services ("baseline.txt"); # note (2)

for ( ; 1; sleep(60) )
{
my %running = read_services ("./snapshot.bat |");  # note (3)
foreach my $missing (grep !$running{$_}, keys %baseline) { #
note (4)
print "$missing is missing\n";
}
}

Notes:

1) You can yield N values within a map() expression; here we build a hash
that maps each line in the service file to the value 1 (true).  It's
equivalent to the more prosaic:

my $line;
my %hash;
while ($line = $fh->getline()) {
chomp $line;
$hash{$line} = 1;
}

2) Now %baseline has all the services we expect to see running.

3) Here we exploit Perl's feature that '|' at the end of an opened filename
string can designate the output of a piped command; read_services doesn't
know this is really command output, or even care.  If this doesn't work for
you, try

system ("getyoursnapshot.bat");
%running = read_services ("snapshot.txt");

4) This will iterate over every key in the hash %baseline that was not found
in the hash %running -- in other words, your missing services.

Regards,
Jonathan

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




Re:[OT]Determining array length on multidimensional arrays

2001-07-31 Thread Paul


--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> > "Paul" == Paul  <[EMAIL PROTECTED]> writes:
> 
> Paul> (And as always, if I fumbled something, please tell me. =o)
> 
> No, that's a nice summary.

Thanks! ~grin!~

> This is why when people ask why we don't cover "multidimensional
> arrays" in Learning Perl, I say first "well, because Perl doesn't
> have them" {grin}, but when pressed, I say "it opens a can of
worms... 
> to be functional with references requires 4 to 8 hours of classroom
> exposure, and we don't have that much time left in an intro course to
> do that". You can't just learn "a little about references" and be
> anything but dangerous. :)

lol -- this is true.
But the gearhead in me wants to explain them NOW! lol!!!
Fortunately, it's time to go home and eat supper. >:O)

Good night, all.

Paul

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




Re: arrays

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 10:21:47PM +0200, Matija Papec wrote:
> Michael Fowler <[EMAIL PROTECTED]> wrote:
> >Your restriction that it not use a for loop to construct the data is
> >needlessly limiting.  There are several ways to do what you ask, one of them
> >is a for loop.
> 
> I didn't like idea where "for" is used for adding elements one by one..
> otherwise I don't have anything at all against using it. ;)

You may not like it, but it's a needless restriction; the problem may call
for it.

 
> >push(@{ $data[0] }, "") for (0 .. $#datumi2);
> >
> >OR
> >
> >push(@{ $data[0] }, "") for @dataumi2;
> 
> Does $_ change in these two examples? (due cycling trough @datumi2)

I'm not using $_ in any of the examples; it's implicitly used by the for
loop as an iterator, but for the variable to be modified I would have to do
something with it.


> Can you explain where are these strengths(which one is the fastest?)

Given:
1) push(@{ $data[0] }, "") for (0 .. $#datumi2);
2) push(@{ $data[0] }, "") for @datumi2;
3) $data[0] = [("") x @datumi2];

Offhand, I'd say the first two would be slower than the last; the first very
slightly slower than the second.  There is also readability to consider; the
last conveys quite a bit of meaning in few characters; the second could be
slightly confusing because it's iterating over an array, but doing nothing
with the values.

Don't take my word for it on relative speed, benchmark each.  Benchmark.pm
is good for doing this.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Printing a array of hashes of hashes of arrays

2001-07-31 Thread Chris Garringer

I think that is right, I admit that Perl's data structures confuse me and I don' t 
have it right yet.

I have a program that has an array of days of the month, the array value is a hash, 
the value of the hash is a hash, and its value is an array
$logs[$day]{}{}[]
This structure works fine to load it up, it has the username as the key, the 
authentication method as a key, and the array element 0 is success count, element 1 is 
failure count

My problem is it took me hours to get it to print! I know it is based in my lack of 
understanding of de- referencing the values.  I printed it by looping on the array and 
lots of if statements.  If another authmethod is used the program fails to print it.   
Can someone show me how I can print this out?  

Chris D. Garringer
LAN/WAN Manager
Master Certified Netware Engineer
Microsoft Certified Systems Engineer
Certified Solaris Administrator
Red Hat Certified Engineer
[EMAIL PROTECTED]
fax 713-896-5266



Putting results of find into an array

2001-07-31 Thread Greg Tomczyk

Hello,

I was wondering if some one could assist me in something I am sure is
simple for most. I am utilizing find2perl utility and implemented it into a
perl script. However I would like to have the results of the find stored
into an array.

Basically I am trying to traverse a directory tree, and grep for a string.
When I come across that string I print the file name. I want to put that
result and all other occurrence's of my grep into an array. In running the
Unix find, I get my list of files. I then run find2perl to convert my Unix
find to a perl equivalent. I run the perl scripts and it prints out the
correct files, so I know the perl find is searching and finding the files.
The find2perl command generated two subroutines (wanted and exec). I have
tried different combinations to try and put these find results into an
array. Below is the exact code I am using. Anyone have any suggestions? It
would mean a great deal.

Thanks
Greg



eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;

require "find.pl";

# Traverse desired filesystems

&find('/local');

exit;

sub wanted {
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
&exec(0, 'grep','-q','domain.com','{}') &&
print("$name\n");
#@filelist=$name;
#print ("Test to see if $name print\n");
}

sub exec {
local($ok, @cmd) = @_;
foreach $word (@cmd) {
$word =~ s#{}#$name#g;
}
if ($ok) {
local($old) = select(STDOUT);
$| = 1;
print "@cmd";
select($old);
return 0 unless  =~ /^y/;
}
chdir $cwd; # sigh
system @cmd;
chdir $dir;
return !$?;
}

wanted;



--
Gregory D. Tomczyk
IBM - Contractor
(503) 578-5390
[EMAIL PROTECTED]


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




Re: Printing a array of hashes of hashes of arrays

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 05:34:39PM -0500, Chris Garringer wrote:
> I have a program that has an array of days of the month, the array value
> $is a hash, the value of the hash is a hash, and its value is an array
> $logs[$day]{}{}[]
[snip]
> Can someone show me how I can print this out?

Why are you trying to print out the data structure?  If it's purely for
debugging purposes:

use Data::Dumper;
print Dumper(\@logs);


If not then you should send the code you're using to the list.  It's far
easier to debug the code you're already using than to come up with something
from scratch.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Re: Splitting a string into a Array of Arrays

2001-07-31 Thread Rachel Coleman

> I know this is simpler then what I am making it but I am stumped.  I used
LWP::UserAgent to fetch some data from a
> web page, What I need to do is to load the data which I believe is just
one long string that I got from calling content()
> into an array of arrays by splitting on "\n" and ",".
[snip]
> sub quotes{
>  my $content = get_content();
>  my (@data,$i);
>  my @rows=split/\n/,$content;
>  $i=0;
>  foreach my $element (@rows){
>   $data[$i]=split(/,/,$element);

Your problem is here.  split returns an array, but you are assigning it to a
scalar variable.  The array is interpreted in scalar context, i.e. setting
the scalar to the length of the array.  What you want to do is assign an
array reference, e.g. an anonymous array containing the output of split like
so:

$data[$i] = [ split( /,/, $element ) ];

and then carry on
>   $i++;
>   }
>   return @data;
>  }

As a PS I've included a working script and its output.  If you have a copy
of 'Programming Perl' (3rd edition) read Chapter 8 and 9 (References and
Data Structures).  It took me several read-throughs before it all sunk in
(and I'm sure I still don't fully understand it) but it's worth it.

Best wishes,

Rachel

P.S.
#!/usr/bin/perl -w
use strict;

my $test_string = "lots of text,with,commas\nand\nnewlines,here there and \n
everywhere, just for fun\n you\n see";

my @rows = split( /\n/, $test_string );
my $i=0;
my @data;
foreach my $element ( @rows ) {
$data[$i] = [ split( /,/, $element ) ];
$i++;
}

foreach ( @data ) {
foreach ( @$_ ) {
print "$_\n";
}
}
print "Done!\n";

# Output is
lots of text
with
commas
and
newlines
here there and
 everywhere
 just for fun
 you
 see
Done!



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




Randomizing an Array

2001-07-31 Thread CDitty

Hello all.  Just joined the list and after reading through the archives, I 
couldn't find an answer.  I'm hoping someone can help.

I have an array with 6 variables in it.   I need to randomize the variables 
in this array.  According to the documentation I have read, 
rand(@display_pictures) should do it.But it doesn't.  Everytime I 
output the array, it is in the same order it was put in.

Can anyone help me with this?

Thanks

Chris


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




Re: Randomizing an Array

2001-07-31 Thread Peter Scott

At 06:05 PM 7/31/01 -0500, CDitty wrote:
>Hello all.  Just joined the list and after reading through the archives, I 
>couldn't find an answer.  I'm hoping someone can help.
>
>I have an array with 6 variables in it.   I need to randomize the 
>variables in this array.  According to the documentation I have read, 
>rand(@display_pictures) should do it.But it doesn't.  Everytime I 
>output the array, it is in the same order it was put in.

perldoc -q shuffle

Please send us a pointer to the erroneous documentation you saw so we can 
advise the author to fix it.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


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




Re: Randomizing an Array

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 06:05:18PM -0500, CDitty wrote:
> Hello all.  Just joined the list and after reading through the archives, I 
> couldn't find an answer.  I'm hoping someone can help.
> 
> I have an array with 6 variables in it.   I need to randomize the variables 
> in this array.  According to the documentation I have read, 
> rand(@display_pictures) should do it.But it doesn't.  Everytime I 
> output the array, it is in the same order it was put in.

I'm not sure what documentation told you this, but if it truly did, it's
wrong.  It's possible you misunderstood it.

rand(@display_pictures) returns a random number (notice: number, not
integer) greater than or equal to 0, and less than the length of
@display_pictures.  This can be used as an index into the array.  If you
want a randomized array based on what's in @display_pictures:

my @rand_display_pictures;
while (@display_pictures) {
push(
@rand_display_pictures,
splice(@display_pictures, rand(@display_pictures), 1)
);
}

@rand_display_pictures is a randomized version of @display_pictures.  This
operation is destructive, meaning @display_pictures will be empty when it's
done.


If, on the other hand, you just want a random element from
@display_pictures, simply access it:

$display_pictures[rand @display_pictures];


See perldoc -f rand.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Re: Randomizing an Array

2001-07-31 Thread CDitty

In both my perl books.  Learning Perl(O'Reilly) and Perl 5 Interactive 
Course(Waite Group).

The shuffle routine in not listed in either of these books, although they 
are almost 1 year old.   When I try and use shuffle I get
Undefined subroutine &main::shuffle  and my program stops.

Chris

At 06:06 PM 7/31/2001, Peter Scott wrote:
>At 06:05 PM 7/31/01 -0500, CDitty wrote:
>>Hello all.  Just joined the list and after reading through the archives, 
>>I couldn't find an answer.  I'm hoping someone can help.
>>
>>I have an array with 6 variables in it.   I need to randomize the 
>>variables in this array.  According to the documentation I have read, 
>>rand(@display_pictures) should do it.But it doesn't.  Everytime I 
>>output the array, it is in the same order it was put in.
>
>perldoc -q shuffle
>
>Please send us a pointer to the erroneous documentation you saw so we can 
>advise the author to fix it.
>
>--
>Peter Scott
>Pacific Systems Design Technologies
>http://www.perldebugged.com
>
>
>--
>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: Randomizing an Array

2001-07-31 Thread Casey West

On Tue, Jul 31, 2001 at 06:32:15PM -0500, CDitty wrote:
: In both my perl books.  Learning Perl(O'Reilly) and Perl 5 Interactive 
: Course(Waite Group).
: 
: The shuffle routine in not listed in either of these books, although they 
: are almost 1 year old.   When I try and use shuffle I get
: Undefined subroutine &main::shuffle  and my program stops.

Did you read the documentation provided by executing 'perldoc -q
shuffle'?

If you did, you noticed a subroutine in the coding example that
shuffles an array with the fisher-yates algorithm.  I'll post it here
so everyone can see it

   Use this:

   # fisher_yates_shuffle( \@array ) :
   # generate a random permutation of @array in place
   sub fisher_yates_shuffle {
   my $array = shift;
   my $i;
   for ($i = @$array; --$i; ) {
   my $j = int rand ($i+1);
   next if $i == $j;
   @$array[$i,$j] = @$array[$j,$i];
   }
   }

   fisher_yates_shuffle( \@array );# permutes @array in place

There is another example in that FAQ question which was posted here by
Micheal Fowler, whose name I surely misspelled.  :-)


  Casey West

-- 
Shooting yourself in the foot with Fortran 
You shoot yourself in each toe, iteratively, until you run out of
toes; then you shoot the sixth bullet anyway since no exception
processing was anticipated. 

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




Re: Putting results of find into an array

2001-07-31 Thread Michael Fowler

On Tue, Jul 31, 2001 at 03:38:17PM -0700, Greg Tomczyk wrote:
> I was wondering if some one could assist me in something I am sure is
> simple for most. I am utilizing find2perl utility and implemented it into a
> perl script. However I would like to have the results of the find stored
> into an array.

find2perl was a starting point, now you need to read and understand how
File::Find::find works, and how the wanted subroutine interacts with it. 
See perldoc File::Find.


[snip]
> sub wanted {
> (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
> &exec(0, 'grep','-q','domain.com','{}') &&
> print("$name\n");
> #@filelist=$name;
> #print ("Test to see if $name print\n");
> }

You almost had it, except "@filelist = $name" assigns $name to @filelist,
clearing out any other elements already there.  You want push, as in
"push(@filelist, $name)".

 
> sub exec {
> local($ok, @cmd) = @_;
> foreach $word (@cmd) {
> $word =~ s#{}#$name#g;
> }
> if ($ok) {
> local($old) = select(STDOUT);
> $| = 1;
> print "@cmd";
> select($old);
> return 0 unless  =~ /^y/;
> }
> chdir $cwd; # sigh
> system @cmd;
> chdir $dir;
> return !$?;
> }

If you're going to be using this code in production you should replace this
subroutine, as well as the usage of this subroutine in wanted(), with a
trimmed down one that does nothing but system and checks the return value. 
There is generalized code here that makes sense for one-off find2perl usage,
but not for code that's being used and maintained on a production basis.

Also, if you want it to be portable you should do the grep in Perl, rather
than executing an external command.


> wanted;

How did this end up down here?


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Re: Randomizing an Array

2001-07-31 Thread CDitty

At 05:44 PM 7/31/2001, you wrote:
>On Tue, Jul 31, 2001 at 06:32:15PM -0500, CDitty wrote:
>: In both my perl books.  Learning Perl(O'Reilly) and Perl 5 Interactive
>: Course(Waite Group).
>:
>: The shuffle routine in not listed in either of these books, although they
>: are almost 1 year old.   When I try and use shuffle I get
>: Undefined subroutine &main::shuffle  and my program stops.
>
>Did you read the documentation provided by executing 'perldoc -q
>shuffle'?

Yes, but since I am just learning perl, the example is greek to me and 
means nothing.
I also do not that access to my telnet right now.
http://www.perldoc.com/cpan/Algorithm/Numerical/Shuffle.html#toc


>If you did, you noticed a subroutine in the coding example that
>shuffles an array with the fisher-yates algorithm.  I'll post it here
>so everyone can see it

Not my copy.

use Algorithm::Numerical::Shuffle
qw /shuffle/;
@shuffled = shuffle (1, 2, 3, 4, 5, 6, 7);
$in_situ = [qw /one two three four five six/];
shuffle $in_situ;

Even adding the first line above causes a server error.



>Use this:
>
># fisher_yates_shuffle( \@array ) :
># generate a random permutation of @array in place
>sub fisher_yates_shuffle {
>my $array = shift;
>my $i;
>for ($i = @$array; --$i; ) {
>my $j = int rand ($i+1);
>next if $i == $j;
>@$array[$i,$j] = @$array[$j,$i];
>}
>}
>
>fisher_yates_shuffle( \@array );# permutes @array in place


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




Re: Randomizing an Array

2001-07-31 Thread CDitty


Could be.  It only says example.  I'll try your example below 
shortly.  Thanks for helping.

Chris

At 06:35 PM 7/31/2001, Michael Fowler wrote:
>On Tue, Jul 31, 2001 at 06:05:18PM -0500, CDitty wrote:
> > Hello all.  Just joined the list and after reading through the archives, I
> > couldn't find an answer.  I'm hoping someone can help.
> >
> > I have an array with 6 variables in it.   I need to randomize the 
> variables
> > in this array.  According to the documentation I have read,
> > rand(@display_pictures) should do it.But it doesn't.  Everytime I
> > output the array, it is in the same order it was put in.
>
>I'm not sure what documentation told you this, but if it truly did, it's
>wrong.  It's possible you misunderstood it.
>
>rand(@display_pictures) returns a random number (notice: number, not
>integer) greater than or equal to 0, and less than the length of
>@display_pictures.  This can be used as an index into the array.  If you
>want a randomized array based on what's in @display_pictures:
>
> my @rand_display_pictures;
> while (@display_pictures) {
> push(
> @rand_display_pictures,
> splice(@display_pictures, rand(@display_pictures), 1)
> );
> }
>
>@rand_display_pictures is a randomized version of @display_pictures.  This
>operation is destructive, meaning @display_pictures will be empty when it's
>done.
>
>
>If, on the other hand, you just want a random element from
>@display_pictures, simply access it:
>
> $display_pictures[rand @display_pictures];
>
>
>See perldoc -f rand.
>
>
>Michael
>--
>Administrator  www.shoebox.net
>Programmer, System Administrator   www.gallanttech.com
>--
>
>--
>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: Randomizing an Array

2001-07-31 Thread Casey West

On Tue, Jul 31, 2001 at 06:55:14PM -0500, CDitty wrote:
: At 05:44 PM 7/31/2001, you wrote:
: >On Tue, Jul 31, 2001 at 06:32:15PM -0500, CDitty wrote:
: >: In both my perl books.  Learning Perl(O'Reilly) and Perl 5 Interactive
: >: Course(Waite Group).
: >:
: >: The shuffle routine in not listed in either of these books, although they
: >: are almost 1 year old.   When I try and use shuffle I get
: >: Undefined subroutine &main::shuffle  and my program stops.
: >
: >Did you read the documentation provided by executing 'perldoc -q
: >shuffle'?
: 
: Yes, but since I am just learning perl, the example is greek to me and 
: means nothing.

That's fair enough.  Forgive me for not going into detail about it.  I
think you should use Michaels version anyway.  I'll explain that one
in detail if no one else has.

I also might suggest installing Perl on your local computer.  Check
out ActivePerl (activestate.com) for windows.  This way, you can test
pieces of code without having to telnet to a server or write a full
CGI program.  It's very handy that way.  :-)

  Casey West

-- 
Shooting yourself in the foot with Windows 95 
Your gun is not compatible with this OS and you must buy an upgrade
and install it before you can continue. Then you will be informed that
you don't have enough memory. 

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




help - who sponsors this list, etc.

2001-07-31 Thread Quang Bui

I'm writing a paper on this email list and I need to
know the following:

1. Who sponsors this list?
2. What mail list manager (MLM) does the list use?
   I think it's ezmlm.
3. Where can I find the FAQ and the archive of this list?
4. Is there a web site for this list?

I would appreciate any help.  Thanks.

-quang


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




Recursive directory copy

2001-07-31 Thread perl newbie

I have two diretories ( DATA and TEST). The data
directory has several subdirectories under it. I am
trying to find a Perl Module/function, that will allow
me to copy all of the contents of DATA into TEST.

Is there a module that comes with the standard PERL
distribution that will allow me to do this.

Thanks

PN

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




Re: help - who sponsors this list, etc.

2001-07-31 Thread Casey West

On Tue, Jul 31, 2001 at 08:31:01PM -0400, Quang Bui wrote:
: I'm writing a paper on this email list and I need to
: know the following:
: 
: 1. Who sponsors this list?

No one sponsors this list.  There are several people behind the scenes
who work not for money or food, but because it's The Right Thing.  On
the other hand, I believe that valueclick provides the hardware and
bandwidth but are they are not sponsors.

: 2. What mail list manager (MLM) does the list use?
:I think it's ezmlm.

I think you're right but I haven't checked and don't remember.  :-)

: 3. Where can I find the FAQ and the archive of this list?

You can find it at: http://beginners.perl.org/faqs

: 4. Is there a web site for this list?

http://beginners.perl.org/

: I would appreciate any help.  Thanks.

You're welcome.

  Casey West

-- 
Shooting yourself in the foot with DBase IV, V1.0 
You pull the trigger, but it turns out that the gun was a poorly
designed hand grenade and the whole building blows up. 

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




RE: Recursive directory copy

2001-07-31 Thread Wagner-David

Uncertain about File::COpy, but you might look at
http://www.xxcopy.com/ which may do what you want.

Wags ;)

-Original Message-
From: perl newbie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 18:00
To: [EMAIL PROTECTED]
Subject: Recursive directory copy 


I have two diretories ( DATA and TEST). The data
directory has several subdirectories under it. I am
trying to find a Perl Module/function, that will allow
me to copy all of the contents of DATA into TEST.

Is there a module that comes with the standard PERL
distribution that will allow me to do this.

Thanks

PN

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




  1   2   >