Re: Can Unlink Remove Tar and Zip files?

2002-04-06 Thread John W. Krahn

Loan Tran wrote:
> 
> This is how i use the unlink. Please take a look.
> Thanks.
> ---
> 
> #!/usr/bin/perl

You should enable warnings and strictures.

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


> # clean old file
> 
> use Carp;
> 
> $cur_time = time;   # current time in epoch (in
> seconds)
> $dir = '/opt/sybase/OCT/dump/';
> $hour = 10 ;
> 
> opendir DIR, $dir || die "Failed to open $dir: $!";

This won't die because of the precedence of ||.  It is interpreted as:
opendir DIR, ( $dir || die "Failed to open $dir: $!" );

Use either:
opendir DIR, $dir or die "Failed to open $dir: $!";
Or:
opendir( DIR, $dir ) || die "Failed to open $dir: $!";


> my @files = readdir DIR;
> closedir DIR;
> unless ($cnt = @files) {
>  print "No file to rm.\n";
>  return;

return() does nothing here, it is for returning from subroutines. 
Perhaps you meant exit().


> }
> 
> foreach $file (@files) {
> next if $file =~ /\./;

This was pointed out in another post.

next if $file =~ /^\.\.?$/;


> ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
> $size, $atime, $mtime, $ctime, $blksize, $blocks) =
> stat $file;
  ^^
  stat "$dir$file";

But since you are only using $mtime then this would be simpler:

my $mtime = (stat "$dir$file")[9];

Or better yet, since you only want the age in hours:

my $fage = -M "$dir$file";


> $fage = ($cur_time - $mtime) / 3600; # file in
> hours (note: 1 hr = 3600 sec)
> 
> print "file found: $file ($fage hr)\n";
> 
> if ($fage > $hour) {
> printf "\nDelete file older than $hour
> hrs : %4s  %.2f hrs old\n", "$dir"."$file",$fage;
> $rc = unlink "$dir"."$file" ;
> $stat = $rc ? "success" : "failed";
> print "\t$file remove status:
> $stat.\n";
> }
> else {
> printf "Too young: %15s [%.2f hr]\n",
> $file, $fage;
> }
> }
> opendir DIR, $dir || die "Failed to open $dir:
> $!";

Same precence problem as with previous opendir.


> my @files = readdir DIR;
> $cnt2 = @files;
> 
> print  "\nTo remove all files that are older
> than $hour in directory: $dir\n";
> printf "Before delete: %5d\n", $cnt;
> printf "Files deleted: %5d\n", $cnt - $cnt2;
> printf "After delete : %5d\n", $cnt2;
> closedir DIR;



John
-- 
use Perl;
program
fulfillment

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




PROBLEM WITH THE USES OF USE STRICT

2002-04-06 Thread Jaimee Spencer

Hello Team,

   Can someone please tell me why the below code does not work correctly?
Here is the problem:  Once I run the program and type in a couple of wrong
answers and then type in the correct answer I still get the wrong response
(e.g "No that is wrong! Try again.") But if I type in the correct answer
first I get the correct response.

   I also should add that if I don't use "use strict" and rename my variable
without "my". The code then works as it should.

regards,
Jaimee






#!/usr/bin/perl -w

use strict;

print ("What is 7 times 7? \n");

chop(my$input_answer = );
my$answer = 49;

until($input_answer == $answer) {
   print ("No that is wrong! Try again. \n");
   chop(my$input_answer = );
}  print("You got it!!\n");


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




Re: Speed up data transfer

2002-04-06 Thread Don Felix

1) Depending on file, you might be able to compress it before sending.
2) Does the file exist in both places, and you're updateing?  Maybe you
should
look at rsynch, which essentially transfers just the differences.

Don Felix

"Kevin Old" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> I have some code that is doing the following:
>
> system( "rcp -p ${target} ${source}");
>
> With target being the machine and file I want to get, and the source,
where I
> want to put it.
>
> Sometimes these files can be 17+ MB in data and can take 20 minutes to
> transfer.  I realize that this could be network issues, and probably is,
but
> is there some way anyone can think of that I could speed up the process of
> transferring the file?
>
> Any suggestions are appreciated,
> Kevin



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




Re: Perl - HTML Intergration

2002-04-06 Thread Todd Wade


"Vasileios Pliasas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi! I'm new to perl and I would like to ask you
> how does perl with html intergrades?
> How can I call a perl script from my web browser?
> I don't mean "... src=/../../test.pl"
> What's next?
>

Ive been writing web software and Im still wondering the same thing =0)...

Check this book out:
http://www.oreilly.com/openbook/cgi/

Its called CGI programming on the world wide web. Oreilly printed it in html
form because it is out of print, but the underlying technology of web
applications with perl is still the same.

This book will not teach you how to program with perl. Go get the oreilly
bookshelf for that. Read ALL the books (about 5 come on a cd-rom) and do ALL
the exercises. No cheating!!! Type them in yourself!!!

And have fun!!!

trw3



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




Re: Problem with the uses of use strict

2002-04-06 Thread Jonathan E. Paton

Hi,

Sticky CAPSLOCK?

>Can someone please tell me why the below code does not work correctly?
> Here is the problem:  Once I run the program and type in a couple of wrong
> answers and then type in the correct answer I still get the wrong response
> (e.g "No that is wrong! Try again.") But if I type in the correct answer
> first I get the correct response.

Hmmm...

>I also should add that if I don't use "use strict" and rename my variable
> without "my". The code then works as it should.

use strict isn't buggy, and doesn't do anything more than tell you bad things
about your code.  Hence by elimination the reason must be the "my", now lets
see the code:

> #!/usr/bin/perl -w
> 
> use strict;
> 
> print ("What is 7 times 7? \n");
> 
> chop (my $input_answer = );

Err... what's this doing here?

> my $answer = 49;
> 
> until($input_answer == $answer) {
>print ("No that is wrong! Try again. \n");
>chop(my $input_answer = );
> }  print("You got it!!\n");

Change the loop:

while (1) {
chop(my $input = );
last if $input = $answer;
print "No that is wrong!  Try again.\n";
}
print "You got it!!\n";

Jonathan Paton

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: PROBLEM WITH THE USES OF USE STRICT

2002-04-06 Thread Michael Lamertz

Aye,

although I agree with Jonatha's rewrite of your loop, he actually didn't
answer your question for *why* your code doesn't work:

On Fri, Apr 05, 2002 at 04:16:42PM -0800, Jaimee Spencer wrote:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> print ("What is 7 times 7? \n");
> 
> chop(my$input_answer = );
> my$answer = 49;
> 
> until($input_answer == $answer) {
>print ("No that is wrong! Try again. \n");
>chop(my$input_answer = );

Here =^^ 's your problem.

You *re*declaring $input_answer inside the until block.  The 'until'
sees the outer variable that you only entered once.  The newer input
variable is hidden inside the surrounding curly braces and never reaches
the 'until' clause.

Read 'perldoc perlsyn' and look for the section called 

Compound statements

The concept of a 'scope' is explained here.  Also read about 'lexically
declared variables' - I dunno where exactly that stuff is documented.

Leaving out the 'my' is what's solving your problem, because you don't
declare a new '$input_answer' then, but continue to use the previously
used one.

-- 
   If we fail, we will lose the war.

Michael Lamertz|  +49 221 445420 / +49 171 6900 310
Nordstr. 49|   [EMAIL PROTECTED]
50733 Cologne  | http://www.lamertz.net
Germany|   http://www.perl-ronin.de 

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




Re: converting html to text

2002-04-06 Thread drieux


On Friday, April 5, 2002, at 10:43 , Paul Tremblay wrote:
[..]
> The problem is that the filter deletes all of my text and ouputs this:
>
> [TABLE NOT SHOWN][TABLE NOT SHOWN][TABLE NOT SHOWN][TABLE NOT
> SHOWN][TABLE NOT SHOWN]

Right! that is the big clue I should have seen - there is no
'plain html stuff' - it's all stuffed in tables

I just ran the code against a webPage that is all one big
form - with some table foo on the inside and got your
equivolent response...

>
> I have tried it on five different files. All of these files were
> from the same website. It appears that this module is broken.
> That is, it can't handle certain html (which is valid when looked
> at in a browser).

I just smelled the coffee - all of the 'information' that you
are looking for is being presented in Tables - and that in essence
these clasess of webPages are little more than

SomeBuzzHere


Table, table table.
.

maybe not even closed with



so what you want to do is something along the line of actually
spin up some code like:

 my $page = '';
my @tables = $tree->look_down( "_tag", "table");

 foreach my $tab (@tables) {
my @Th_list = $tab->look_down("_tag", "th");

 foreach my $t (@Th_list) {
 next unless($t);
 foreach my $item_r ( $t->content_refs_list ) {
 next if ref $$item_r;
 $page .=  "$$item_r \n";
 }
 }

 my @Tr_list = $tab->look_down("_tag", "tr" );

 foreach my $tr (@Tr_list) {
 my @td_list = $tr->look_down("_tag", "td" );

 foreach my $t (@td_list) {
 foreach my $item_r ( $t->content_refs_list ) {
 next if ref $$item_r;
 $page .=  "$$item_r ";
}
 }
 $page .= "\n" if (@td_list);
 }
 $page .=  "#-\n";

 @Tr_list=();
 }

 print $page ;

so that you wind up sucking out the details from the table elements
themselves .

the problem is not really with:

use HTML::Parser;
use HTML::FormatText;
use HTML::TreeBuilder;

my $html_text;
my $filename = $ARGV[0];
open(FH, $filename) or die "unable to open file $filename :$!\n";
while () { $html_text .= $_ ; }
###my $plain_text = HTML::FormatText->new->format(parse_html($html_text));
my $tree = HTML::TreeBuilder->new->parse($html_text);
my $plain_text = HTML::FormatText->new->format($tree);

print "$plain_text\n";

#

save that it can only do what it does -

ciao
drieux

---


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




Re: bounceback filter script

2002-04-06 Thread Jenda Krynicky

From: "Moonlit Submit" <[EMAIL PROTECTED]>

> Hi,
> Try the one attached.
> Do you know how to write this correctly?
> I want it to use mail::sender.
> Thanks,
> Lisa

1) Please do NOT append new unrelated questions to repplies. 
Send a new message with a new subject!

2) If you have a problem with some code, tell us WHAT problem. 
And include only as much code as necessary!

> #print qq|\n|;
> my %email = (
>  Server  => 'relay.moonlitsubmithosting.com',
>  To  => $mlist,
>  From=> "$sub/$listname",
>  Subject => $subject,
>  Message =>
>   "$top_note\n"  .
>   '-' x 72   .
>   "\n$message\n" .
>   '-' x 72   .
>   "\n$bot_note"
> );

These do not look like parameters for Mail::Sender. There is no 
parameter "Server", it's "smtp".

> sender(%email) or die $Mail::Sender::error;

You've sent us tons of code ... but I did not find the definition of the 
sender() function.

Also the variable is NOT $Mail::Sender::error, but 
$Mail::Sender::Error. Notice the capital "E"!

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me

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




perllocal.pod

2002-04-06 Thread Robert Brandtjen

This maybe unique, I can't find anything on google for it.

My perllocal.pod (/usr/lib/perl5/5.6.1/i386-linux/perllocal.pod)

contains only about 9 of over 100 installed PM's - how can I update it 
to see all of them ?


TIA -
Rob


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




perl-modules

2002-04-06 Thread Robert Brandtjen

Umm - I can't find this at cpan.org - does it have another name ?

"  perl-modules   is needed by autoconf-2.53-1"

TIA-

Rob



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




Re: perl-modules

2002-04-06 Thread Joe Raube

Sounds more like a linux distribution question - as if you are trying
to install autoconf, and it requires a package called perl-modules.

What distribution are you using?

-Joe

--- Robert Brandtjen <[EMAIL PROTECTED]> wrote:
> Umm - I can't find this at cpan.org - does it have another name ?
> 
> "  perl-modules   is needed by autoconf-2.53-1"
> 
> TIA-
> 
> Rob
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: perl-modules

2002-04-06 Thread Robert Brandtjen

Joe Raube wrote:

>Sounds more like a linux distribution question - as if you are trying
>to install autoconf, and it requires a package called perl-modules.
>
>What distribution are you using?
>
>-Joe
>
I'm using RH 7.2 - but ever since up2date installed perl 5.6.1, my 
perllocal.pod dose not see all of the installed perl modules in 
/usr/lib/perl5/5.6.1 and instead only sees the ones I installed for 
Interchange.

when I run ExtUtils::Installed, it only sees them as well - surely there 
must be a way to have perl go through and update this.

BY they way - although today's problem surrounds KDE 3.0, this is a 
problem I wish to resolve.




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




Re: bounceback filter script

2002-04-06 Thread Moonlit Submit

Hello,
Someone from this group gave me that snippet. I apologize for sending the 
whole thing, I am new and thought maybe the whole thing needed to be looked 
at to tell how to code it.
I am VERY new lol. But I didn't write that code.
It was someone named Chas I believe.
I am trying to use Mail::Sender as it was recommended.
I have no idea how to do this, but I am ready to learn.
I do not know how to define "sendmail".
Lisa
###

my %email = (
Server  => 'relay.moonlitsubmithosting.com',
To  => $mlist,
From=> "$sub/$listname",
Subject => $subject,
Message =>
"$top_note\n"  .
'-' x 72   .
"\n$message\n" .
'-' x 72   .
"\n$bot_note"
);
Mail::Sender(%email) or die $Mail::Sender::Error;
##

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: Function Calls are Slower - was Re: Print Question

2002-04-06 Thread Jenda Krynicky

From:   "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > > Function calls in Perl are dead slow compared
> > > to compiled languages.
> > 
> > Ok, so why is this?
> > 
> 
> Implementation and little optimization.
> 
> Perl has a complex function calling mechanism, as
> it flattens argument lists by pushing elements onto
> the stack, records argument list length - the
> number of arguments are variable in length.

Plus it keeps track of the call stack ... you can print out from 
where you were called, from where your caller has been called and 
so on.
 
> Unlike many compiled languages, Perl does not
> inline short/frequently called functions - with
> the result that speed suffers.

Well ... it does. But it only inlines the constant functions that have 
been seen before they were used. And they have to be specified as 
having no parameters!

#!perl
use Benchmark;

sub postNOP {
foreach (1..100_000) {
nop();
}
}
sub nop {1};

sub postNNOP {
foreach (1..100_000) {
nnop();
}
}
sub nnop () {1};

sub Nop {1}
sub preNOP {
foreach (1..100_000) {
Nop();
}
}

sub nNop () {1}
sub preNNOP {
foreach (1..100_000) {
nNop();
}
}

sub Nothing {
foreach (1..100_000) {
}
}


timethese 100, {
postNOP => \&postNOP,
postNNOP => \&postNNOP,
preNOP => \&preNOP,
preNNOP => \&preNNOP,
Nothing => \&Nothing
};
__END__

Benchmark: timing 100 iterations of Nothing, postNNOP, postNOP, preNNOP, preNOP...
   Nothing:  3 wallclock secs ( 3.06 usr +  0.00 sys =  3.06 CPU) @ 32.64/s (n=100)
  postNNOP: 11 wallclock secs (10.97 usr +  0.00 sys = 10.97 CPU) @  9.12/s (n=100)
   postNOP: 11 wallclock secs (10.96 usr +  0.00 sys = 10.96 CPU) @  9.13/s (n=100)
   preNNOP:  3 wallclock secs ( 3.15 usr +  0.00 sys =  3.15 CPU) @ 31.71/s (n=100)
preNOP: 11 wallclock secs (10.81 usr +  0.00 sys = 10.81 CPU) @  9.25/s (n=100)

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me

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




Re: perl-modules

2002-04-06 Thread drieux


On Saturday, April 6, 2002, at 10:56 , Robert Brandtjen wrote:

> I'm using RH 7.2 - but ever since up2date installed perl 5.6.1, my 
> perllocal.pod dose not see all of the installed perl modules in /usr/lib/
> perl5/5.6.1 and instead only sees the ones I installed for Interchange.
>
> when I run ExtUtils::Installed, it only sees them as well - surely there 
> must be a way to have perl go through and update this.

I bet you ran into the same thing I just noticed - namely
that your version of perl when you run perl -V, does not
happen to have any reference to

/usr/lib/perl5/5.6.0

at all, which is where your previously installed packages are

plan A: rebuild perl to be 5.6.0 aware

plan B:

PERLLIB=/usr/lib/perl5/5.6.0:/usr/lib/perl5/site_perl/5.6.0
export PERLLIB



ciao
drieux

---


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




Re: Function Calls are Slower - was Re: Print Question

2002-04-06 Thread Jonathan E. Paton

> > > > Function calls in Perl are dead slow compared
> > > > to compiled languages.
> > > 
> > > Ok, so why is this?
> > > 
> > 
> > Implementation and little optimization.
> > 
> > Perl has a complex function calling mechanism, as
> > it flattens argument lists by pushing elements onto
> > the stack, records argument list length - the
> > number of arguments are variable in length.
> 
> Plus it keeps track of the call stack ... you can print out from 
> where you were called, from where your caller has been called and 
> so on.
>  
> > Unlike many compiled languages, Perl does not
> > inline short/frequently called functions - with
> > the result that speed suffers.
> 
> Well ... it does. But it only inlines the constant functions that have 
> been seen before they were used. And they have to be specified as 
> having no parameters!
> 

Useful :P

Okay... here's the comment the man at the top gave:

: Will function calls be faster in Perl 6, in general?  Using a simple
: benchmark, an empty subroutine called with no arguments took around
: 1500 machine cycles to execute on Perl 5.  Surely a nice new JIT and
: better VM should make function calls less expensive, tight loops in
: general are a bad idea in Perl 5 - no inlining.

Except for constants.

Perl 6 should be much better in this regard, provided you make use of
the formal parameter syntax.  The old way of setting up @_ with default
read/write parameters is one place that slows down Perl 5 subroutine
calls, so the newer signatures that default the argument list to being
constant should help the optimizer out a great deal, since it can then
just pull arguments straight from wherever they're stored, whether
stack or register.  The JIT (which already exists!) will also help,
hopefully.

Larry [Wall, on the perl6-language mailing list]

---

I suggest you don't bother Larry about it.. I asked when it was
reasonably appropriate and relevent to the discussion.  (A thread
on whether tail recursion would be optimised in Perl 6).

Jonathan Paton

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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




Re: bounceback filter script

2002-04-06 Thread Jenda Krynicky

From: "Moonlit Submit" <[EMAIL PROTECTED]>

> Hello,
> Someone from this group gave me that snippet. I apologize for sending
> the whole thing, I am new and thought maybe the whole thing needed to
> be looked at to tell how to code it. I am VERY new lol. But I didn't
> write that code. It was someone named Chas I believe. I am trying to
> use Mail::Sender as it was recommended. I have no idea how to do this,
> but I am ready to learn. I do not know how to define "sendmail". Lisa
> ###
> 
> my %email = (
>  Server  => 'relay.moonlitsubmithosting.com',
>  To  => $mlist,
>  From=> "$sub/$listname",
>  Subject => $subject,
>  Message =>
>   "$top_note\n"  .
>   '-' x 72   .
>   "\n$message\n" .
>   '-' x 72   .
>   "\n$bot_note"
> );
> Mail::Sender(%email) or die $Mail::Sender::Error;
> ##

Oh well ... there are examples in the docs that come with 
Mail::Sender.

use Mail::Sender;
my $sender = new Mail::Sender {
smtp  => 'relay.moonlitsubmithosting.com'
};
die "Cannot create Mail::Sender object : $Mail::Sender::Error\n"
unless ref $sender;

$sender->MailMsg({
To  => $mlist,
From=> "$sub/$listname",
Subject => $subject,
msg =>
"$top_note\n"  .
'-' x 72   .
"\n$message\n" .
'-' x 72   .
"\n$bot_note"
}) > 0
or die $Mail::Sender::Error;

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me

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




Re: perl-modules

2002-04-06 Thread Robert Brandtjen

drieux wrote:

> I bet you ran into the same thing I just noticed - namely
> that your version of perl when you run perl -V, does not
> happen to have any reference to
>
> /usr/lib/perl5/5.6.0
>
> at all, which is where your previously installed packages are
>
> plan A: rebuild perl to be 5.6.0 aware
>
> plan B:
>
> PERLLIB=/usr/lib/perl5/5.6.0:/usr/lib/perl5/site_perl/5.6.0
> export PERLLIB


even after running that i get :
This is perl, v5.6.1 built for i386-linux

Copyright 1987-2001, Larry Wall

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

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


TIA -
Rob


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




Re: bounceback filter script

2002-04-06 Thread Moonlit Submit

Hi,
Now I'm getting this error:
Content-type: text/html
Software error:
Server error: 503 5.0.0 Need RCPT (recipient)

How do I fix that?
Lisa


>From: "Jenda Krynicky" <[EMAIL PROTECTED]>
>To: "Moonlit Submit" <[EMAIL PROTECTED]>,  
>[EMAIL PROTECTED]
>Subject: Re: bounceback filter script
>Date: Sat, 6 Apr 2002 21:37:54 +0200
>
>From: "Moonlit Submit" <[EMAIL PROTECTED]>
>
> > Hello,
> > Someone from this group gave me that snippet. I apologize for sending
> > the whole thing, I am new and thought maybe the whole thing needed to
> > be looked at to tell how to code it. I am VERY new lol. But I didn't
> > write that code. It was someone named Chas I believe. I am trying to
> > use Mail::Sender as it was recommended. I have no idea how to do this,
> > but I am ready to learn. I do not know how to define "sendmail". Lisa
> > ###
> >
> > my %email = (
> >  Server  => 'relay.moonlitsubmithosting.com',
> >  To  => $mlist,
> >  From=> "$sub/$listname",
> >  Subject => $subject,
> >  Message =>
> >   "$top_note\n"  .
> >   '-' x 72   .
> >   "\n$message\n" .
> >   '-' x 72   .
> >   "\n$bot_note"
> > );
> > Mail::Sender(%email) or die $Mail::Sender::Error;
> > ##
>
>Oh well ... there are examples in the docs that come with
>Mail::Sender.
>
>use Mail::Sender;
>my $sender = new Mail::Sender {
>   smtp  => 'relay.moonlitsubmithosting.com'
>};
>die "Cannot create Mail::Sender object : $Mail::Sender::Error\n"
>   unless ref $sender;
>
>$sender->MailMsg({
>   To  => $mlist,
>   From=> "$sub/$listname",
>   Subject => $subject,
>   msg =>
>   "$top_note\n"  .
>   '-' x 72   .
>   "\n$message\n" .
>   '-' x 72   .
>   "\n$bot_note"
>}) > 0
>   or die $Mail::Sender::Error;
>
>Jenda
>
>=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
>There is a reason for living. There must be. I've seen it somewhere.
>It's just that in the mess on my table ... and in my brain
>I can't find it.
>   --- me









_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




autobundle issues - RH 7.2

2002-04-06 Thread Robert Brandtjen

Ok, I constructed a snapshot of my installed perl mods, now when I 
attempt to update using:
 perl -MCPAN -e 'install Bundle::Snapshot_2002_04_06_00'

I get:
Checksum for yes/sources/authors/id/T/TL/TLOWERY/DBD-ADO-2.4.tar.gz ok
Scanning cache yes/build for sizes
gzip: yes/sources/authors/id/T/TL/TLOWERY/DBD-ADO-2.4.tar.gz: No such 
file or directory

when in fact it's there.

Any ideas?

TIA-

Rob


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




Re: perl-modules

2002-04-06 Thread drieux


On Saturday, April 6, 2002, at 11:43 , Robert Brandtjen wrote:
[..]
>> plan A: rebuild perl to be 5.6.0 aware
>>
>> plan B:
>>
>> PERLLIB=/usr/lib/perl5/5.6.0:/usr/lib/perl5/site_perl/5.6.0
>> export PERLLIB
>
>
> even after running that i get :
> This is perl, v5.6.1 built for i386-linux

that's the '-v' vice -V ...

or alternatively check with
perl -e 'print "$_\n" foreach(@INC); '

IF you already have the modules in the directories

/usr/lib/perl5/5.6.0 and
/usr/lib/perl5/site_perl/5.6.0

Then you need merely fix the instance of perl itself.

run the Configure and I think what you want to find
is the section

In order to ease the process of upgrading, this version of perl
can be configured to use modules built and installed with earlier
versions of perl that were installed under $prefix.  Specify here
the list of earlier versions that this version of perl should check.
If Configure detected no earlier versions of perl installed under
$prefix, then the list will be empty.  Answer 'none' to tell perl
to not search earlier versions.

The default should almost always be sensible, so if you're not sure,
just accept the default.
List of earlier versions to include in @INC? [5.6.0]

Since the information will be what gets built into perl itself.

The third course is to do the

perl -MCPAN -e 'install '

after you figure out what you want to download...



ciao
drieux

---


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




foreach

2002-04-06 Thread Matthew Harrison

I have a database table that I am querying through DBI. The field I want to 
fetch could be field1 x 200 records. I need these fields to populate a 
drop-down html menu.

The field I am grabbing is the name field for a list of people. I want to 
get the name field for every record. These names will populate a drop-down 
html menu.

-- 
Matthew Harrison
Internet/Network Services Administrator
Peanut-Butter Cheesecake Hosting Services
Genstate
www.peanutbuttercheesecake.co.uk

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




How to refresh browser

2002-04-06 Thread Leon

Hi,

Whats the code for refreshing a browser assuming the url to be refreshed is
http://www.perl.com/

Thanks


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


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




RE: Variable question

2002-04-06 Thread aman cgiperl

Execute the following on cmd line as follows
$./cnt.pl  ,
You can replace the comma (,) on the command line to find any other
character's occurrence in the string
___
#!/usr/bin/perl

for(;$imailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 11:53 AM
To: [EMAIL PROTECTED]
Subject: Variable question


Hi everybody.  I am a new user and my first question to this list is
probably a very simple one.  I am trying to count the number of commas
in a variable.  The book I am learning from doesn't cover specific
information like that.  Thanks for any help.

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




Re: Variable question

2002-04-06 Thread John W. Krahn

Aman Cgiperl wrote:
> 
> Execute the following on cmd line as follows
> $./cnt.pl  ,
> You can replace the comma (,) on the command line to find any other
> character's occurrence in the string
> ___
> #!/usr/bin/perl
> 
> for(;$i $str[i] = substr($ARGV[0],$i,1);
> if($str[i] eq $ARGV[1]) {
> $cnt++;
> }
> }
> print $cnt;
> ---
> Aman
> 
> PS: I am just a novice, so there might be quicker ways I yet don't know
> of !!!

Hi Aman.  No offense but that looks more like C than Perl.  Why are you
using an array (@str) to store the current character instead of a
scalar?

for ( ; $i < length( $ARGV[0] ); $i++ ) {
$str = substr( $ARGV[0], $i, 1 );
if ( $str eq $ARGV[1] ) {
$cnt++;
}
}
print $cnt;


As a matter of fact, why not just use the substr in the comparison?

for ( ; $i < length( $ARGV[0] ); $i++ ) {
if ( substr( $ARGV[0], $i, 1 ) eq $ARGV[1] ) {
$cnt++;
}
}
print $cnt;


And of course we can make the for statement more perl-like.

for ( 0 .. length( $ARGV[0] ) - 1 ) {
if ( substr( $ARGV[0], $_, 1 ) eq $ARGV[1] ) {
$cnt++;
}
}
print $cnt;


And if you really want to get cute you can put it all on one line:

substr( $ARGV[0], $_, 1 ) eq $ARGV[1] and $cnt++ for 0 .. length(
$ARGV[0] ) - 1;
print $cnt;


:-)

John
-- 
use Perl;
program
fulfillment

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