Re: Still Not sure if I agree with myself.

2003-09-11 Thread fliptop
On Mon, 8 Sep 2003 at 15:36, drieux opined:

drieux - since no one has responded, i'll take a stab at some of the 
issues you bring up.

d:One of my first question is - why the 'closure' eg:
d:
d:{
d:  package FOO;
d:  
d:}
d:
d:Or is that simply to make 'clear' that outside of
d:the Closure it is still package 'main'???

from 'programming perl, 3rd edition', page 260:

closure gives us a way to set values used in a subroutine when you define 
it, not just when you call it

so while i can see a reason for using closure like this:

{
  my %REQ_PARAMS = {
action1 = { # some specifications for action1 },
action2 = { # some specifications for action2 },
etc
  };

  sub req_params {
return $REQ_PARAMS{shift-action};
  }
}

i'm not sure what the benefit of putting the whole damn package inside a 
closure is.  perhaps someone else can provide a reason or example of its 
benefits?

d:Which leads me to my second set of question,
d:
d:  as a general habit I tend to make 'private-ish' methods
d:  with the _ prefix such as
d:
d:  sub _some_private_method {  }
d:
d:is there some 'general access' mechanism by which one can
d:ask for the LIST of all methods that an 'object' CanDo???

not that i know of.

d:Or should one have a 'register_of_parser_methods' approach
d:that one can query?

i would guess most people probably list the available (public) methods in
the pod documentation.


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



Re: Still Not sure if I agree with myself.

2003-09-11 Thread drieux
On Thursday, Sep 11, 2003, at 05:51 US/Pacific, fliptop wrote:
[..]
drieux - since no one has responded, i'll take a stab at some of the
issues you bring up.
[..]

Thanks for the feed back.

In the code that I implemented, I did not use the Closure
to 'wrap' my Package - but I think as a 'GP safety' I
probably would, in case I needed to have variables that
belonged in the Package Space as you noted.
The second thing that SMACKED ME upside the head as I
was working out 'what is the ugly here'?
simply because

	$obj-can($do);

does not mean

	$obj-should($do);

The problem I am looking for in my should() method
is a programatic way to solve Which Method to invoke
the correct sub to deal with a query string. I have
a tough enough time keeping my code in line as it is,
I really do not want it to be reading POD when it should
be working and generating HTML 8-)
My traditional trick is of the form
	
	my $qs = make_hash_of_query_string($request);
	my $actions = {}; # the hash of subs
	my $callForm = $qs-{'callForm'} || 'main_display'; # get the callForm 
parameter

my $page = (defined($action-{'callForm'}) ? # is it defined
$action-{'callForm'}-($qs) :
main_display($qs);
Which of course requires me to maintain the Hash of $actions
so that I 'register' by hand, each of the Subs that SHOULD
be used in the cgi code. A problem that I do not escape
if I have to maintain a similar list of which 'callForms'
are legitimate tokens to be returned from the browser.
So while the UNIVERSAL::can is able to check for a
given 'symbol' and return a reference to it I was
sorta wanting something that would return a list of all
of the symbols that would return something in can()...
So that I could keep the list of 'But Not These'...
Which is merely the reverse, and perchance Worse notion
since the maintanance of that DarkUgly has to know all
of the things to exclude... To cite the Immortals
	Run Away!


ciao
drieux
---

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


Date to seconds

2003-09-11 Thread Li, Kit-Wing
Hi,

Does anybody know of a quick method in perl to turn a date string into its
equivalent in seconds, include milliseconds if possible?  Ex: 20030910
13:50:25.6 to 1063202644.  Thanks much!



--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.


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



Re: Still Not sure if I agree with myself.

2003-09-11 Thread fliptop
On Thu, 11 Sep 2003 at 07:55, drieux opined:

d:simply because
d:
d:  $obj-can($do);
d:
d:does not mean
d:
d:  $obj-should($do);
d:
d:The problem I am looking for in my should() method
d:is a programatic way to solve Which Method to invoke
d:the correct sub to deal with a query string. I have
d:a tough enough time keeping my code in line as it is,
d:I really do not want it to be reading POD when it should
d:be working and generating HTML 8-)

the way i do it is to assign an action to each form.  each action has 
associated parameters.  the form sends the action in an input 
type=hidden tag.

d:
d:My traditional trick is of the form
d:  
d:  my $qs = make_hash_of_query_string($request);
d:  my $actions = {}; # the hash of subs
d:  my $callForm = $qs-{'callForm'} || 'main_display'; # get the callForm 
d:parameter
d:
d:  my $page = (defined($action-{'callForm'}) ? # is it defined
d:  $action-{'callForm'}-($qs) :
d:  main_display($qs);
d:
d:Which of course requires me to maintain the Hash of $actions
d:so that I 'register' by hand, each of the Subs that SHOULD
d:be used in the cgi code. A problem that I do not escape
d:if I have to maintain a similar list of which 'callForms'
d:are legitimate tokens to be returned from the browser.

another way is to check the list of acceptable 'actions' in the module
constructor, then if you pass an action method that's not defined, return
an error.  for example:

package Foo;
use Carp;

{
  my %REQ_PARAMS = (
action1 = { # criteria for action 1 },
action2 = { # criteria for action 2 },
etc...
  );

  sub req_params {
return $REQ_PARAMS{shift-action};
  }
}

sub new {
  my ($class, %args) = @_;

  croak missing action arg unless defined $args{action};

  my $self = bless {
_ACTION = $args{action}
  }, $class;

  croak method $args{action} not found unless $self-req_params;

  return $self;
}

sub action { shift-{_ACTION} }


then in your script:

#!/usr/bin/perl -w

use Foo;

my $f1 = Foo-new( action = 'action2' ); # works ok
my $f2 = Foo-new( action = 'action6' ); # shits the bed



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



Re: Date to seconds

2003-09-11 Thread Alexander Blüm
Li, Kit-Wing wrote:
Hi,

Does anybody know of a quick method in perl to turn a date string into its
equivalent in seconds, include milliseconds if possible?  
 Ex: 20030910 13:50:25.6 to 1063202644.  Thanks much!

starting when?
I mean, you 1063202644 seconds, and these are
33years : 37weeks : 01day : 14hours : 04minutes : 04seconds

oooh... since 1970 00:00:00

try print time();

if you want to convert any other date to seconds since 1970, you will 
have to convert the year, month and day seperately to seconds, don't 
forget, the hours and minutes...

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


Re: Still Not sure if I agree with myself.

2003-09-11 Thread drieux
On Thursday, Sep 11, 2003, at 12:17 US/Pacific, fliptop wrote:
[..]
the way i do it is to assign an action to each form.  each action has
associated parameters.  the form sends the action in an input
type=hidden tag.
oh yes, in this case the 'trigger' I use in say

	input type=hidden name=callForm value=doDaemon

This way we do not have to have 'one cgi script' per action.
My general strategy is to just pass along the HASH of
the query string and leave them up to the subs to sort out
which they need, which they use, yada-yada.
d:My traditional trick is of the form
d:  
d:  my $qs = make_hash_of_query_string($request);
d:  my $actions = {}; # the hash of subs
oh, sorry, maybe if I broke that out

my $action = {
doDaemon   = \doDameon,
showDaemon = \show_daemon,
kickDaemon = \doDameon,

};
It would be more obvious that my idea is to KNOW that
a given 'callForm' value returned from the browser is
associated with a given method that would deal with
the rest of the pack up some HTML and ship it back.
The 'kickDaemon' variant in there is when I have already
worked out that it would be a possible 'callForm' value
that can be passed to this CGI, from some other piece
of code, and that the difference between what kickDaemon()
and doDaemon() do ultimately was so negligible that I just
put a 'flag foo' into the later and consolidated code...
d:	my $callForm = $qs-{'callForm'} || 'main_display'; # get the 
callForm
d:parameter
d:
d:	my $page = (defined($action-{'callForm'}) ? # is it defined
d:		$action-{'callForm'}-($qs) :
d:		main_display($qs);
d:
d:Which of course requires me to maintain the Hash of $actions
[..]
{
  my %REQ_PARAMS = (
action1 = { # criteria for action 1 },
action2 = { # criteria for action 2 },
etc...
  );
[..]

That was what I was trying to mostly avoid. The idea of
the 'should()' would take me along the line
my $page = ($obj-should($action-{'callForm'})) ?
$obj-${$action-{'callForm'}}($qs) :
$obj-call_form_error($qs);
hence the should look like

my $REQ_PARM = {
doDaemon = 1,

};

sub should { defined($REQ_PARAMS-{$_[0]}); }

sub doDaemon {

}
sub kickDaemon { $me=shift; $me-doDaemon(@_); }
# the synonym trick...
Which still gives me a HASH to manage, plus the actual Sub.

ciao
drieux
---

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


Perl/Linux problem.

2003-09-11 Thread Sara
I recently installed RH 9.0 on my machine with pre-configured Apache and Perl.

I made a simple script HELLO WORLD to check the Perl and it gave me a continuous 
error for 500 Internal Server Error and Premature End of Script Headers.

I double checked the perl path, permissions, httpd.conf etc, everything looks fine, 
ran the script in terminal (perl -wc)  and it produced desired output, verified the 
syntax is ok and there is no problem with this 3 line script, but in the browser it 
again failed to run.

I thought another way of testing it, Using LAN (and samba) I copied a simple script 
from my Windows machine to Apache and ran that script and amazingly it ran without any 
problem (both in terminal and mozilla)

So, what I have assumed that there must be some problem with scripts that I am writing 
in the Linux environment. I am using text editor of Linux (gedit) for saving the 
scripts. I am at a loss now as what I am doing wrong. The simple scripts like 'Hello 
world' written in gedit failed to run (in browser only) but a bit complex script 
imported from Windows XP is runing smoothly?

Do I need to change the text editor for Linux, if yes, what are the recommendations?

Thanks for any input.

Sara.




RE: Perl/Linux problem.

2003-09-11 Thread Wiggins d'Anconia


On Thu, 11 Sep 2003 15:37:05 +0500, Sara [EMAIL PROTECTED] wrote:

 I recently installed RH 9.0 on my machine with pre-configured Apache and Perl.
 
 I made a simple script HELLO WORLD to check the Perl and it gave me a continuous 
 error for 500 Internal Server Error and Premature End of Script Headers.
 
 I double checked the perl path, permissions, httpd.conf etc, everything looks fine, 
 ran the script in terminal (perl -wc)  and it produced desired output, verified the 
 syntax is ok and there is no problem with this 3 line script, but in the browser it 
 again failed to run.
 
 I thought another way of testing it, Using LAN (and samba) I copied a simple script 
 from my Windows machine to Apache and ran that script and amazingly it ran without 
 any problem (both in terminal and mozilla)
 
 So, what I have assumed that there must be some problem with scripts that I am 
 writing in the Linux environment. I am using text editor of Linux (gedit) for saving 
 the scripts. I am at a loss now as what I am doing wrong. The simple scripts like 
 'Hello world' written in gedit failed to run (in browser only) but a bit complex 
 script imported from Windows XP is runing smoothly?
 
 Do I need to change the text editor for Linux, if yes, what are the recommendations?
 
 Thanks for any input.
 

What does the Apache error log have in it?  Usually that is the best way to tell 
exactly waht the error is. 

Without that all the claims you make to checking everything are suspect

http://danconia.org

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



Re: Perl/Linux problem.

2003-09-11 Thread Sara
Apache Error Log: premature end of script headers


Thanks,

Sara.

- Original Message -
From: Wiggins d'Anconia [EMAIL PROTECTED]
To: Sara [EMAIL PROTECTED]; beginperl [EMAIL PROTECTED]
Sent: Friday, September 12, 2003 3:45 AM
Subject: RE: Perl/Linux problem.


:
: 
: On Thu, 11 Sep 2003 15:37:05 +0500, Sara [EMAIL PROTECTED] wrote:
:
:  I recently installed RH 9.0 on my machine with pre-configured Apache and
Perl.
: 
:  I made a simple script HELLO WORLD to check the Perl and it gave me a
continuous error for 500 Internal Server Error and Premature End of
Script Headers.
: 
:  I double checked the perl path, permissions, httpd.conf etc, everything
looks fine, ran the script in terminal (perl -wc)  and it produced desired
output, verified the syntax is ok and there is no problem with this 3 line
script, but in the browser it again failed to run.
: 
:  I thought another way of testing it, Using LAN (and samba) I copied a
simple script from my Windows machine to Apache and ran that script and
amazingly it ran without any problem (both in terminal and mozilla)
: 
:  So, what I have assumed that there must be some problem with scripts
that I am writing in the Linux environment. I am using text editor of Linux
(gedit) for saving the scripts. I am at a loss now as what I am doing wrong.
The simple scripts like 'Hello world' written in gedit failed to run (in
browser only) but a bit complex script imported from Windows XP is runing
smoothly?
: 
:  Do I need to change the text editor for Linux, if yes, what are the
recommendations?
: 
:  Thanks for any input.
: 
:
: What does the Apache error log have in it?  Usually that is the best way
to tell exactly waht the error is.
:
: Without that all the claims you make to checking everything are
suspect
:
: http://danconia.org


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



Re: Perl/Linux problem.

2003-09-11 Thread Sara
Yep, I did that, tried every single option to remove this premature end of
script headers.

Do you think it has to do something with 'gedit' text editor? because I am
scripting in this editor for the very first time.
The scripts copied from Window XP machine have no problems at all, runing
smoothly, only those are producing error which I am writing in the Linux
machine. Why?

use CGI qw(header);
use CGI::Carp qw(fatalsToBrowser);


print header;
print Hello world;


-

with CGI.pm

$q-print($q-header( type = 'text/html')

--

and simply

print Content-Type: text/html\n;

print Hello World\n;

--


Thanks,



Sara.





- Original Message -
From: drieux [EMAIL PROTECTED]
To: cgi cgi-list [EMAIL PROTECTED]
Sent: Friday, September 12, 2003 4:31 AM
Subject: Re: Perl/Linux problem.


:
: Sara,
:
: Wiggins is right, one of the questions is what exactly
: did the Apache Error Log say was it's chief complaint.
:
: The 'premature end of script headers' suggest that your
: output does not have a content-type or there is
: CRLF separating them.
:
: eg:
: [jeeves: 45:] test_cgi GET simple.cgi
: Content-Type: text/plain
: hello World
: [jeeves: 46:]
:
: which is not a separation from the header and the body:
:
: [jeeves: 47:] test_cgi GET simple.cgi
: Content-Type: text/plain
:
: hello World
: [jeeves: 48:]
:
: The script for that is at the end.
:
: Excuse me while I help adjust Wiggins Hair
:
: On Thursday, Sep 11, 2003, at 15:45 US/Pacific, Wiggins d'Anconia wrote:
: [..]
: 
:  Without that all the claims you make to checking everything are
:  suspect
:
: bad hair day there wiggins?
:
: THWACK! THWACK! THWACK
:
: did that help loosen up the dandruf.
:
: ciao
: drieux
:
: ---
: the simple code:
: ### #!/usr/bin/perl -w
: ### use strict;
: ###
: ### our $CRLF = \015\012;   # \r\n is not portable
: ### my $type = text/plain;
: ### print Content-Type: $type . $CRLF . $CRLF . hello World
:
:
:
: --
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
:


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



Re: Perl/Linux problem.

2003-09-11 Thread david
Sara wrote:

 Apache Error Log: premature end of script headers
 
 

[snip]

 output, verified the syntax is ok and there is no problem with this 3 line
 script, but in the browser it again failed to run.

since it's only a 3 liner, can you post it?

david
-- 
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$;
map{~$_1{$,=1,[EMAIL PROTECTED]||3])=~}}0..s~.~~g-1;*_=*#,

goto=print+eval

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



Re: Perl/Linux problem.

2003-09-11 Thread drieux
On Thursday, Sep 11, 2003, at 06:05 US/Pacific, Sara wrote:
[..]
and simply

print Content-Type: text/html\n;

print Hello World\n;
that form will NOT have the separator
and I expect you see something like:
[..]
: [jeeves: 45:] test_cgi GET simple.cgi
: Content-Type: text/plain
: hello World
: [jeeves: 46:]
which is NOT a correct message to send back to
the web-server. You will need to have a
'blank line' between the Content-Type
and the 'hello world'.
but the:
#!/usr/bin/perl -w
use strict;
use CGI qw(header);
print header;
print Hello world;
should work since the CGI::header() will put the additional
CRLF in play and separate them...
You do have the #! line with the -w flag set?

ciao
drieux
---

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


RE: Perl/Linux problem.

2003-09-11 Thread Jonathan E. Hogue
A cgi hello world script must have the headers in it.

For example,

#!/usr/bin/perl

print Content-Type: Text/HTML\n\n;
print Hello World;

-Original Message-
From: Sara [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 5:37 AM
To: beginperl
Subject: Perl/Linux problem.

I recently installed RH 9.0 on my machine with pre-configured Apache and
Perl.

I made a simple script HELLO WORLD to check the Perl and it gave me a
continuous error for 500 Internal Server Error and Premature End of
Script Headers.

I double checked the perl path, permissions, httpd.conf etc, everything
looks fine, ran the script in terminal (perl -wc)  and it produced
desired output, verified the syntax is ok and there is no problem with
this 3 line script, but in the browser it again failed to run.

I thought another way of testing it, Using LAN (and samba) I copied a
simple script from my Windows machine to Apache and ran that script and
amazingly it ran without any problem (both in terminal and mozilla)

So, what I have assumed that there must be some problem with scripts
that I am writing in the Linux environment. I am using text editor of
Linux (gedit) for saving the scripts. I am at a loss now as what I am
doing wrong. The simple scripts like 'Hello world' written in gedit
failed to run (in browser only) but a bit complex script imported from
Windows XP is runing smoothly?

Do I need to change the text editor for Linux, if yes, what are the
recommendations?

Thanks for any input.

Sara.





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



Re: Perl/Linux problem.

2003-09-11 Thread david
Sara wrote:

 Yep, I did that, tried every single option to remove this premature end of
 script headers.
 
 Do you think it has to do something with 'gedit' text editor? because I am
 scripting in this editor for the very first time.
 The scripts copied from Window XP machine have no problems at all, runing
 smoothly, only those are producing error which I am writing in the Linux
 machine. Why?
 
 use CGI qw(header);
 use CGI::Carp qw(fatalsToBrowser);
 
 
 print header;
 print Hello world;

this looks fine. you should lose the '' sign because you are passing @_ to 
header implicitly.

 
 
 -
 
 with CGI.pm
 
 $q-print($q-header( type = 'text/html')

not sure where you declare $q so i am not going to comment on it.

 
 --
 
 and simply
 
 print Content-Type: text/html\n;
 
 print Hello World\n;
 

this is wrong. see Drieux's previous message for reason.

chances are that when you move (you said you copied the script from a 
windows xp machine and then work on it in gedit?) the script from windows 
to linux, your script is carrying over the \r character. gedit won't show 
that to you. try:

[panda]$ head -1 script.cgi | od -c

and see if you see any '\r' character anywhere. if you do, that's probably 
the cause of the problem. remove those characters with:

[panda]$ perl -i -pe 's/\r//' script.cgi

and then run your script again.

david
-- 
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$;
map{~$_1{$,=1,[EMAIL PROTECTED]||3])=~}}0..s~.~~g-1;*_=*#,

goto=print+eval

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



Re: Replacing variable data between fields

2003-09-11 Thread R. Joseph Newton
James Edward Gray II wrote:


 ...

  Address:tab2933spHummingbirdtabSt.tabCity:tabGrotontabState
  :tabCT
  Address:sp4321tabSparrowspAve.tabCity:tabGrotontabState:ta
  bCT
  . . .
 
  What I want to do is get all of the data between Address: and City: and
  strip the tab and replace with spaces.  The only problem is that the
  data between Address: and City: changes.  What I want in the end is:

...

  Address:tab2933spHummingbirdspSt.tabCity:tabGrotontabState:
  tabCT
  Address:tab.4321spSparrowspAve.tabCity:tabGrotontabState:ta
  bCT
 
  (notice that any tab in the address itself is now a sp with tab
  both
  before and after the address.)
 
  I know it involves using the s/// operator to both strip the tabs and
  replace with sp but the problem is that it requires using an array
  for
  each address...and that is what is creating problems for me.
 
  Thanks...

 Hmm, let me think out loud a little.

 I think I see a pattern, so let's first change all of them to spaces.
 That's easy enough:

 s/\t/ /g;

 Now, if we switch all the spaces that are supposed to be tabs to tabs,
 we're done, right.  I bet we can handle that.  What about:

 s/ ([A-Za-z]:) /\t$1\t/g;
 # and...
 s/^([A-Za-z]:) /$1\t/;  # The first one is a special case

I don't think going on a character basis will work well here.  For one thing.
specifiers such as Lane, Ave., or St. are generally capitalized.  Also, some
street and city names are multiword, such as say Cherry Tree Lane, Des Moine,
etc

There is a much more subject-specific solution contained in the
specification.  Tabs After and before the field identifiers.  In this
context, the field identiifers are known, so the job should be very
straightforward:

s/ (City)| (State)/ \t$1/g;
s/(Address) |(City) /$1\t/g;

Never have to even touch any obscure character-based, and error-prone,
differentiations here.

Joseph


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



Re: DBI and mySQL problems

2003-09-11 Thread Thanatos
Gavin Laking wrote:

Hi,

First, sorry for the wrap on the lines below, and my apologies if this
message has been seen already- I appear to be having problems sending
to nntp.perl.org (I didn't realise you had to be subscribed to
[EMAIL PROTECTED] to send).
I am trying to insert some values into a mySQL database, all of the
scalars below have a value(none are undefined). I keep getting errors
similar to the one below and despite being instructed to read the mySQL
manual, I cannot find anything that relates to the problem I'm
experiencing.
Is the problem with my Perl (likely), or mySQL?
Can anyone offer a solution or pointers towards possible solutions?
Thank you in advance for any help you may be able to provide.

CODE:
my $dbh = DBI-connect(DBI:mysql:database,username,password);
my $result = $dbh-prepare(INSERT INTO table(
sitename,siteurl,category,description,country,region,city,added,expires
,submitted) VALUES
(?,?,?,?,?,?,?,?,?,?));$result-execute($sitename,$siteurl,$category,$
description,$country,$region,$city,$added,$expires,$submitted); print
$dbh-errstr(),\n unless ($result);$dbh-disconnect();
ERROR:
DBD::mysql::st execute failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server version for the
right syntax to use near
database(sitename,siteurl,category,description,country,region, at
/home/gl/httpd/index.pl line 403., referer: http://gl.example.com/
 

Hi Gavin,

I ran your code and it worked fine on my system.

What version of MySQL are you running? I have 3.23.43.

Here is the script I wrote: ( I created a new table called 'test' in the 
'test' db )

--

#!/usr/bin/perl -w

use DBI;

$sitename= 'mysite';
$siteurl = 'myurl';
$category= 'foo';
$description = 'here is a description';
$country = 'usa';
$region  = '1'; 
$city= 'ny';
$added   = 'now';
$expires = 'never';
$submitted   = 'today';

my $dbh = DBI-connect(DBI:mysql:test,root,);

my $result = $dbh-prepare(INSERT INTO 
test(sitename,siteurl,category,description,country,region,city,added,expires,submitted) 
VALUES (?,?,?,?,?,?,?,?,?,?));

$result-execute($sitename,$siteurl,$category,$description,$country,$region,$city,$added,$expires,$submitted); 

print $dbh-errstr(),\n unless ($result);
$dbh-disconnect();
---

This mail doesn't seem like it will help you. However, all I did was fix 
the line wraps in your code.

Thanatos



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


Re: DBI and mySQL problems

2003-09-11 Thread Thanatos
Thanatos wrote:

Gavin Laking wrote:

Hi,

First, sorry for the wrap on the lines below, and my apologies if this
message has been seen already- I appear to be having problems sending
to nntp.perl.org (I didn't realise you had to be subscribed to
[EMAIL PROTECTED] to send).
I am trying to insert some values into a mySQL database, all of the
scalars below have a value(none are undefined). I keep getting errors
similar to the one below and despite being instructed to read the mySQL
manual, I cannot find anything that relates to the problem I'm
experiencing.
Is the problem with my Perl (likely), or mySQL?
Can anyone offer a solution or pointers towards possible solutions?
Thank you in advance for any help you may be able to provide.

CODE:
my $dbh = DBI-connect(DBI:mysql:database,username,password);
my $result = $dbh-prepare(INSERT INTO table(
sitename,siteurl,category,description,country,region,city,added,expires
,submitted) VALUES
(?,?,?,?,?,?,?,?,?,?));$result-execute($sitename,$siteurl,$category,$
description,$country,$region,$city,$added,$expires,$submitted); print
$dbh-errstr(),\n unless ($result);$dbh-disconnect();
ERROR:
DBD::mysql::st execute failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server version for the
right syntax to use near
database(sitename,siteurl,category,description,country,region, at
/home/gl/httpd/index.pl line 403., referer: http://gl.example.com/
 

Hi Gavin,

I ran your code and it worked fine on my system.

What version of MySQL are you running? I have 3.23.43.

Here is the script I wrote: ( I created a new table called 'test' in 
the 'test' db )

--

#!/usr/bin/perl -w

use DBI;

$sitename= 'mysite';
$siteurl = 'myurl';
$category= 'foo';
$description = 'here is a description';
$country = 'usa';
$region  = '1'; $city= 'ny';
$added   = 'now';
$expires = 'never';
$submitted   = 'today';
my $dbh = DBI-connect(DBI:mysql:test,root,);

my $result = $dbh-prepare(INSERT INTO 
test(sitename,siteurl,category,description,country,region,city,added,expires,submitted) 
VALUES (?,?,?,?,?,?,?,?,?,?));

$result-execute($sitename,$siteurl,$category,$description,$country,$region,$city,$added,$expires,$submitted); 

print $dbh-errstr(),\n unless ($result);
$dbh-disconnect();
---

This mail doesn't seem like it will help you. However, all I did was 
fix the line wraps in your code.

Thanatos



Oh yeah, one more thing. Are you trying to use the table name 'table'? 
If yes, then that may be your problem. ( I tried to create a table named 
table, just to be sure, and MySQL complained at me ).

Thanatos

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


Perl Module to print $string in exact possition

2003-09-11 Thread Hari Fajri
Hi All, 

What is perl module to print $string in exact position in sceen.
For example: 
i wanna print time remaining: 59 second(s)
after that, i want to replace it with: time remaining: 58 second(s)

Thank you


Re: Perl Module to print $string in exact possition

2003-09-11 Thread Sudarshan Raghavan
Hari Fajri wrote:

Hi All, 

What is perl module to print $string in exact position in sceen.
For example: 
i wanna print time remaining: 59 second(s)
after that, i want to replace it with: time remaining: 58 second(s)

Use '\r' (carraige return) instead of '\n' in your print statements and 
turn autoflush on. E.g
#!/usr/bin/perl
use strict;
use warnings;

#Turn autoflush on, perldoc perlvar
local $| = 1;
print Hello World\r;
sleep (1);
print Hope things are fine\r;
sleep (1);
print \n;
Thank you

 



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


Re: Perl Module to print $string in exact possition

2003-09-11 Thread Hari Fajri
Thank you Raghavan, its work :)




Sudarshan Raghavan [EMAIL PROTECTED] 
09/11/2003 03:44 PM

To
[EMAIL PROTECTED]
cc

Subject
Re: Perl Module to print $string in exact possition






Hari Fajri wrote:

Hi All, 

What is perl module to print $string in exact position in sceen.
For example: 
i wanna print time remaining: 59 second(s)
after that, i want to replace it with: time remaining: 58 second(s)


Use '\r' (carraige return) instead of '\n' in your print statements and 
turn autoflush on. E.g
#!/usr/bin/perl
use strict;
use warnings;

#Turn autoflush on, perldoc perlvar
local $| = 1;
print Hello World\r;
sleep (1);
print Hope things are fine\r;
sleep (1);
print \n;


Thank you

 



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




Re: File::Find Laments

2003-09-11 Thread Stephen
In [EMAIL PROTECTED], [EMAIL PROTECTED] 
wrote
 Stephen wrote:
 
  Rob Dixon wrote:
  
   snippage
 
 The code below does the same as the previous program, but uses
 'preprocess' to sort the files in alpha order before thowing the
 list at 'wanted'. You could also remove files from the list here
 which will be a little quicker than ignoring them in 'wanted'.
 
 In addition all three routines print indented trace to say why
 they've been called. That will show you the general scheme of
 things. What you actually want them to do is down to you!

Ha!  Reminds me of the standard computer salesperson's question, So 
what do you want to be using this computer for?  

Do you really know that until you get there?  

Serendipity aside, I've never viewed the learning process having any 
goal.  Aside from more learning, perhaps.

 
 HTH,
 
 Rob
 
 
 snip Rob's Carefully Written code

I'm going to go and study it carefully and see if I can make it dance. 
Again, a BIG THANKS for your patience and help.

And thanks to Mr. Krahn for his perldoc -f -X and printf splanations.

Cheers.

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



Re: File::Find Laments

2003-09-11 Thread Stephen
In [EMAIL PROTECTED], 
[EMAIL PROTECTED] wrote
 On Sep 10, Stephen said:
 
find( {
  wanted = \wanted,
  preprocess = \preprocess,
  postprocess = \postprocess,
}, 'C:/SomeFolder');
 
 Starting to make sense.  Just a small question, though.  The use of \
 before the sub name -- my understanding is that the \ character is
 used as an escape, the  character defines a sub (but is regularly
 omitted), and the format for calling a sub is sub_name () rather than
 sub_name ().  If that's correct, why is \ being used in the hash?
 
 Outside of strings, \ is used to take a reference to something.  We don't
 want to CALL the wanted(), preprocess(), and postprocess() functions when
 building the hash, we just want the values in the hash to be the places to
 FIND the functions to call.  The find() function expects references to
 functions, so it can call them later.
 
   sub foo { print Hi, $_[0]!\n }
   my $ref_to_foo = \foo;
   $ref_to_foo-(Jeff);
 
 

From the It Seems Obvious When You Put it Like That Category:  I get it!

Thanks for the clarification.

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



mysql and dbi

2003-09-11 Thread Gavin Laking
Hi,

First, sorry for the wrap on the lines below. I am trying to insert some 
values into a mySQL database, all of the scalars below have a value 
(none are undefined). I keep getting errors similar to the one below and 
despite being instructed to read the mySQL manual, I cannot find 
anything that relates to the problem I'm experiencing.

Is the problem with my Perl (likely), or mySQL?
Can anyone offer a solution or pointers towards possible solutions?
Thank you in advance for any help you may be able to provide.

CODE:

my $dbh = DBI-connect(DBI:mysql:database,username,password);
my $result = $dbh-prepare(INSERT INTO table(		 
sitename,siteurl,category,description,country,region,city,added,expires,submitted) 
VALUES (?,?,?,?,?,?,?,?,?,?));
$result-execute($sitename,$siteurl,$category,$description,$country,$region,$city,$added,$expires,$submitted);
print $dbh-errstr(),\n unless ($result);
$dbh-disconnect();

ERROR:

DBD::mysql::st execute failed: You have an error in your SQL syntax. 
Check the manual that corresponds to your MySQL server version for the 
right syntax to use near 
database(sitename,siteurl,category,description,country,region, at 
/home/gl/httpd/index.pl line 403., referer: http://gl.example.com/

--
Gavin Laking
http://www.gavinlaking.co.uk/
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


About stat problem ??

2003-09-11 Thread sum
Dear all

I found that stat command problems, when the file is over 2GB , it 
cannot return any result when i use stat command. The following are the 
information:

-rw-r--r--1 root root  75k Aug 10 08:27 ksyms.6
-rw-r--r--1 root root  18M Sep 11 02:13 lastlog
-rw-r--r--1 root root 2.9G Sep 11 02:59 maillog
The program is:

#!/usr/bin/perl -w
use strict;
my $filename = /var/log/maillog;

my 
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) 
= stat($filename);

print print result for $filename is 
$dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks  
\n;

The result is :
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
Use of uninitialized value in concatenation (.) or string at ./test.pl 
line 8.
print result for /var/log/maillog is  

If we run the same program , but change filename to /var/log/lastlog.
the result is :
print result for /var/log/lastlog is  
2306,311299,33188,1,0,0,0,19136220,1063246432,1063246432,1063246432,4096,37424 

My machine is using redhat 7.3 and the perl version is perl-5.6.1-34.99.6

Anyone has ideas on it ?  is it bug on this perl version ?  Please give 
me some advise , Thanks a lot

Sum



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


system() problem in win98

2003-09-11 Thread sc00170

i have the following function call

$filename_winword=C:/Program Files/Microsoft Office/Office/WINWORD.EXE;

$result-{DOCUMENT_NAME}= the filename from the database.

system (start, ,$filename_winword,/n , docs/$result-{DOCUMENT_NAME});

Although it works great under Win2000 system, when i run it on a win98 system 
it doesn't work.

Has anyone faced a similar problem?



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



Re: mysql and dbi

2003-09-11 Thread Rob Dixon

Gavin Laking wrote:

 First, sorry for the wrap on the lines below. I am trying to insert some
 values into a mySQL database, all of the scalars below have a value
 (none are undefined). I keep getting errors similar to the one below and
 despite being instructed to read the mySQL manual, I cannot find
 anything that relates to the problem I'm experiencing.

 Is the problem with my Perl (likely), or mySQL?
 Can anyone offer a solution or pointers towards possible solutions?

 Thank you in advance for any help you may be able to provide.

 CODE:

 my $dbh = DBI-connect(DBI:mysql:database,username,password);
 my $result = $dbh-prepare(INSERT INTO table(
 sitename,siteurl,category,description,country,region,city,added,expires,submitted)
 VALUES (?,?,?,?,?,?,?,?,?,?));
 $result-execute($sitename,$siteurl,$category,$description,$country,$region,$city,$added,$expires,$submitted);
 print $dbh-errstr(),\n unless ($result);
 $dbh-disconnect();

 ERROR:

 DBD::mysql::st execute failed: You have an error in your SQL syntax.
 Check the manual that corresponds to your MySQL server version for the
 right syntax to use near
 database(sitename,siteurl,category,description,country,region, at
 /home/gl/httpd/index.pl line 403., referer: http://gl.example.com/

Hi Gavin.

You can't call a table 'table'. Call it 'mytable' or, preferably, something
more descriptive.

HTH,

Rob



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



Re: system() problem in win98

2003-09-11 Thread Beau E. Cox
- Original Message - 
From: [EMAIL PROTECTED]
To: Perl Beginners [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 11:23 PM
Subject: system() problem in win98



 i have the following function call

 $filename_winword=C:/Program Files/Microsoft Office/Office/WINWORD.EXE;

 $result-{DOCUMENT_NAME}= the filename from the database.

 system (start, ,$filename_winword,/n ,
docs/$result-{DOCUMENT_NAME});

 Although it works great under Win2000 system, when i run it on a win98
system
 it doesn't work.

 Has anyone faced a similar problem?


Hi -

I doubt your problem has anything whatsoever to do with
perl. Open a command window on your Win 98 system
and mimic what you are trying to do via perl.

Aloha = Beau;



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



Re: system() problem in win98

2003-09-11 Thread sc00170
Do you say that the start doesn't work under win98? However, the DDE for 
the .DOC is the same with the win2k.




Quoting Beau E. Cox [EMAIL PROTECTED]:

 - Original Message - 
 From: [EMAIL PROTECTED]
 To: Perl Beginners [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 11:23 PM
 Subject: system() problem in win98
 
 
 
  i have the following function call
 
  $filename_winword=C:/Program Files/Microsoft Office/Office/WINWORD.EXE;
 
  $result-{DOCUMENT_NAME}= the filename from the database.
 
  system (start, ,$filename_winword,/n ,
 docs/$result-{DOCUMENT_NAME});
 
  Although it works great under Win2000 system, when i run it on a win98
 system
  it doesn't work.
 
  Has anyone faced a similar problem?
 
 
 Hi -
 
 I doubt your problem has anything whatsoever to do with
 perl. Open a command window on your Win 98 system
 and mimic what you are trying to do via perl.
 
 Aloha = Beau;
 
 




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



RE: system() problem in win98

2003-09-11 Thread Tim Johnson

I think what he is saying is that the system() syntax is not changed in Perl
between Win98 and Win2k except where there are changes in the shell of each
operating system.  Try typing the command in manually and make sure it
really works before you start looking for a bug in Perl.  There are subtle
differences in the command lines for Win98 and Win2k.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 2:54 AM
To: Beau E. Cox
Cc: Perl Beginners
Subject: Re: system() problem in win98


Do you say that the start doesn't work under win98? However, the DDE for 
the .DOC is the same with the win2k.




Quoting Beau E. Cox [EMAIL PROTECTED]:

 - Original Message -
 From: [EMAIL PROTECTED]
 To: Perl Beginners [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 11:23 PM
 Subject: system() problem in win98
 
 
 
  i have the following function call
 
  $filename_winword=C:/Program Files/Microsoft 
  Office/Office/WINWORD.EXE;
 
  $result-{DOCUMENT_NAME}= the filename from the database.
 
  system (start, ,$filename_winword,/n ,
 docs/$result-{DOCUMENT_NAME});
 
  Although it works great under Win2000 system, when i run it on a 
  win98
 system
  it doesn't work.
 
  Has anyone faced a similar problem?
 
 
 Hi -
 
 I doubt your problem has anything whatsoever to do with
 perl. Open a command window on your Win 98 system
 and mimic what you are trying to do via perl.
 
 Aloha = Beau;
 
 




-- 
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: system() problem in win98

2003-09-11 Thread Beau E. Cox
Yes; that's what I was trying to say!

- Original Message - 
From: Tim Johnson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Beau E. Cox [EMAIL PROTECTED]
Cc: Perl Beginners [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 11:57 PM
Subject: RE: system() problem in win98



 I think what he is saying is that the system() syntax is not changed in
Perl
 between Win98 and Win2k except where there are changes in the shell of
each
 operating system.  Try typing the command in manually and make sure it
 really works before you start looking for a bug in Perl.  There are subtle
 differences in the command lines for Win98 and Win2k.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 11, 2003 2:54 AM
 To: Beau E. Cox
 Cc: Perl Beginners
 Subject: Re: system() problem in win98


 Do you say that the start doesn't work under win98? However, the DDE for
 the .DOC is the same with the win2k.




 Quoting Beau E. Cox [EMAIL PROTECTED]:

  - Original Message -
  From: [EMAIL PROTECTED]
  To: Perl Beginners [EMAIL PROTECTED]
  Sent: Wednesday, September 10, 2003 11:23 PM
  Subject: system() problem in win98
 
 
  
   i have the following function call
  
   $filename_winword=C:/Program Files/Microsoft
   Office/Office/WINWORD.EXE;
  
   $result-{DOCUMENT_NAME}= the filename from the database.
  
   system (start, ,$filename_winword,/n ,
  docs/$result-{DOCUMENT_NAME});
  
   Although it works great under Win2000 system, when i run it on a
   win98
  system
   it doesn't work.
  
   Has anyone faced a similar problem?
  
 
  Hi -
 
  I doubt your problem has anything whatsoever to do with
  perl. Open a command window on your Win 98 system
  and mimic what you are trying to do via perl.
 
  Aloha = Beau;
 
 




 -- 
 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: system() problem in win98

2003-09-11 Thread sc00170
I don't own a win98 system. How to be sure if the command works under such a 
system. Any reference of what can replace the start command because it stuck 
unless i use it in my syntax.

Quoting Tim Johnson [EMAIL PROTECTED]:

 
 I think what he is saying is that the system() syntax is not changed in Perl
 between Win98 and Win2k except where there are changes in the shell of each
 operating system.  Try typing the command in manually and make sure it
 really works before you start looking for a bug in Perl.  There are subtle
 differences in the command lines for Win98 and Win2k.
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 11, 2003 2:54 AM
 To: Beau E. Cox
 Cc: Perl Beginners
 Subject: Re: system() problem in win98
 
 
 Do you say that the start doesn't work under win98? However, the DDE for 
 the .DOC is the same with the win2k.
 
 
 
 
 Quoting Beau E. Cox [EMAIL PROTECTED]:
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: Perl Beginners [EMAIL PROTECTED]
  Sent: Wednesday, September 10, 2003 11:23 PM
  Subject: system() problem in win98
  
  
  
   i have the following function call
  
   $filename_winword=C:/Program Files/Microsoft 
   Office/Office/WINWORD.EXE;
  
   $result-{DOCUMENT_NAME}= the filename from the database.
  
   system (start, ,$filename_winword,/n ,
  docs/$result-{DOCUMENT_NAME});
  
   Although it works great under Win2000 system, when i run it on a 
   win98
  system
   it doesn't work.
  
   Has anyone faced a similar problem?
  
  
  Hi -
  
  I doubt your problem has anything whatsoever to do with
  perl. Open a command window on your Win 98 system
  and mimic what you are trying to do via perl.
  
  Aloha = Beau;
  
  
 
 
 
 
 -- 
 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: system() problem in win98

2003-09-11 Thread Tim Johnson
If you don't have Win98, then I assume you know someone who does, because
otherwise how do you know there is a problem?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 3:09 AM
To: Tim Johnson
Cc: Beau E. Cox; Perl Beginners
Subject: RE: system() problem in win98


I don't own a win98 system. How to be sure if the command works under such a

system. Any reference of what can replace the start command because it stuck

unless i use it in my syntax.

Quoting Tim Johnson [EMAIL PROTECTED]:

 
 I think what he is saying is that the system() syntax is not changed 
 in Perl between Win98 and Win2k except where there are changes in the 
 shell of each operating system.  Try typing the command in manually 
 and make sure it really works before you start looking for a bug in 
 Perl.  There are subtle differences in the command lines for Win98 and 
 Win2k.
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 11, 2003 2:54 AM
 To: Beau E. Cox
 Cc: Perl Beginners
 Subject: Re: system() problem in win98
 
 
 Do you say that the start doesn't work under win98? However, the DDE 
 for
 the .DOC is the same with the win2k.
 
 
 
 
 Quoting Beau E. Cox [EMAIL PROTECTED]:
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: Perl Beginners [EMAIL PROTECTED]
  Sent: Wednesday, September 10, 2003 11:23 PM
  Subject: system() problem in win98
  
  
  
   i have the following function call
  
   $filename_winword=C:/Program Files/Microsoft
   Office/Office/WINWORD.EXE;
  
   $result-{DOCUMENT_NAME}= the filename from the database.
  
   system (start, ,$filename_winword,/n ,
  docs/$result-{DOCUMENT_NAME});
  
   Although it works great under Win2000 system, when i run it on a
   win98
  system
   it doesn't work.
  
   Has anyone faced a similar problem?
  
  
  Hi -
  
  I doubt your problem has anything whatsoever to do with perl. Open a 
  command window on your Win 98 system and mimic what you are trying 
  to do via perl.
  
  Aloha = Beau;
  
  
 
 
 
 
 --
 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: system() problem in win98

2003-09-11 Thread sc00170
This problem reported to me after trying to execute my program. And it fail to 
open the doc file. The problem is that this man is far away from. I cannot see 
its system.


Quoting Tim Johnson [EMAIL PROTECTED]:

 If you don't have Win98, then I assume you know someone who does, because
 otherwise how do you know there is a problem?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 11, 2003 3:09 AM
 To: Tim Johnson
 Cc: Beau E. Cox; Perl Beginners
 Subject: RE: system() problem in win98
 
 
 I don't own a win98 system. How to be sure if the command works under such a
 
 system. Any reference of what can replace the start command because it stuck
 
 unless i use it in my syntax.
 
 Quoting Tim Johnson [EMAIL PROTECTED]:
 
  
  I think what he is saying is that the system() syntax is not changed 
  in Perl between Win98 and Win2k except where there are changes in the 
  shell of each operating system.  Try typing the command in manually 
  and make sure it really works before you start looking for a bug in 
  Perl.  There are subtle differences in the command lines for Win98 and 
  Win2k.
  
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Thursday, September 11, 2003 2:54 AM
  To: Beau E. Cox
  Cc: Perl Beginners
  Subject: Re: system() problem in win98
  
  
  Do you say that the start doesn't work under win98? However, the DDE 
  for
  the .DOC is the same with the win2k.
  
  
  
  
  Quoting Beau E. Cox [EMAIL PROTECTED]:
  
   - Original Message -
   From: [EMAIL PROTECTED]
   To: Perl Beginners [EMAIL PROTECTED]
   Sent: Wednesday, September 10, 2003 11:23 PM
   Subject: system() problem in win98
   
   
   
i have the following function call
   
$filename_winword=C:/Program Files/Microsoft
Office/Office/WINWORD.EXE;
   
$result-{DOCUMENT_NAME}= the filename from the database.
   
system (start, ,$filename_winword,/n ,
   docs/$result-{DOCUMENT_NAME});
   
Although it works great under Win2000 system, when i run it on a
win98
   system
it doesn't work.
   
Has anyone faced a similar problem?
   
   
   Hi -
   
   I doubt your problem has anything whatsoever to do with perl. Open a 
   command window on your Win 98 system and mimic what you are trying 
   to do via perl.
   
   Aloha = Beau;
   
   
  
  
  
  
  --
  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: system() problem in win98

2003-09-11 Thread Rob Dixon

[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

 i have the following function call

 $filename_winword=C:/Program Files/Microsoft Office/Office/WINWORD.EXE;

 $result-{DOCUMENT_NAME}= the filename from the database.

 system (start, ,$filename_winword,/n , docs/$result-{DOCUMENT_NAME});

 Although it works great under Win2000 system, when i run it on a win98 system
 it doesn't work.

 Has anyone faced a similar problem?

Hi sc00170

What's that '/n' doing in there? As far as I know there's no
such qualifier to 'start', and if there is it should be the
first parameter, where you have a space for some reason.

Anyway, that's not your problem. It's because W98 uses the
'command.com' shell and W2000 uses 'cmd.exe'. 'command.com
doesn't work very well in several ways, and is also the reason
that CPAN installations on Win98 often fail. Perl under W98
also seems to ignore settings of the PERL5SHELL environment
variable.

If you change your call to

  system('command.com /c command', 'paramA', 'paramB', 'paramC');

then you should be OK. In your case this would be

  system (
command.com /c start,
$filename_winword,
docs/$result-{DOCUMENT_NAME}
  );

Try it and see.

HTH,

Rob



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



Re: system() problem in win98

2003-09-11 Thread sc00170
That's my command now, i haven't tried yet. I put the \n because it is written 
in the DDE options. I also use it under the win2k system. Without the /n i 
cannot open the doc.


system(command.com /c start, ,$filename_winword,/n ,docs/$result-
{DOCUMENT_NAME});


Quoting Rob Dixon [EMAIL PROTECTED]:

 
 [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  i have the following function call
 
  $filename_winword=C:/Program Files/Microsoft Office/Office/WINWORD.EXE;
 
  $result-{DOCUMENT_NAME}= the filename from the database.
 
  system (start, ,$filename_winword,/n ,
 docs/$result-{DOCUMENT_NAME});
 
  Although it works great under Win2000 system, when i run it on a win98
 system
  it doesn't work.
 
  Has anyone faced a similar problem?
 
 Hi sc00170
 
 What's that '/n' doing in there? As far as I know there's no
 such qualifier to 'start', and if there is it should be the
 first parameter, where you have a space for some reason.
 
 Anyway, that's not your problem. It's because W98 uses the
 'command.com' shell and W2000 uses 'cmd.exe'. 'command.com
 doesn't work very well in several ways, and is also the reason
 that CPAN installations on Win98 often fail. Perl under W98
 also seems to ignore settings of the PERL5SHELL environment
 variable.
 
 If you change your call to
 
   system('command.com /c command', 'paramA', 'paramB', 'paramC');
 
 then you should be OK. In your case this would be
 
   system (
 command.com /c start,
 $filename_winword,
 docs/$result-{DOCUMENT_NAME}
   );
 
 Try it and see.
 
 HTH,
 
 Rob
 
 
 
 -- 
 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]



Trouble installing libwww-perl-5.69 on Solaris 9

2003-09-11 Thread Daniel.Roberts
Hello All
I can;t seem to manage to succesfully install 
libwww-perl-5.69 on a Solaris 9 box
The make runs just fine...but the make test fails at the which is clipped way
below...

Might anyone have any clues as how to fix this?
What might this have to do with NIS or anytype of network setting stuff?
thanks for any help!
Dan Roberts


robot/rules-dbm...ok
robot/rules...ok
robot/ua-get..NOK 7HTTP Server terminated
robot/ua-get..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
robot/ua..NOK 7HTTP Server terminated
robot/ua..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
local/autoload-getok
local/autoloadok
local/get.ok
local/http-getNOK 7Can't call method is_redirect on an undefined
value at local/http-get.t line 214, DAEMON line 1.
local/http-getNOK 8HTTP Server terminated
local/http-getdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-19
Failed 19/19 tests, 0.00% okay
local/httpNOK 7Can't call method is_redirect on an undefined
value at local/http.t line 188, DAEMON line 1.
local/httpNOK 8HTTP Server terminated
local/httpdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-18
Failed 18/18 tests, 0.00% okay
local/protosubok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed
-
--
local/http-get.t   29  742419   19 100.00%  1-19
local/http.t   29  742418   18 100.00%  1-18
robot/ua-get.t  75  71.43%  1-3 5 7
robot/ua.t  75  71.43%  1-3 5 7
Failed 4/26 test scripts, 84.62% okay. 47/343 subtests failed, 86.30% okay.
*** Error code 29
make: Fatal error: Command failed for target `test'

[EMAIL PROTECTED]:/genenv/ensopr/i0/libwww-perl-5.69
8:12am

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



RE: Trouble installing libwww-perl-5.69 on Solaris 9

2003-09-11 Thread Paul Kraus
I am not an expert but it looks like your missing some prerequisites. Is
this a module? Are you getting it via perl -MCPAN or are you building it
yourself.

Paul

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 8:09 AM
To: [EMAIL PROTECTED]
Subject: Trouble installing libwww-perl-5.69 on Solaris 9


Hello All
I can;t seem to manage to succesfully install 
libwww-perl-5.69 on a Solaris 9 box
The make runs just fine...but the make test fails at the which is
clipped way below...

Might anyone have any clues as how to fix this?
What might this have to do with NIS or anytype of network setting stuff?
thanks for any help! Dan Roberts


robot/rules-dbm...ok
robot/rules...ok
robot/ua-get..NOK 7HTTP Server terminated
robot/ua-get..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
robot/ua..NOK 7HTTP Server terminated
robot/ua..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
local/autoload-getok
local/autoloadok
local/get.ok
local/http-getNOK 7Can't call method is_redirect on an
undefined value at local/http-get.t line 214, DAEMON line 1.
local/http-getNOK 8HTTP Server terminated
local/http-getdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-19
Failed 19/19 tests, 0.00% okay local/httpNOK 7Can't
call method is_redirect on an undefined value at local/http.t line
188, DAEMON line 1. local/httpNOK 8HTTP Server terminated
local/httpdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-18
Failed 18/18 tests, 0.00% okay
local/protosubok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed

-
--
local/http-get.t   29  742419   19 100.00%  1-19
local/http.t   29  742418   18 100.00%  1-18
robot/ua-get.t  75  71.43%  1-3 5 7
robot/ua.t  75  71.43%  1-3 5 7
Failed 4/26 test scripts, 84.62% okay. 47/343 subtests failed, 86.30%
okay.
*** Error code 29
make: Fatal error: Command failed for target `test'

[EMAIL PROTECTED]:/genenv/ensopr/i0/libwww-perl-5.69
8:12am

-- 
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: Trouble installing libwww-perl-5.69 on Solaris 9

2003-09-11 Thread Daniel.Roberts
Hello Paul
I have tried it both ways..by hand and also vi perl -MCPAN and I have the
same issue.
Yes this is a perl module.
Might you know how to troubleshoot the NET::FTP perl module?
Seems that my hostname has one one IP address...but two different hostnames
in DNS..
Dan

-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 8:17 AM
To: Roberts, Daniel PH/US; [EMAIL PROTECTED]
Subject: RE: Trouble installing libwww-perl-5.69 on Solaris 9


I am not an expert but it looks like your missing some prerequisites. Is
this a module? Are you getting it via perl -MCPAN or are you building it
yourself.

Paul

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 8:09 AM
To: [EMAIL PROTECTED]
Subject: Trouble installing libwww-perl-5.69 on Solaris 9


Hello All
I can;t seem to manage to succesfully install 
libwww-perl-5.69 on a Solaris 9 box
The make runs just fine...but the make test fails at the which is
clipped way below...

Might anyone have any clues as how to fix this?
What might this have to do with NIS or anytype of network setting stuff?
thanks for any help! Dan Roberts


robot/rules-dbm...ok
robot/rules...ok
robot/ua-get..NOK 7HTTP Server terminated
robot/ua-get..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
robot/ua..NOK 7HTTP Server terminated
robot/ua..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
local/autoload-getok
local/autoloadok
local/get.ok
local/http-getNOK 7Can't call method is_redirect on an
undefined value at local/http-get.t line 214, DAEMON line 1.
local/http-getNOK 8HTTP Server terminated
local/http-getdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-19
Failed 19/19 tests, 0.00% okay local/httpNOK 7Can't
call method is_redirect on an undefined value at local/http.t line
188, DAEMON line 1. local/httpNOK 8HTTP Server terminated
local/httpdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-18
Failed 18/18 tests, 0.00% okay
local/protosubok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed

-
--
local/http-get.t   29  742419   19 100.00%  1-19
local/http.t   29  742418   18 100.00%  1-18
robot/ua-get.t  75  71.43%  1-3 5 7
robot/ua.t  75  71.43%  1-3 5 7
Failed 4/26 test scripts, 84.62% okay. 47/343 subtests failed, 86.30%
okay.
*** Error code 29
make: Fatal error: Command failed for target `test'

[EMAIL PROTECTED]:/genenv/ensopr/i0/libwww-perl-5.69
8:12am

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



getting the IP address of a visitor to a site

2003-09-11 Thread Anadi Taylor
Hi all,
I am writting a hit counter and would like to get the IP address of a 
visitor to my site, can anyone point me in the right direction please. :D

Thanks in advance

Anadi

_
Sign-up for a FREE BT Broadband connection today! 
http://www.msn.co.uk/specials/btbroadband

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


Re: About stat problem ??

2003-09-11 Thread James Edward Gray II
On Wednesday, September 10, 2003, at 10:04  PM, sum wrote:

Dear all

I found that stat command problems, when the file is over 2GB , it 
cannot return any result when i use stat command. The following are 
the information:
snip

My machine is using redhat 7.3 and the perl version is 
perl-5.6.1-34.99.6

Anyone has ideas on it ?  is it bug on this perl version ?  Please 
give me some advise , Thanks a lot
I'm not sure, but my gut reaction is that this sounds like an OS 
problem.  Does anyone know if Red Hat 7.3 can handle files over 2 Gigs?

Sorry if that's not much help.

James

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


RE: Trouble installing libwww-perl-5.69 on Solaris 9

2003-09-11 Thread Paul Kraus
Ok I did some searching and I didn't find your exact problem but I found
the same error in this thread

http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=utf-8threadm=94ms
0i%24hqg%241%40uns-a.ucl.ac.ukrnum=5prev=/groups%3Fq%3DNOK%2B7%2BCan%2
7t%2Bcall%2Bmethod%2B%2522is_redirect%2522%26hl%3Den%26lr%3D%26ie%3DUTF-
8%26oe%3Dutf-8%26selm%3D94ms0i%2524hqg%25241%2540uns-a.ucl.ac.uk%26rnum%
3D5

If you look at the next 9 messages this answer was posted at the top of
the page...

HTH
Paul


---
After trawling through the web and finding lots of people with EXACTLY
the
same problem as me (and most of the bastards never bothered to put down
how
they fixed it!) I found out (one way) that has let me install LWP.
And it is simple.
The problem I had was because I did not have the correct host name for
my
machine in /etc/hosts
That was all, and it installed!
Dd
Dd [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am having a similar problem with libwww-perl-5.50.tar.gz
 with Perl 5.6 on a RedHat Linux PC.

 robot/uaNOK 2HTTP Server terminated
 robot/uaNOK 7FAILED tests 1-3, 5, 7

 and

 local/http..NOK 8Can't call method is_redirect on an
undefined
 value at local/http.t line 188, DAEMON line 1.
 HTTP Server terminated
 local/http..dubious
 Test returned status 22 (wstat 5632, 0x1600)
 DIED. FAILED tests 1-18
 Failed 18/18 tests, 0.00% okay

 How similar is this to your problem.

 I am new to Linux, so this is confusing to me.  Any help appreciated.

 Duncan Drury

 Steve Livingston [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Any ideas?
 
  Steve
 
 
  New installation: Perl 5.6
  libwww-perl-5.50.tar.gz
 
  robots/ua fails (can't call method url)
  local/http fails (can't call method url)
 

Read the rest of this message... (32 more lines)

Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 8:28 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Trouble installing libwww-perl-5.69 on Solaris 9


Hello Paul
I have tried it both ways..by hand and also vi perl -MCPAN and I have
the same issue. Yes this is a perl module. Might you know how to
troubleshoot the NET::FTP perl module? Seems that my hostname has one
one IP address...but two different hostnames in DNS.. Dan

-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 8:17 AM
To: Roberts, Daniel PH/US; [EMAIL PROTECTED]
Subject: RE: Trouble installing libwww-perl-5.69 on Solaris 9


I am not an expert but it looks like your missing some prerequisites. Is
this a module? Are you getting it via perl -MCPAN or are you building it
yourself.

Paul

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 8:09 AM
To: [EMAIL PROTECTED]
Subject: Trouble installing libwww-perl-5.69 on Solaris 9


Hello All
I can;t seem to manage to succesfully install 
libwww-perl-5.69 on a Solaris 9 box
The make runs just fine...but the make test fails at the which is
clipped way below...

Might anyone have any clues as how to fix this?
What might this have to do with NIS or anytype of network setting stuff?
thanks for any help! Dan Roberts


robot/rules-dbm...ok
robot/rules...ok
robot/ua-get..NOK 7HTTP Server terminated
robot/ua-get..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
robot/ua..NOK 7HTTP Server terminated
robot/ua..FAILED tests 1-3, 5, 7
Failed 5/7 tests, 28.57% okay
local/autoload-getok
local/autoloadok
local/get.ok
local/http-getNOK 7Can't call method is_redirect on an
undefined value at local/http-get.t line 214, DAEMON line 1.
local/http-getNOK 8HTTP Server terminated
local/http-getdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-19
Failed 19/19 tests, 0.00% okay local/httpNOK 7Can't
call method is_redirect on an undefined value at local/http.t line
188, DAEMON line 1. local/httpNOK 8HTTP Server terminated
local/httpdubious
Test returned status 29 (wstat 7424, 0x1d00)
DIED. FAILED tests 1-18
Failed 18/18 tests, 0.00% okay
local/protosubok
Failed Test  Stat Wstat Total Fail  Failed  List of Failed

-
--
local/http-get.t   29  742419   19 100.00%  1-19
local/http.t   29  742418   18 100.00%  1-18
robot/ua-get.t  75  71.43%  1-3 5 7
robot/ua.t  75  71.43%  1-3 5 7
Failed 4/26 test scripts, 84.62% okay. 47/343 subtests failed, 86.30%
okay.
*** Error code 29
make: Fatal error: Command failed for target `test'

[EMAIL PROTECTED]:/genenv/ensopr/i0/libwww-perl-5.69
8:12am

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


-- 

hash of arrays

2003-09-11 Thread Phillip E. Thomas
my %hash=();
my $mykey=key;
my $myval1=$myval2=test;

#store data in a hash of arrays
$hash{$mykey}=[$myval1, $myval2];

Later on I want to retrieve the data and I have to do it like:

$myval1=$hash{$mykey}[0];
$myval2=$hash{$mykey}[1];

There are a lot of array values and I am looking for a more elegant way to
retrieve data, something like
($myval1, $myval2)=$hash{$mykey};  (doesnt work)

I'm sure I am missing something embarrassingly simple. Any help would be
appreciated.

Phillip



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



getting the IP address of a visitor to a site

2003-09-11 Thread Anadi Taylor
Hi all,
I am writting a hit counter and would like to get the IP address of a 
visitor to my site, can anyone point me in the right direction please. :D

Thanks in advance

Anadi

_
Express yourself with cool emoticons - download MSN Messenger today! 
http://www.msn.co.uk/messenger

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


Is there a way in PERL ......

2003-09-11 Thread Anadi Taylor
Hi Again,
I want to run a perl script that does a check and depending on the results 
of that check i want to run different HTML pages.
For example: if the check is positive i want to run index1.htm else I want 
to run index2.htm

can this be done ??

Thanks again

Anadi



You are just a dewdrop, and as you meditate the dewdrop starts slipping from 
the petals of the Lotus towards the ocean. When the meditation is complete, 
the dewdrop has disappeared into the ocean. Or you can say, the ocean has 
disappeared into the dewdrop.

Bhagwan Shree Rajneesh.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

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


RE: Is there a way in PERL ......

2003-09-11 Thread Paul Kraus
Yes. Without more info that's about all you get =)
Paul

-Original Message-
From: Anadi Taylor [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 9:06 AM
To: [EMAIL PROTECTED]
Subject: Is there a way in PERL ..



Hi Again,
I want to run a perl script that does a check and depending on the
results 
of that check i want to run different HTML pages.
For example: if the check is positive i want to run index1.htm else I
want 
to run index2.htm

can this be done ??

Thanks again

Anadi



You are just a dewdrop, and as you meditate the dewdrop starts slipping
from 
the petals of the Lotus towards the ocean. When the meditation is
complete, 
the dewdrop has disappeared into the ocean. Or you can say, the ocean
has 
disappeared into the dewdrop.

Bhagwan Shree Rajneesh.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger


-- 
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: Is there a way in PERL ......

2003-09-11 Thread Rob Dixon
Anadi Taylor wrote:

 I want to run a perl script that does a check and depending
 on the results of that check i want to run different HTML
 pages. For example: if the check is positive i want to run
 index1.htm else I want to run index2.htm

 can this be done ??

Hi Anadi.

Almost certainly yes.

What do you mean by 'run' HTML pages? Are you writing
server-side CGI code?

Rob



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



Re: Is there a way in PERL ......

2003-09-11 Thread Matthew Harrison
yes you can do something like this (very quick 
example - not tested):

snip
my $ping = `ping -c4 | tail -n1`; chomp($ping);
if ($ping =~ s/unreachable/)
{
print EOF
html
headtitleerror/title
body
font color=red size=9 cannot reach machine /font
/html
EOF
;
}
else
{
print EOF
html
headtitleok/title
body
font color=green size=9 everything is ok /font
/html
EOF
;
}
/snip

On Thu, Sep 11, 2003 at 01:05:30PM +, Anadi Taylor wrote:
 
 Hi Again,
 I want to run a perl script that does a check and depending on the results 
 of that check i want to run different HTML pages.
 For example: if the check is positive i want to run index1.htm else I want 
 to run index2.htm
 
 can this be done ??
 
 Thanks again
 
 Anadi
 
 
 
 You are just a dewdrop, and as you meditate the dewdrop starts slipping 
 from the petals of the Lotus towards the ocean. When the meditation is 
 complete, the dewdrop has disappeared into the ocean. Or you can say, the 
 ocean has disappeared into the dewdrop.
 
 Bhagwan Shree Rajneesh.
 
 _
 Use MSN Messenger to send music and pics to your friends 
 http://www.msn.co.uk/messenger
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]


pgp0.pgp
Description: PGP signature


Output and logs

2003-09-11 Thread Kevin Roland Viel
Greetings,

   I have just installed ActivePerl 5.8.0.806 on a Win2000 machine.  My
path variable contains C:\Perl\bin\.  I have the following code in a
program
print.pl:

$DNA=AGT;
print $DNA;
exit;

   Where might I see the results?  For instance, I expected a window to
pop up (since I submitted it using RUN in the START menu)?  Also, is there
a log file also?  I realize that the code does not specify any, but
perhaps there might be files or windows created by default.

Thank you in advance,

Kevin


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



Re: hash of arrays

2003-09-11 Thread James Edward Gray II
On Thursday, September 11, 2003, at 06:58  AM, Phillip E. Thomas wrote:

my %hash=();
my $mykey=key;
my $myval1=$myval2=test;
#store data in a hash of arrays
$hash{$mykey}=[$myval1, $myval2];
Later on I want to retrieve the data and I have to do it like:

$myval1=$hash{$mykey}[0];
$myval2=$hash{$mykey}[1];
There are a lot of array values and I am looking for a more elegant 
way to
retrieve data, something like
($myval1, $myval2)=$hash{$mykey};  (doesnt work)
Maybe something like the following would help you.  The first one 
simply dereferences the whole array, the second takes a slice of the 
array, with the given indexes.

($myval1, $myval2)= @{ $hash{$mykey} };

or

($myval1, $myval2)= @{ $hash{$mykey} }[0, 1];

Hope that helps.

James

I'm sure I am missing something embarrassingly simple. Any help would 
be
appreciated.

Phillip



--
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: Output and logs

2003-09-11 Thread Paul Kraus
It won't keep a window open in run. It will run the program print the
results and close the window. Usually faster then you can see.
Start run cmd.
The go to the directory and run the script.
What kind of log file are you looking for? Its not going to just log
itself. You can have your scripts create their own logs very easily.

Paul

-Original Message-
From: Kevin Roland Viel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 9:23 AM
To: [EMAIL PROTECTED]
Subject: Output and logs


Greetings,

   I have just installed ActivePerl 5.8.0.806 on a Win2000 machine.  My
path variable contains C:\Perl\bin\.  I have the following code in a
program
print.pl:

$DNA=AGT;
print $DNA;
exit;

   Where might I see the results?  For instance, I expected a window to
pop up (since I submitted it using RUN in the START menu)?  Also, is
there a log file also?  I realize that the code does not specify any,
but perhaps there might be files or windows created by default.

Thank you in advance,

Kevin


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



redirect path in log file

2003-09-11 Thread Vema Venkata






 Hi 
 i want to wirte to a log file AHDXAPI Server is now started running $now_string;to 
 the following path
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log
 
 
 #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
 #/usr/local/bin/perl
 
 use POSIX qw(strftime);
 $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;  
 $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;
 $ret = qx(pgrep -f srvtst26);
 if ($? eq 0){
   $ret = qx(pgrep -f $xapipgm);
  # $proc= qx(ps -e|grep svrtst26);
   print AHD XAPI SERver Running with Process ID  On $now_string;
 }  
 else{
 open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log) || 
 Error('open', 'file'); 
 print LOG AHDXAPI Server is now started running $now_string;
 close (LOG);
   $ret = qx(perl $xapipgm 
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
 }
 

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



RE: getting the IP address of a visitor to a site

2003-09-11 Thread Dan Muey

 Hi all,

Howdy

 I am writting a hit counter and would like to get the IP address of a 
 visitor to my site, can anyone point me in the right 
 direction please. :D
 

$ENV{'REMOTE_HOST'}

perldoc perlvar
Look for the %ENV section

HTH

DMuey

 Thanks in advance
 
 Anadi
 
 _
 Express yourself with cool emoticons - download MSN Messenger today! 
 http://www.msn.co.uk/messenger
 
 
 -- 
 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: Is there a way in PERL ......

2003-09-11 Thread Janek Schleicher
Anadi Taylor wrote at Thu, 11 Sep 2003 13:05:30 +:

 I want to run a perl script that does a check and depending on the results 
 of that check i want to run different HTML pages.
 For example: if the check is positive i want to run index1.htm else I want 
 to run index2.htm
 
 can this be done ??

That's a FAQ:
perldoc -q Can I do


Greetings,
Janek

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



Re: redirect path in log file

2003-09-11 Thread Rob Dixon
Vema wrote:

 i want to write to a log file AHDXAPI Server is now started running $now_string;
 to the following path
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log


 #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
 #/usr/local/bin/perl

  use strict;
  use warnings;

 use POSIX qw(strftime);

 $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;
 $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;

 $ret = qx(pgrep -f srvtst26);

 if ( $? eq 0 ) {
   $ret = qx(pgrep -f $xapipgm);
   # $proc= qx(ps -e|grep svrtst26);
   print AHD XAPI SERver Running with Process ID  On $now_string;
 }
 else{
   open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log)
   || Error('open', 'file');
   print LOG AHDXAPI Server is now started running $now_string;
   close (LOG);
   $ret = qx(perl $xapipgm 
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
 }

Hi Vema.

You're not saying what your problem is. The code above looks
like it might work, but you should

  use strict;   # always
  use warnings; # usually

You'll have to declare all your variables with 'my' as well.

What's not working for you?

Rob



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



RE: mysql and dbi

2003-09-11 Thread Dan Muey
 Hi,

Howdy

 
 First, sorry for the wrap on the lines below. I am trying to 
 insert some 
 values into a mySQL database, all of the scalars below have a value 
 (none are undefined). I keep getting errors similar to the 
 one below and 
 despite being instructed to read the mySQL manual, I cannot find 
 anything that relates to the problem I'm experiencing.
 
 Is the problem with my Perl (likely), or mySQL?
 Can anyone offer a solution or pointers towards possible solutions?
 
 Thank you in advance for any help you may be able to provide.
 
 CODE:
 
 my $dbh = DBI-connect(DBI:mysql:database,username,password);
 my $result = $dbh-prepare(INSERT INTO table( 
 sitename,siteurl,category,description,country,region,city,adde
 d,expires,submitted) 
 VALUES (?,?,?,?,?,?,?,?,?,?)); 
 $result-execute($sitename,$siteurl,$category,$description,$co
 untry,$region,$city,$added,$expires,$submitted);
 print $dbh-errstr(),\n unless ($result);
 $dbh-disconnect();
 
 ERROR:
 
 DBD::mysql::st execute failed: You have an error in your SQL syntax. 
 Check the manual that corresponds to your MySQL server 
 version for the 
 right syntax to use near 
 database(sitename,siteurl,category,description,country,region, at 
 /home/gl/httpd/index.pl line 403., referer: http://gl.example.com/
 

Besides having atable named table not 'table' being illegal.
You may have problems with the strings being un quoted, I could be wroing but I'd have 
a look at that.
Look at $dbh-quote();

HTH

DMuey

 --
 Gavin Laking
 
http://www.gavinlaking.co.uk/
--


-- 
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: hash of arrays

2003-09-11 Thread Dan Muey
 my %hash=();
 my $mykey=key;
 my $myval1=$myval2=test;
 
 #store data in a hash of arrays
 $hash{$mykey}=[$myval1, $myval2];
 
 Later on I want to retrieve the data and I have to do it like:
 
 $myval1=$hash{$mykey}[0];
 $myval2=$hash{$mykey}[1];
 
 There are a lot of array values and I am looking for a more 
 elegant way to retrieve data, something like ($myval1, 
 $myval2)=$hash{$mykey};  (doesnt work)

That does not work like you expect because you are assigning the array reference tp 
$myval1
Try :

my($myval1,$myval2) = @{$hash{$mykey}};
 
One elegant (Mmm maybe not elegant ;p ) way is to just use the $hash{$mykey}[0] 
version and not 
muck up the name space and lengthen your code declaring tons of variables.

Just a thought

DMuey

 
 I'm sure I am missing something embarrassingly simple. Any 
 help would be appreciated.
 
 Phillip
 
 
 
 -- 
 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: Replacing variable data between fields

2003-09-11 Thread James Edward Gray II
On Thursday, September 11, 2003, at 01:03  AM, R. Joseph Newton wrote:

James Edward Gray II wrote:


...

Address:tab2933spHummingbirdtabSt.tabCity:tabGrotontabSta 
te
:tabCT
Address:sp4321tabSparrowspAve.tabCity:tabGrotontabState: 
ta
bCT
. . .

What I want to do is get all of the data between Address: and City:  
and
strip the tab and replace with spaces.  The only problem is that  
the
data between Address: and City: changes.  What I want in the end is:
...

Address:tab2933spHummingbirdspSt.tabCity:tabGrotontabStat 
e:
tabCT
Address:tab.4321spSparrowspAve.tabCity:tabGrotontabState: 
ta
bCT

(notice that any tab in the address itself is now a sp with tab
both
before and after the address.)
I know it involves using the s/// operator to both strip the tabs and
replace with sp but the problem is that it requires using an array
for
each address...and that is what is creating problems for me.
Thanks...
Hmm, let me think out loud a little.

I think I see a pattern, so let's first change all of them to spaces.
That's easy enough:
s/\t/ /g;

Now, if we switch all the spaces that are supposed to be tabs to tabs,
we're done, right.  I bet we can handle that.  What about:
s/ ([A-Za-z]:) /\t$1\t/g;
# and...
s/^([A-Za-z]:) /$1\t/;  # The first one is a special case
I don't think going on a character basis will work well here.  For one  
thing.
specifiers such as Lane, Ave., or St. are generally capitalized.   
Also, some
street and city names are multiword, such as say Cherry Tree Lane, Des  
Moine,
etc
My corrections, posted yesterday morning, explain how I'm not searching  
through the addresses at all.  If you missed it, my improved code was:

tr/\t/ /;
s/(^| )([A-Za-z]+:) / $1 ? \t$2\t : $2\t /eg;
There is a much more subject-specific solution contained in the
specification.  Tabs After and before the field identifiers.  In this
context, the field identiifers are known, so the job should be very
straightforward:
s/ (City)| (State)/ \t$1/g;
s/(Address) |(City) /$1\t/g;
Unfortunately, your code doesn't seem to work.  I believe you meant:

s/ City:| State:/\t$1/g;
s/Address: |City: |State: /$1\t/g;
Never have to even touch any obscure character-based, and error-prone,
differentiations here.
Well, as this is Perl, TMTOWTDI.  However, to be honest, I much prefer  
my own solution.  Let me tell you why.

Essentially what we're talking about here is a colon delimited file.   
By treating it as such, we get a lot more flexibility, I think.

For example, I guessed there was likely a Zip: field we weren't shown  
in the sample.  My solution handles that as well.  Yours could be made  
to by changing two lines of code.

There may be 10 more fields, or even 100, left out of the sample to  
keep it simple and short.  That's adding up to a lot of changes and  
those are going to be some pretty long Regular Expressions you'll have.

What if they want to add a field someday, to track Name: say?  Should  
they have to go to the programmer every time?  It's well known that we  
can't see the future, but I think we can code for some reasonable  
growth in mind.

Again though, TMTOWTDI, and you have definitely shown another way to  
attack the problem.

James

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


log file contents

2003-09-11 Thread Vema Venkata


Hi

AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003

The above message is getting registerd in the log file 
my script i had schedule it for every minute thru crontab
after a minute the following is getting update in my log file

AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003


but what i want is to append the contents of the log file like

how can i achive this
AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003


*
#!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
#/usr/local/bin/perl
use strict;
use warnings;
use POSIX qw(strftime);
my $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;  
my $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;
my $ret = qx(pgrep -f srvtst26);
if ($? eq 0){
my  $ret = qx(pgrep -f $xapipgm);
 # $proc= qx(ps -e|grep svrtst26);
  print AHD XAPI SERver Running with Process ID '$ret' On $now_string;
}  
else{
open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log) || 
Error('open', 'file'); 
print LOG AHDXAPI Server is now started running $now_string;
close (LOG);
my $ret = qx(perl $xapipgm 
/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
}


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



using cpan - need info

2003-09-11 Thread JOHN FISHER
I am extremely new to trying to navigate CPAN. I do it from a command line. While the 
screen can dump out so much information the help screen is very limited. Is there a 
document or the like that can give me more information on using CPAN. 

When I tried doing a command like
  i /Text::/
the screen whipped by so fast I couldn't follow it. I did use Cntl-S to stop it and 
that helped, but was hoping to use a pipe and grep it. Couldn't make that work.

One of the main things I want to do is learn more about modules. 
Typing in 
i Text::Chump 
doesn't give me enough info to understand what it is and how to use it.

I did try a command 
   readme Text::Diff
and got back 
===
Please check, if the URLs I found in your configuration file
(ftp://archive.progeny.com/CPAN/, ftp://cpan-sj.viaverio.com/pub/CPAN/,
ftp://cpan.cse.msu.edu/) are valid. The urllist can be edited. E.g. with 'o
conf urllist push ftp://myurl/'

Could not fetch authors/id/R/RB/RBS/Text-Diff-0.35.readme

No R/RB/RBS/Text-Diff-0.35.readme found
===

Any help is appreciated,
John


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



log file contents

2003-09-11 Thread Vema Venkata
 Hi
 
 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
 
 The above message is getting registerd in the log file 
 my script i had schedule it for every minute thru crontab
 after a minute the following is getting update in my log file
 
 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003
 
 
 but what i want is to append the contents of the log file like
 
 how can i achive this
 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003
 
 
 *
 #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
 #/usr/local/bin/perl
 use strict;
 use warnings;
 use POSIX qw(strftime);
 my $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;  
 my $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;
 my $ret = qx(pgrep -f srvtst26);
 if ($? eq 0){
 my  $ret = qx(pgrep -f $xapipgm);
  # $proc= qx(ps -e|grep svrtst26);
   print AHD XAPI SERver Running with Process ID '$ret' On $now_string;
 }  
 else{
 open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log) || 
 Error('open', 'file'); 
 print LOG AHDXAPI Server is now started running $now_string;
 close (LOG);
 my $ret = qx(perl $xapipgm 
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
 }
 

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



HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! log file contents

2003-09-11 Thread Vema Venkata

Hi Rob
   
 
 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
 
 The above message is getting registerd in the log file 
 my script i had schedule it for every minute thru crontab
 after a minute the following is getting update in my log file
 
 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003
 
 
 but what i want is to append the contents of the log file like
 
 how can i achive this
 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003
 
 
 *
 #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
 #/usr/local/bin/perl
 use strict;
 use warnings;
 use POSIX qw(strftime);
 my $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;  
 my $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;
 my $ret = qx(pgrep -f srvtst26);
 if ($? eq 0){
 my  $ret = qx(pgrep -f $xapipgm);
  # $proc= qx(ps -e|grep svrtst26);
   print AHD XAPI SERver Running with Process ID '$ret' On $now_string;
 }  
 else{
 open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log) || 
 Error('open', 'file'); 
 print LOG AHDXAPI Server is now started running $now_string;
 close (LOG);
 my $ret = qx(perl $xapipgm 
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
 }
 

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



RE: using cpan - need info

2003-09-11 Thread Wiggins d'Anconia


On Thu, 11 Sep 2003 08:55:52 -0500, JOHN FISHER [EMAIL PROTECTED] wrote:

 I am extremely new to trying to navigate CPAN. I do it from a command line. While 
 the screen can dump out so much information the help screen is very limited. Is 
 there a document or the like that can give me more information on using CPAN. 
 
 When I tried doing a command like
   i /Text::/
 the screen whipped by so fast I couldn't follow it. I did use Cntl-S to stop it and 
 that helped, but was hoping to use a pipe and grep it. Couldn't make that work.
 
 One of the main things I want to do is learn more about modules. 
 Typing in 
 i Text::Chump 
 doesn't give me enough info to understand what it is and how to use it.
 
 I did try a command 
readme Text::Diff
 and got back 
 ===
 Please check, if the URLs I found in your configuration file
 (ftp://archive.progeny.com/CPAN/, ftp://cpan-sj.viaverio.com/pub/CPAN/,
 ftp://cpan.cse.msu.edu/) are valid. The urllist can be edited. E.g. with 'o
 conf urllist push ftp://myurl/'
 
 Could not fetch authors/id/R/RB/RBS/Text-Diff-0.35.readme
 
 No R/RB/RBS/Text-Diff-0.35.readme found
 ===
 

The web interface is very easy to use:  http://search.cpan.org or is there some reason 
why this must be done from the CLI?  If so the limitation of scrolling is usually best 
handled in the terminal window rather than CPAN. Though the pipe/grep combo would be 
nice it is not a shell its the CPAN client, and I suppose in the end that is why there 
is the web interface.  Although I have not used it you may also want to check out 
CPANPLUS as it is supposed to be better...

http://danconia.org

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



Re: [:^class:] question

2003-09-11 Thread R. Joseph Newton
Dan Muey wrote:

 SO my question is:

 Which is faster/better/more portable/compliant etc

 [^[:ascii:] or [[:^ascii:]] ??

How about [^:ascii:]?

Joseph


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



RE: mysql and dbi

2003-09-11 Thread Wiggins d'Anconia


On Thu, 11 Sep 2003 08:39:06 -0500, Dan Muey [EMAIL PROTECTED] wrote:

  Hi,
 
 Howdy
 
  
  First, sorry for the wrap on the lines below. I am trying to 
  insert some 
  values into a mySQL database, all of the scalars below have a value 
  (none are undefined). I keep getting errors similar to the 
  one below and 
  despite being instructed to read the mySQL manual, I cannot find 
  anything that relates to the problem I'm experiencing.
  
  Is the problem with my Perl (likely), or mySQL?
  Can anyone offer a solution or pointers towards possible solutions?
  
  Thank you in advance for any help you may be able to provide.
  
  CODE:
  
  my $dbh = DBI-connect(DBI:mysql:database,username,password);
  my $result = $dbh-prepare(INSERT INTO table(   
  sitename,siteurl,category,description,country,region,city,adde
  d,expires,submitted) 
  VALUES (?,?,?,?,?,?,?,?,?,?)); 
  $result-execute($sitename,$siteurl,$category,$description,$co
  untry,$region,$city,$added,$expires,$submitted);
  print $dbh-errstr(),\n unless ($result);
  $dbh-disconnect();
  
  ERROR:
  
  DBD::mysql::st execute failed: You have an error in your SQL syntax. 
  Check the manual that corresponds to your MySQL server 
  version for the 
  right syntax to use near 
  database(sitename,siteurl,category,description,country,region, at 
  /home/gl/httpd/index.pl line 403., referer: http://gl.example.com/
  
 
 Besides having atable named table not 'table' being illegal.
 You may have problems with the strings being un quoted, I could be wroing but I'd 
 have a look at that.
 Look at $dbh-quote();
 

Though now I can't seem to find where I read it, by calling 'execute' with binding 
values quoting is performed automagically by eitehr DBI or the driver.   From the docs 
for the 'quote' method:  There is no need to quote values being used with 
Placeholders and Bind Values.

http://danconia.org

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



Re: Conditional compilation

2003-09-11 Thread Beau E. Cox
- Original Message - 
From: Harter, Douglas [EMAIL PROTECTED]
To: Beginners Mailing List Perl (E-mail) [EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 4:46 AM
Subject: Conditional compilation


 I am writing a Perl script which will run on multiple machines. I have a
 use Expect;
 in the script.

 The problem is that Perl Expect is not currently installed on all the
 machines.

 Does Perl have any conditional compilation so that I can somehow NOT
execute
 the use statement on the machines that do not have expect? Or is there
 another way to handle this situation?

Hi -

'use' processing is done at compile-time, not run-time,
so run-time conditionals don't have any effect. Replace
your 'use' with 'require' and 'import' (resolved at
run-time) within conditionals, or check the results
on the 'require' ($@ I think) to determine if the module
is present. Play with it; check docs.

Aloha = Beau;



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



RE: Conditional compilation

2003-09-11 Thread Wiggins d'Anconia


On Thu, 11 Sep 2003 10:46:29 -0400, Harter, Douglas [EMAIL PROTECTED] wrote:

 I am writing a Perl script which will run on multiple machines. I have a 
 use Expect;
 in the script. 
 
 The problem is that Perl Expect is not currently installed on all the
 machines. 
 
 Does Perl have any conditional compilation so that I can somehow NOT execute
 the use statement on the machines that do not have expect? Or is there
 another way to handle this situation?
 

perldoc -f eval 

http://danconia.org

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



Re: [:^class:] question

2003-09-11 Thread James Edward Gray II
On Thursday, September 11, 2003, at 09:46  AM, R. Joseph Newton wrote:

Dan Muey wrote:

SO my question is:

Which is faster/better/more portable/compliant etc

[^[:ascii:] or [[:^ascii:]] ??
How about [^:ascii:]?
The part of the message you snipped in your quoting answers this.  Here 
it is again, with John W. Krahn's comments:

perldoc perlre on 5.8.0 says that [:ascii:] should match any ascii
character and [:^ascii:] is the negate version.
If I do =~m/[:^ascii:]/ or [:ascii:] on astring that is 'hi' it
That character class matches the characters 'a', 'c', 'i', 's', ':' or
'^' and 'hi' contains the character 'i' so it returns true.

returns true each way, so I believe it says the [] are part of
[::] conbstruct which I think means you have to have[[:class:]]
Yes.

James

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


Env. var LC_ALL

2003-09-11 Thread Gisle Askestad
Hi

I'm using RedHat 8.0 and Perl 5.8.0

I'm trying to install Time:HiRes from CPAN which is needed to use the
File::Tail module. When running Make i get the error:
Makefile:91: *** missing separator.  Stop.

Makefile.PL says:

NOTE: if you get an error like this (the line number may vary):
Makefile:91: *** missing separator
then set the environment variable LC_ALL to C and retry.
Anyone knows where or how to set envionment variable LC_ALL to C?

Regards

G. Askestad





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


Re: HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! log file contents

2003-09-11 Thread Rob Dixon

Vema wrote:

 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003

 The above message is getting registerd in the log file
 my script i had schedule it for every minute thru crontab
 after a minute the following is getting update in my log file

 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003


 but what i want is to append the contents of the log file like

 how can i achive this
 AHDXAPI Server is now started running Thu Sep 11 23:51:00 2003
 AHD XAPI SERver Running with Process ID '18383' On Thu Sep 11 23:53:00 2003


 ***
 #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
 #/usr/local/bin/perl
 use strict;
 use warnings;
 use POSIX qw(strftime);
 my $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;
 my $xapipgm = /proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl;
 my $ret = qx(pgrep -f srvtst26);
 if ($? eq 0){
 my  $ret = qx(pgrep -f $xapipgm);
  # $proc= qx(ps -e|grep svrtst26);
   print AHD XAPI SERver Running with Process ID '$ret' On $now_string;
 }
 else{
 open (LOG,/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log) || 
 Error('open', 'file');
 print LOG AHDXAPI Server is now started running $now_string;
 close (LOG);
 my $ret = qx(perl $xapipgm 
 /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log);
 }
 *

Hi Vema.

I'm not clear whether this script is 'srvtst26.pl' or another separate
Perl script.

This might work for you.

I hope it helps,

Rob


#!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl
#/usr/local/bin/perl

use strict;
use warnings;

use POSIX qw(strftime);

my $now_string = strftime %a %b %e %H:%M:%S %Y, localtime;
my $xapipgm = '/proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl';
my $logfile = '/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log';

open LOG, '', $logfile or Error('open', 'file');

my $ret = qx(pgrep -f srvtst26);

if ($? == 0) {
  print LOG AHD XAPI SERver Running with Process ID '$ret' On $now_string;
}
else{
  print LOG AHDXAPI Server is now started running $now_string;
  $ret = qx(perl $xapipgm  $logfile);
}

close LOG;




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



perl script works one machine but not others?

2003-09-11 Thread crayola
Folks, 

I used my linux box running perl 5.8 to develop a small script that 
scans a list of directories and searches for files that dont have the group 
set to productn or dialup. It works great on my linux box, but now 
I need to run it on our sun systems which are running perl version 5.005_02.
(Ungrading perl is not a solution unfortunatly, developers would freak out). 
It doesnt seem to work at all on the sun systems. It never seems to 
enter the directories and doesnt find anything. 

A normal program run looks like this on my linux box... 

[EMAIL PROTECTED] mcunning]$ ./scan-novell
Checking the directory: /nfs/links/live.run
Filename - GroupID (thats not productn or dialup)
-
/nfs/links/live.run  -  root
/nfs/links/live.run/passwd  -  root
/nfs/links/live.run/test4  -  nut
Checking the directory: /nfs/links/prefixes
Filename - GroupID (thats not productn or dialup)
-
/nfs/links/prefixes  -  root
/nfs/links/prefixes/passwd  -  root
/nfs/links/prefixes/test3  -  root
/nfs/links/prefixes/test4  -  root
/nfs/links/prefixes/testsubdir  -  root
/nfs/links/prefixes/testsubdir/test6  -  nut
Checking the directory: /nfs/links/transmit
Filename - GroupID (thats not productn or dialup)
-
/nfs/links/transmit  -  mcunning

A bad run on one of my sun systems looks like this.. 

mickey(mcunning)$ ./scan-novell
Checking the directory: /nfs/links/live.run
Filename - GroupID (thats not productn or dialup)
-
Checking the directory: /nfs/links/params
Filename - GroupID (thats not productn or dialup)
-
Checking the directory: /nfs/links/prefixes
Filename - GroupID (thats not productn or dialup)
-
Checking the directory: /nfs/links/storage
Filename - GroupID (thats not productn or dialup)
-
Checking the directory: /nfs/links/transmit
Filename - GroupID (thats not productn or dialup)
-
Can't call method name on an undefined value at ./scan-novell line 41.

Any ideas where I am going wrong? 

The code is below.. 
Thanks for any help you can offer. Mike
--

#!/usr/bin/perl
# This program will scan the novell nfs mounts on a 
# host, if each one exists, for permission problems. 
# It will then list out the files that need to be 
# fixed.
#
# MC - 9/10/03

use File::Find;
use File::stat;
use User::grent;

$basedir = /nfs/links/;
@dirlist = qw(live.run params prefixes storage transmit);
*name = *File::Find::name;

foreach $directory (@dirlist) {
if ( -d $basedir$directory){
print \n;
print Checking the directory: $basedir$directory\n;
print Filename - GroupID (thats not productn or dialup)\n;
print -\n;
find(\wanted, $basedir$directory);
 }
}

sub wanted {
my $check = stat($_);
return unless $check;

if ( -d $_ || -f $_ ) { 
my $groupname = group($check-gid());
if ($groupname ne productn  $groupname ne dialup){
 print $File::Find::name  -  $groupname\n;
}
}
}

sub group {
my $gid = shift;
$group{$gid} = getgrgid($gid)-name || #$gid
   unless defined $group{$gid};
return $group{$gid};
}





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



RE: Env. var LC_ALL

2003-09-11 Thread Dan Muey

 Hi

Howdy

 
 I'm using RedHat 8.0 and Perl 5.8.0
 
 I'm trying to install Time:HiRes from CPAN which is needed to 
 use the File::Tail module. When running Make i get the error:
 
 Makefile:91: *** missing separator.  Stop.
 
 Makefile.PL says:
 
 NOTE: if you get an error like this (the line number may vary):
 Makefile:91: *** missing separator
 then set the environment variable LC_ALL to C and retry.
 
 
 Anyone knows where or how to set envionment variable LC_ALL to C?
 

setenv LC_ALL=C (or similar based on OS/version/whatever)
man setenv
man printenv

HTH

DMuey
 
 Regards
 
 G. Askestad
 
 
 
 
 
 
 -- 
 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: case conversion problem

2003-09-11 Thread Kevin Pfeiffer
In article [EMAIL PROTECTED], Jenda Krynicky wrote:

 From: Gary Stainburn [EMAIL PROTECTED]
 I've got to tidy some data, including converting case.  I need to
 convert
 
 ANOTHER COMPANY NAME LTD  **
 
 to
 
 Another Company Name Ltd  **
 
 while retaining spaces.
 
 $text =~ s/(\w+)/\L\u$1/g;$y
^^

$y? A mysterious Perl variable that I've missed?


-- 
Kevin Pfeiffer
International University Bremen


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



WWW::Mechanize -links() problem

2003-09-11 Thread Dave Odell
Question:
I'm trying to use the links(); function which in the man page says
returns a list of the links found in the last fetched page. 
However when I try

@LINKS =  $agent-links();
foreach(@LINKS){
print $_\n;
}
it returns

WWW::Mechanize::Link=ARRAY(0x84a731c)

Does this mean it's an reference or does it return and array and I'm
just using it incorrectly? 
 If it is a reference is there a good tutorial around for using them.

Thanks


RE: :Mechanize -links() problem

2003-09-11 Thread Hanson, Rob
Each link returned is a WWW::Mechanize::Link object.  You need to use the
methods supplied to get the info.

See:
http://search.cpan.org/~petdance/WWW-Mechanize-0.59/lib/WWW/Mechanize/Link.p
m

Use it like this...

@LINKS = $agent-links();
foreach (@LINKS) {
  print $_-url(), \n;
  print $_-text(), \n;
  print $_-name(), \n;
  print $_-tag(), \n;
}


Rob


-Original Message-
From: Dave Odell [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 2:16 PM
To: [EMAIL PROTECTED]
Subject: WWW::Mechanize -links() problem


Question:
I'm trying to use the links(); function which in the man page says
returns a list of the links found in the last fetched page. 
However when I try

@LINKS =  $agent-links();
foreach(@LINKS){
print $_\n;
}
it returns

WWW::Mechanize::Link=ARRAY(0x84a731c)

Does this mean it's an reference or does it return and array and I'm
just using it incorrectly? 
 If it is a reference is there a good tutorial around for using them.

Thanks

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



Re: getting the IP address of a visitor to a site

2003-09-11 Thread Owen
On Thu, 11 Sep 2003 12:46:24 +
Anadi Taylor [EMAIL PROTECTED] wrote:


 I am writting a hit counter and would like to get the IP address of a 
 visitor to my site, can anyone point me in the right direction please. 
You might look at Enviroment variables, partcicularly

$ENV{REMOTE_ADDR} or maybe $ENV{REMOTE_HOST}



-- 
Owen

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



RE: :Mechanize -links() problem

2003-09-11 Thread Dan Muey
 Question:
 I'm trying to use the links(); function which in the man page 
 says returns a list of the links found in the last fetched 
 page.  However when I try
 
 @LINKS =  $agent-links();
 foreach(@LINKS){
 print $_\n;
 }
 it returns
 
 WWW::Mechanize::Link=ARRAY(0x84a731c)
 
 Does this mean it's an reference or does it return and array 
 and I'm just using it incorrectly? 

It is an array reference not an array.

Try this:

for(@{$agent-links()}) { print -$_-\n; }


or my @LINKS = @{$agent-links()};

`perldoc perlref` for a tutorial

HTH

Dan

  If it is a reference is there a good tutorial around for using them.
 
 Thanks
 

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



RE: :Mechanize -links() problem

2003-09-11 Thread Wiggins d'Anconia


On Thu, 11 Sep 2003 17:07:14 -0500, Dan Muey [EMAIL PROTECTED] wrote:


 
   `perldoc perlref` for a tutorial
 

That's the reference. You can also do:

perldoc perlreftut

For a tutorial. Though I am not sure how recent the Perl needs to be, check 
perldoc.com if you don't have it.

http://danconia.org

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



RE: :Mechanize -links() problem

2003-09-11 Thread Dan Muey
  Question:
  I'm trying to use the links(); function which in the man page
  says returns a list of the links found in the last fetched 
  page.  However when I try
  
  @LINKS =  $agent-links();
  foreach(@LINKS){
  print $_\n;
  }
  it returns
  
  WWW::Mechanize::Link=ARRAY(0x84a731c)
  
  Does this mean it's an reference or does it return and array
  and I'm just using it incorrectly? 
 
 It is an array reference not an array.
 
 Try this:
 
   for(@{$agent-links()}) { print -$_-\n; }

Oops! Didn't know that the array was also a ref.

for(@{$agent-links()}) {
$_-...
Like what Rob said.
}

HTH

Dan
 
 
   or my @LINKS = @{$agent-links()};
 
   `perldoc perlref` for a tutorial
 
 HTH
 
 Dan
 
   If it is a reference is there a good tutorial around for 
 using them.
  
  Thanks
  
 
 -- 
 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: Is there a way in PERL ......

2003-09-11 Thread Anadi Taylor
hello Rob,
to answer you question:
What do you mean by 'run' HTML pages? Are you writing
server-side CGI code?
YES - I am actualy wanting to create a hit counter that works when people 
visit a site from an advertising banner - so the banner will run a 
perlscript and depending on those results will either present index1.htm or 
index2.htm to a user. Now, I have created a perl script that creates an 
index page on the fly, BUT that means that the adress to the site looks 
like:
http://www.somesite.come/perl/cgi/index.pl

Now, if a visitor creates a favourite using this link then every visit is 
going to register as a hit from the advertising banner. What I want to do is 
increment the count and then present http://www.somesite.com/

I know using .asp (I know I know) I can use Response.Redirect 
http:/www.somesite.com - Is there a PERL equivilent ??? (Please say yes - 
I love perl - it rocks :D)

Thanks for all your help

Anadi

From: Rob Dixon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Is there a way in PERL ..
Date: Thu, 11 Sep 2003 14:17:08 +0100
Anadi Taylor wrote:

 I want to run a perl script that does a check and depending
 on the results of that check i want to run different HTML
 pages. For example: if the check is positive i want to run
 index1.htm else I want to run index2.htm

 can this be done ??
Hi Anadi.

Almost certainly yes.

What do you mean by 'run' HTML pages? Are you writing
server-side CGI code?
Rob
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

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


Re: perl script works one machine but not others?

2003-09-11 Thread John W. Krahn
[EMAIL PROTECTED] wrote:
 
 Folks,

Hello,

 I used my linux box running perl 5.8 to develop a small script that
 scans a list of directories and searches for files that dont have the group
 set to productn or dialup. It works great on my linux box, but now
 I need to run it on our sun systems which are running perl version 5.005_02.
 (Ungrading perl is not a solution unfortunatly, developers would freak out).
 It doesnt seem to work at all on the sun systems. It never seems to
 enter the directories and doesnt find anything.

Does the UID that the program runs under have permission to traverse
those directories?


 A normal program run looks like this on my linux box...
 
 [EMAIL PROTECTED] mcunning]$ ./scan-novell
 Checking the directory: /nfs/links/live.run
 Filename - GroupID (thats not productn or dialup)
 -
 /nfs/links/live.run  -  root
 /nfs/links/live.run/passwd  -  root
 /nfs/links/live.run/test4  -  nut
 Checking the directory: /nfs/links/prefixes
 Filename - GroupID (thats not productn or dialup)
 -
 /nfs/links/prefixes  -  root
 /nfs/links/prefixes/passwd  -  root
 /nfs/links/prefixes/test3  -  root
 /nfs/links/prefixes/test4  -  root
 /nfs/links/prefixes/testsubdir  -  root
 /nfs/links/prefixes/testsubdir/test6  -  nut
 Checking the directory: /nfs/links/transmit
 Filename - GroupID (thats not productn or dialup)
 -
 /nfs/links/transmit  -  mcunning
 
 A bad run on one of my sun systems looks like this..
 
 mickey(mcunning)$ ./scan-novell
 Checking the directory: /nfs/links/live.run
 Filename - GroupID (thats not productn or dialup)
 -
 Checking the directory: /nfs/links/params
 Filename - GroupID (thats not productn or dialup)
 -
 Checking the directory: /nfs/links/prefixes
 Filename - GroupID (thats not productn or dialup)
 -
 Checking the directory: /nfs/links/storage
 Filename - GroupID (thats not productn or dialup)
 -
 Checking the directory: /nfs/links/transmit
 Filename - GroupID (thats not productn or dialup)
 -
 Can't call method name on an undefined value at ./scan-novell line 41.

Your call to getgrgid($gid)-name is complaining because the value in
$gid cannot be found in /etc/group.


 Any ideas where I am going wrong?

There could be a problem with NFS mounted files?


 The code is below..
 Thanks for any help you can offer. Mike
 --
 
 #!/usr/bin/perl

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

You should enable warnings and strict while developing your program.


 # This program will scan the novell nfs mounts on a
 # host, if each one exists, for permission problems.
 # It will then list out the files that need to be
 # fixed.
 #
 # MC - 9/10/03
 
 use File::Find;
 use File::stat;
 use User::grent;

You don't really need File::stat and User::grent as these functions are
built in to perl.


 $basedir = /nfs/links/;
 @dirlist = qw(live.run params prefixes storage transmit);
 *name = *File::Find::name;

You are not using $name anywhere so why is this here?


 foreach $directory (@dirlist) {
 if ( -d $basedir$directory){
 print \n;
 print Checking the directory: $basedir$directory\n;
 print Filename - GroupID (thats not productn or dialup)\n;
 print -\n;
 find(\wanted, $basedir$directory);
  }
 }
 
 sub wanted {
 my $check = stat($_);
 return unless $check;
 
 if ( -d $_ || -f $_ ) {

You just stat()ed $_ and now you are stat()ing $_ two more times.


 my $groupname = group($check-gid());
 if ($groupname ne productn  $groupname ne dialup){
  print $File::Find::name  -  $groupname\n;
 }
 }
 }
 
 sub group {
 my $gid = shift;
 $group{$gid} = getgrgid($gid)-name || #$gid
unless defined $group{$gid};

You should use exists instead of defined.

 return $group{$gid};
 }


Try this and see if it works any better:

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

# This program will scan the novell nfs mounts on a
# host, if each one exists, for permission problems.
# It will then list out the files that need to be
# fixed.
#
# MC - 9/10/03

use File::Find;

# If you require root access uncomment the next line
#$ and die Must be root to run this program.\n;

my $basedir = '/nfs/links';
my @dirlist = map $basedir/$_, qw( live.run params prefixes storage
transmit );

foreach my $directory ( @dirlist ) {
next unless -d $directory;
print \n;
print Checking the directory: 

RE: Is there a way in PERL ......

2003-09-11 Thread Dan Muey
 I love perl - it rocks :D)
Me too.

1) they click on the banner and it takes them to index.pl.
2) 
index.pl needs to be something like:

#!/usr/bin/perl -w

use strict;

my $page = ChoosePageBasedOnWhatBannerTheyClicked();
print Location: http://somsite.com/$page\n\n;;

HTH

Dmuey

 
 Thanks for all your help
 
 Anadi

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



reading STDERR

2003-09-11 Thread Trina Espinoza
I have this command  that reads logfiles.However, if the command isn't successful it 
gives me a standard error.

 my @logData= `program1 -log $data1 $data2`; 


The error looks like this:

program1: '//mnt/leah/dir/': The system cannot find the file specified.

*How do I read that error for the string The system cannot find the file specified 
and skip the file if it doesn't exist???


I have looked in books, but I haven't found very good examples.  I have tried to take 
@logData  and put it to a file handle (PH, $logData) so
I can read it in a while loop. Suggestions much appreciated.

Thanks in advance!


-T

Re: reading STDERR

2003-09-11 Thread david
Trina Espinoza wrote:

 I have this command  that reads logfiles.However, if the command isn't
 successful it gives me a standard error.
 
  my @logData= `program1 -log $data1 $data2`;
 
 
 The error looks like this:
 
 program1: '//mnt/leah/dir/': The system cannot find the file specified.
 
 *How do I read that error for the string The system cannot find the file
 specified and skip the file if it doesn't exist???
 

the short answer:

my @logData = `program1 -log $data1 $data1 21`;

but since i don't know how windows (i see that you are using Outlook so i 
assume you are running Windows) will handle that, it's probably not very 
portable. a slightly better solutions would be:

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

use IPC::Open3;

my ($r,$w,$e);

waitpid(open3($w,$r,$e,ls -l),0);

print Get $_ while($r);

__END__

prints:

Get f1.pl
Get f2.pl
Get f3.pl
... etc

at best, you should avoide going to the shell all together.

david
-- 
$_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$;
map{~$_1{$,=1,[EMAIL PROTECTED]||3])=~}}0..s~.~~g-1;*_=*#,

goto=print+eval

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



Re: labeled blocks

2003-09-11 Thread R. Joseph Newton
John W. Krahn wrote:

 Thread?  Since your MUA doesn't provide a References: header it is
 not part of any thread.  Also your MUA seems to have elided any
 attribution to the text I typed above.

Well, I'll be darned.  I wondered why so many messages ended up in the wrong place in 
the
thread, and now I see.  My mail client, Netscape Mesenger 4.79 [I use NS 7.02 for 
browsing,
but will not tolerate Instant Messaging or AOL files on my machine, and there is no 
option
for mail without IM in recent Netscapes], does idiot threading when it sees no 
reference
header.  That is, it looks for a base subject for any message whose Subject =~ /^re: 
/i  This
has some rather bizarre side effects, such as fresh messages being plopped in 
months-dead
threads.  It also consistently puts Dan's replies, and many others, I believe in the 
first
tier of responses on any thread.

Dan, please look into other mailers.  I won't recommend mine, for the reason[s] cited 
above,
but there must be mailers that thread and handle threads appropriately.

John's message does present appropriately as a reply to your message, because your
message
[EMAIL PROTECTED]
is referenced in his reply:
References: [EMAIL PROTECTED]

This Message-ID/References linkage is the fabric that holds mailing list traffic 
together.

Joseph

FWIW: Attached is a count of occurences of header items in traffic in my Perl Beginners
mailbox from December 8 of last year until that mailbox crashed [temporarily] on 
August 19.
Received: 83781
Delivered-To: 20954
X-SMTPD: 16868
Date: 13139
X-Mozilla-Status: 13139
X-UIDL: 13139
From: 13139
X-Mozilla-Status2: 13139
Subject: 13139
Return-Path: 13137
To: 13059
X-Spam-Status: 12745
List-Help: 12710
List-Subscribe: 12710
Precedence: 12710
List-Post: 12710
List-Unsubscribe: 12707
Mailing-List: 12685
X-Spam-Level: 11504
Message-ID: 11104
Content-Type: 10360
MIME-Version: 9282
Status: 7702
X-Spam-Check-By: 7171
Content-Transfer-Encoding: 6539
X-Mailer: 5677
References: 5582
X-Spam-Checker-Version: 4492
X-MimeOLE: 3646
X-Priority: 3190
X-Posted-By: 2987
X-MSMail-Priority: 2880
In-Reply-To: 2755
User-Agent: 2258
X-Accept-Language: 2194
Lines: 1985
Cc: 1762
Message-Id: 1728
X-MIME-Autoconverted: 1587
X-Newsreader: 1585
Mime-Version: 1566
Thread-Topic: 1390
X-MS-TNEF-Correlator: 1390
Thread-Index: 1384
X-MS-Has-Attach: 1380
Organization: 1279
content-class: 1244
Reply-To: 1235
CC: 1091
Received-SPF: 1022
Importance: 903
Content-type: 843
X-MIMEOLE: 774
Content-Disposition: 731
X-OriginalArrivalTime: 708
Sender: 640
Content-transfer-encoding: 625
In-reply-to: 490
Priority: 420
X-mailer: 362
Content-description: 361
X-AntiAbuse: 312
Message-id: 307
MIME-version: 305
cc: 299
X-Originating-IP: 292
X-WSS-ID: 218
X-Server-Uuid: 193
Content-Class: 176
X-MSMail-priority: 146
X-Authentication-Warning: 126
X-Originating-Email: 122
X-Complaints-To: 112
X-MIMETrack: 111
X-Sender: 110
X-it: 106
X-Injected-Via-Gmane: 104
SPAM: 93
Content-disposition: 91
X-X-Sender: 83
Reply-to: 83
Mail-Followup-To: 82
Cancel-Lock: 78
Mail-followup-to: 65
X-Mail-From: 46
X-Comments: 46
X-Authenticated-Connect: 46
Followup-To: 46
X-HELO-From: 46
X-Sender-IP-Address: 46
X-Authenticated-Timestamp: 46
X-Scanner: 44
X-VSMLoop: 40
X-newsreader: 40
Keywords: 40
Distribution: 40
X-Virus-Scanned: 39
X-Operating-System: 39
Mime-version: 37
X-Disclaimer: 36
Disposition-Notification-To: 34
Errors-To: 32
X-CMS-Scanned: 31
X-CMS-Archived: 30
X-CMS-Authenticated-User: 30
List-Id: 29
X-Mailman-Version: 29
X-BeenThere: 29
List-Archive: 29
Content-return: 26
X-Authentication-Info: 26
X-Sent-Via: 20
thread-index: 20
X-Uptime: 18
x-mimeole: 17
X-Mimeole: 17
Path: 17
X-Scanned-By: 16
X-RAVMilter-Version: 15
X-PGP-Fingerprint: 15
Content-Description: 14
X-MailScanner: 14
X-GPG-Key: 13
X-Originating-Ip: 13
X-Authenticated-Sender: 12
X-MessageTextProcessor: 12
X-Return-Path: 11
X-ID: 11
X-Abuse-To: 11
X-Seen: 11
X-MDaemon-Deliver-To: 11
X-Filter-Version: 10
X-Enigmail-Version: 10
X-Wise-Words: 10
X-Enigmail-Supports: 10
X-MDRemoteIP: 10
Content-class: 10
X-No-Archive: 9
Content-language: 9
X-SMTP-RCPT-TO: 8
X-URL: 8
X-SMTP-MAIL-FROM: 8
X-PGP: 8
X-Qmail-Scanner-Mail-From: 8
X-Sent: 8
Mail_Client: 8
X-Approved: 8
X-SMTP-PEER-INFO: 8
X-SMTP-HELO: 8
X-Qmail-Scanner: 8
X-Sanitizer: 7
X-PerlCGI-Book: 7
X-Spam-Processed: 7
X-GPG-Fingerprint: 7
X-HTTP-Posting-Host: 7
X-SA-Exim-Rcpt-To: 7
X-YaleITSMailFilter: 7
X-Seeking: 6
X-Msg-Ref: 6
X-Authenticated-IP: 6
Xmilter: 6
X-Lotus-FromDomain: 6
X-PGP-Key-ID: 6
X-VirusChecked: 6
Return-Receipt-To: 6
X-Sybari-Trust: 6
X-Organisation: 6
X-PGP-Key: 6
X-Env-Sender: 6
X-Version: 6
X-Face: 6
X-Status: 5
X-FID: 5
X-Skip-Virus-Check: 5
X-Archived: 5
X-CNT: 5
X-Editor: 5
X-SA-Exim-Scanned: 5
X-Suppress-rcpt-virus-notify: 5
X-Virus-Checked: 5
X-MailScanner-Information: 5
X-Flags: 5
X-SenderIP: 5
X-FVER: 5
X-Message-Flag: 5
X-NB-Seen: 5
X-Authentication-warning: 4
X-Archive: 4
X-Atlas-MailScanner: 4
X-Header: 4
X-DSMTPFooter: 4
X-Sensitivity: 4