A little help please?

2004-01-30 Thread Joel
I'm interested in learning to program perl, and I just got ActivePerl for Windows. I 
am running XP and  have a few questions. First off, how do I run the interpreter under 
Windows, preferably without the XP command prompt? Also, when I opened perl, it looked 
like the command prompt. Is the command prompt accesable through perl? Finally is the 
"#!usr/bin/perl line necessary under XP?

Thanks

Joel

RE: a little help please?

2004-01-31 Thread Joel

What I meant about the command prompt was "Are all the command prompts the
same? Also, could running the Activeperl software damage my system at all
since it is using a command prompt?

Thanks,

Joel

>  > Also, when I opened perl, it looked like the command prompt. Is the
command
> > prompt accesable through perl?
I dont understand that question.
Maybe thats the effect described above: your script is to quick for you to
and
 once it ends it also terminates the promptwin (winOS does that, actually).
>
>
Enjoy looking around,
Wolf
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>


I did it!

2004-02-01 Thread Joel



I wrote a decent, working program that actually 
does something semi-usefull!!!
Check it out! You can find the area of a circle 
with it!
 
Joel


PIr^2.pl
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


I did it!

2004-02-01 Thread Joel




I wrote a decent, working program that actually 
does something semi-usefull (areaformula.pl)!!!
Check it out! You can find the area of a circle 
with it! Also, can someone tell me what I did wrong with modifiedarea.pl and 
what the error (Main::useless used only once possible typo 
at...)means?
 
Thanks
 
Joel
<>
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Why does this keep happening?

2004-02-17 Thread Joel
I'm running perl under windows XP and I keep geting this error:

syntax error at (Directory and filename) Line 6, near " )
{"
syntax error at (directory and filename) line 9 near "}"

The source code is below, but this happens with loops in general. Any ideas?


#!usr/bin/perl

$a=1000

until ($a==0)
{
print "Counting down to 0 from $a";
$a--;
}
else (print "Blast off!")

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why does this keep happening?

2004-02-17 Thread Joel
Thanks, but what does "My" mean and why did you use "print" twice in a row?

Joel

- Original Message - 
From: "Dan Muey" <[EMAIL PROTECTED]>
To: "Joel" <[EMAIL PROTECTED]>; "perl" <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 5:15 PM
Subject: RE: Why does this keep happening?



> I'm running perl under windows XP and I keep geting this error:
>
> syntax error at (Directory and filename) Line 6, near " )
> {"
> syntax error at (directory and filename) line 9 near "}"
>
> The source code is below, but this happens with loops in
> general. Any ideas?
>
> 
> #!usr/bin/perl
>
> $a=1000

NO semi colon here for one, plus $a and $b are special sometimes so I'd
avoid those.

Try this:

#!/usr/bin/perl

use warnings;
use strict;
# always a good idea and very helpful to keep you sane!

my $cnt = 1000;

until ($cnt == 0) {
print print "Counting down to 0 from $cnt";
$cnt--;
}
print "Blast off!";

>
> until ($a==0)
> {
> print "Counting down to 0 from $a";
> $a--;
> }
> else (print "Blast off!")

This else needs an if to match I believe, perhaps not but it would make lots
more sense.


HTH

Dmuey
>
> Joel
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why does this keep happening?

2004-02-17 Thread Joel
I fixed the source code with the suggestions given, but still no luck. Any
other ideas?

Joel
---
#!usr/bin/perl

$abc=1000

until ($abc==0)
{
print "Counting down to 0 from $a\n";
$a--;
}
print "Blast off!";

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Can anyone reccomend a good online perl tutorial

2004-02-18 Thread Joel
The subject says it all.

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Could I put commands in a variable

2004-02-19 Thread Joel
If I was using one specific group of commands, Could I put them inside a
variable, then just use the variable when I needed the commands instead of
copying and pasting them?

i.e.
print "Hello world";
if ($i == 50) {
goto MAIN;
}
elsif ($t == 100) {
goto SECONDARY;
}

as compared to

$command =
print "Hello world";
if ($i == 50) {
goto MAIN;
}
elsif ($t == 100) {
goto SECONDARY;
};

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Could I put commands in a variable

2004-02-19 Thread Joel
Yes, BASIC is the only programming I have ever done. All I can really
remember was PRINT, GOTO, and a variety of line numbers. I'm trying to write
a text adventure (Don't look at me like that, Perl is a general purpose
language!). I'm getting tired of writing large chunks of code that I reuse
the basic structure of and wouldn't mind an easier solution. I'll go look up
subroutines, allthough GOTO does just fine for me.

- Original Message - 
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 8:36 AM
Subject: Re: Could I put commands in a variable


> Joel wrote:
> >
> > If I was using one specific group of commands, Could I put them inside a
> > variable, then just use the variable when I needed the commands instead
of
> > copying and pasting them?
> >
> > i.e.
> > print "Hello world";
> > if ($i == 50) {
> > goto MAIN;
> > }
> > elsif ($t == 100) {
> > goto SECONDARY;
> > }
> >
> > as compared to
> >
> > $command =
> > print "Hello world";
> > if ($i == 50) {
> > goto MAIN;
> > }
> > elsif ($t == 100) {
> > goto SECONDARY;
> > };
>
> Hi Joel.
>
> Both your question and your code suggest that you're not
> thinking about your programming solution properly. I
> don't think I've ever seen a Perl script that used 'goto'.
> Not that is the Bad Thing that many people make out, it's
> just usually a non-intuitive way of expressing a solution.
> Also, what you describe is a subroutine, which is simply
> a named piece of code. Have you come from programming BASIC
> by any chance? In its earlier versions BASIC control flow
> was entirely dependent on GOTO  and GOSUB , as
> it was based on the syntax of assembler languages.
>
> I'd expect to do away with the labels and write something
> like:
>
>   sub command {
>
> print "Hello world";
>
> if ($i == 50) {
>   :
> }
> elsif ($t == 100) {
>   :
> }
>   }
>
> I hope this helps. It would be useful to tell us more about
> what you're trying do do.
>
> Rob
>
> to do.
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Could I put commands in a variable

2004-02-19 Thread Joel
I'll post the code tommorow. I just need to change all the room descriptions
and items, since the the characters and places depicted in the game are
copyrighted. I wrote it as a fan work.

Joel

- Original Message - 
From: "James Edward Gray II" <[EMAIL PROTECTED]>
To: "Joel" <[EMAIL PROTECTED]>
Cc: "perl" <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 2:40 PM
Subject: Re: Could I put commands in a variable


> On Feb 19, 2004, at 1:22 PM, Joel wrote:
>
> > Yes, BASIC is the only programming I have ever done. All I can really
> > remember was PRINT, GOTO, and a variety of line numbers.
>
> Most of us were there at some point.  We just don't talk about it much.
>   :D
>
> > I'm trying to write a text adventure (Don't look at me like that, Perl
> > is a general purpose
> > language!).
>
> I have a semi-functional MUD I wrote in Perl sitting in my To Finish
> Someday pile.  You'll get no funny looks from me.
>
> > I'm getting tired of writing large chunks of code that I reuse
> > the basic structure of and wouldn't mind an easier solution.
>
> That's why we have loops, conditionals, subroutines, modules
>
> > I'll go look up subroutines, allthough GOTO does just fine for me.
>
> No it doesn't.  Reread your previous sentence.  ;)
>
> I bet we can open your eyes to a whole new world, if we see some of
> that code.  If it's especially large, perhaps you could post it online
> somewhere and just give us a link.  I know I would be happy to go take
> a look at it and provide suggestions.
>
> James
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Could I put commands in a variable

2004-02-19 Thread Joel
Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the
same really.

Joel

- Original Message - 
From: "James Edward Gray II" <[EMAIL PROTECTED]>
To: "Joel" <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 3:06 PM
Subject: Re: Could I put commands in a variable


> (off list reply)
>
> On Feb 19, 2004, at 1:45 PM, Joel wrote:
>
> > I'll post the code tommorow. I just need to change all the room
> > descriptions
> > and items, since the the characters and places depicted in the game are
> > copyrighted. I wrote it as a fan work.
>
> If you like, you are welcome to send the code/link to the private
> address this message is from.  I don't have a problem looking at your
> code, no matter what it's about.
>
> Or if you prefer to clean it up and post it publicly tomorrow that's
> fine too, of course.  You'll get more and better help that way.
>
> Just trying to make things easier on you.  I really do believe we can
> help you along, so it'll be worth the effort I think.
>
> James
>
>


Spaceship.pl
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Re: Could I put commands in a variable

2004-02-20 Thread Joel
Thanks.

What does "ne" mean? It's not listed in functions in the documentation.

Joel
- Original Message - 
From: "Daniel Staal" <[EMAIL PROTECTED]>
To: "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 9:54 PM
Subject: Re: Could I put commands in a variable


> --As of Thursday, February 19, 2004 6:31 PM -0500, Joel is alleged to have
> said:
>
> > Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the
> > same really.
>
> --As for the rest, it is mine.
>
> Here's a first approximation of a rewrite. ;-)  (Major problem: it always
> asks what you want to do twice...)
>
> This version keeps track of the state of the game, and uses that to guide
> the flow.  Note that I actually did put commands in a variable...
>
> However, now each location you can go to is entirely independent of any
> other.
>
> I'm sure this can be simplified.  It's just the first treatment I thought
> of.
>
> Daniel T. Staal
>
> ---
> This email copyright the author.  Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes.  This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---






> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Could I put commands in a variable

2004-02-20 Thread Joel
Thanks, can you give me some examples of loops like that?

Joel

- Original Message - 
From: "James Edward Gray II" <[EMAIL PROTECTED]>
To: "Rob Dixon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 20, 2004 12:36 PM
Subject: Re: Could I put commands in a variable


> On Feb 20, 2004, at 5:25 AM, Rob Dixon wrote:
> 
> > Hi Daniel.
> >
> > I haven't looked at your code, but I don't think a rewrite is in the
> > spirit of helping beginners at Perl. It may occasionally be the best
> > answer, but I suspect you're simply enjoying yourself here ;)
> >
> > I wonder what others think?
> 
> I have mixed feeling about it.
> 
> I think we generally teach them a little more by touching up what they 
> have written, correcting their problems or providing simple insights.  
> I think it sinks in a little better that way.
> 
> On the flip side, we can't teach them as much that way, because we 
> can't show them the possibly better ways of doing things.  I don't know 
> about you, but I much prefer the structure of Daniel's version of the 
> posted code (though hopefully without the duality bug :D ), to my own 
> simple clean up.  And as you have already pointed out, the problem is 
> ripe for an OO solution as well, which I would like even better.  While 
> I would love to write that, I fear Joel isn't ready for that yet.  (No 
> offense Joel.  You have a working program and that's all anyone can ask 
> for early projects.  Keep working at it and you'll get there.)  
> Unfortunately, even Daniel's version is a bit too arcane, I think.
> 
> My original thought was to build a hash for each room (description, 
> exits, etc.) and load them all into a master hash, by name.  Then you 
> could write a pretty simple loop to just walk the master hash.  It 
> would also be super simple to move that to disk based data files, which 
> I think would be cool.  That's probably closer to a design Joel might 
> be able to put to good use, but I ruled even that out because I would 
> have to use references.
> 
> Of course, if Joel keeps at this, eventually, he's going to try to go 
> to one of these ideas and chances are we could maybe inspire him to 
> that point with a teaser.
> 
> How's that for a circular answer?  
> 
> In the end, I think this is a perfect example of while Perl Beginners 
> is a terrific resource.  There's so many of us helping and we're all so 
> different.  Joel got some good answers from both sides of the fence and 
> hopefully that will help him along.  I don't know about you, but that's 
> all I hope for in return for my time spent.
> 
> James
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Does this site have cgi scripting errors?

2004-02-20 Thread Joel
http://www.wildglobe.com/
If everything seems fine, try refreshing the page a bit. I'm curious if that
is what it is.

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




cool project ideas

2004-02-24 Thread Joel
I'm getting tired of working on a text adventure in perl, and I was
wondering if anyone had some interesting projects they could suggest I
attempt.

Thanks,

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: cool project ideas

2004-02-24 Thread Joel
Actually, I'm looking for more of a beginers project.

Joel
- Original Message - 
From: "WC -Sx- Jones" <[EMAIL PROTECTED]>
To: "perl" <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 4:03 PM
Subject: Re: cool project ideas


> Joel wrote:
> > I'm getting tired of working on a text adventure in perl, and I was
> > wondering if anyone had some interesting projects they could suggest I
> > attempt.
> 
> 
> port Perl language and syntax to Gnu DotNet.
> 
> That way we can program in Perl but generate IL for .Net on Unix, et al.
> 
> Cheers!
> -Sx-
> 
> PS - You may need to finish porting some C header files first.
> 
> PPS - So, are you beggining to see why text Advantures may be way more 
> adventurous (read fun.)  :)
> 
> 
> ( In a way I am quiet serious.
>GNU DotNet and Perl both would benefit. )
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: cool project ideas

2004-02-24 Thread Joel
Currently, I don't do anything for a living. I am interested in writing
utilities,  but I think your idea regarding the adding and removing accounts
is a bit too complex for me at the moment. When I originally started with
perl I wanted to know how to write spiders (but I'm too cheap to buy the
O'Reilly book "Spidering hacks", and the library doesn't have it) allthough
i'm not sure my ISP allows it. I would also like to try writing
client/server applications, but this time I know that my ISP doesn't allow
you to run servers using it.

Any suggestions?

Joel
- Original Message - 
From: "Paul Kraus" <[EMAIL PROTECTED]>
To: "'Joel'" <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 4:26 PM
Subject: RE: cool project ideas


> > I'm getting tired of working on a text adventure in perl, and I was
> > wondering if anyone had some interesting projects they could suggest I
> > attempt.
>
> You could write a user utility that could add, change, or delete users
from
> several platforms Unix, windows, Linux and the build a gui front end using
> TK.
>
> You could create a TK app that would let you review all your important
> server log files from several machines.
>
> What are you into, what do you do for a living, how complicated do you
want
> it to be.
>
>
> When I get bored I look around my office then I review all my daily tasks
> and I think to myself Damn that is a crappy thing I have to do
everyday
> let make perl make it easier :)
>
>
> PK
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RSS aggregator

2004-02-25 Thread Joel
How would I go about writing an RSS aggregator that would output to a text
file?

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Is there an etc. command in perl?

2004-02-25 Thread Joel
Is there an et cetera type command in perl? Specifically, what I want to do
is to go from

while (1) {
my $num = shift @numarray;
if ($num % 2==0) {

and if the modulus of 2 is 0, find the modulus of 3 and so on. Can anyone
give me some suggestions?

Thanks,

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Is there an etc. command in perl?

2004-02-26 Thread Joel
Sorry, I should have said. I'm writing a program to find prime numbers, and
what I want it to do is go from 0 to 200 and divide each number by all other
numbers. So I want say, 50 to be divided by 1 to 50, but to stop when it
finds a modulus. If it were a prime number, it would be divided by
everything between 1 and itself, and no modulus would be found. Any
suggestions?

Thanks

Joel
- Original Message - 
From: "David le Blanc" <[EMAIL PROTECTED]>
To: "Joel" <[EMAIL PROTECTED]>; "Perl Lists" <[EMAIL PROTECTED]>
Sent: Wednesday, February 25, 2004 5:58 PM
Subject: RE: Is there an etc. command in perl?


> -Original Message-
> From: Joel [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 26 February 2004 7:53 AM
> To: perl
> Subject: Is there an etc. command in perl?
>
> Is there an et cetera type command in perl? Specifically,

That's part of the Perl 7 - DWIM spec.

You may have to wait until easter though.

In the mean time.

> while (1) {
> my $num = shift @numarray;
> if ($num % 2==0) {
>
> and if the modulus of 2 is 0, find the modulus of 3 and so
> on. Can anyone
> give me some suggestions?
>

If I read this correctly, you want to skip the contents of
the numarray until you find a number who's modulus 2 is zero, and
do something with it.  Once you find one, you change the rules and
are now looking for a number who's modulus 3 is zero, then 4 etc?

my $mymod = 2;
for my $num ( @numarray ) {
if( $num % $mymod == 0 ) {
$mymod ++;


}
}

Hope that helps.

PS. DWIM stands for 'Do What I Mean'.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Running a Perl script on windows xp

2004-02-29 Thread Joel
I would recommend downloading activeperl from
http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl
They don't need your personal information for you to download it. Get the
windows MSI package. Once you have installed it, open the command prompt (It
should be in accessories) and go to the path that the script is in by
entering "cd c:\paththescriptisin". Then simply type "scriptname.pl" and it
should run.

Joel

- Original Message - 
From: "Katia Kermanidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 29, 2004 9:32 AM
Subject: Running a Perl script on windows xp


Hello everyone,

To tell the truth I am not really interested in becoming a Perl programmer.
I only have one question: I have a Perl script and I would like to run it on
Windows xp. Could anyone tell me which Perl I should install and, as simply
as possible, what I should do exactly to run the script?

Thank you all very much in advance.

All the best,

Katia Kermanidis
Wire Commnications Laboratory
University of Patras, Greece
[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Why did it print a happy face?

2004-03-02 Thread Joel
This is a precursor to a real JAPH signeture (I need to learn more perl
before I can write a really obfuscated one), and I have already gotten it to
print what it was supposed to, but I changed print chr($letter); to print
chr(@word); to see if it would work, which is when I got the happy face
output in perl. Any ideas?
(By the way, I haven't fixed the while loop yet so be ready to quit fast to
read the output.)

Joel

#!usr/bin/perl

use Warnings;
use Strict;

my $h=4;
my @word = (0x4E, 0x65, 0x72, 0x64);
while ($h > 0) {
 $h++;
 $letter=shift @word;
 print chr(@word);
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why did it print a happy face?

2004-03-02 Thread Joel
Thanks for explaining the while loop, but what I was wondering is why perl
printed the happy face and heart in the first place? I was using ASCII
Characters and there aren't any like that.

Thanks

Joel

- Original Message - 
From: "Shaw, Matthew" <[EMAIL PROTECTED]>
To: "Joel" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 12:13 PM
Subject: RE: Why did it print a happy face?


Joel:

There's a few problems with your sample code... please see my comments
below:

#!usr/bin/perl # You forgot the leading slash in your path here

use Warnings; # This should be 'use warnings;' (Lowercase)
use Strict; # This should be 'use strict;' (Lowercase)

my $h=4;
my @word = (0x4E, 0x65, 0x72, 0x64);
while ($h > 0) {
 $h++; # This should probably be $h-- if you want your while loop to end
 $letter=shift @word;
 print chr(@word); # chr() is evaluating the @word array in scalar
context,
# which returns the number of elements in the
array.
# this line is printing the characters 4, 3, 2,
1 (As you
# shift off the array) and finally '0' over and
over
# again when the array contains no elements.
}

# end

Here's another way of writing what (I think) you intended:

#!/usr/bin/perl

use warnings;
use strict;

my @word = (0x4E, 0x65, 0x72, 0x64);
print chr for @word;

# end

Hope this helps. Enjoy and let me know if you have any questions.

Thanks

Matt Shaw
Technical Architect
xwave, An Aliant Company
Desk: 506-389-4641
Cell: 506-863-8949
[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why did it print a happy face?

2004-03-03 Thread Joel
I'm running windows XP actually.

Joel

- Original Message - 
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 1:35 PM
Subject: Re: Why did it print a happy face?


> Joel wrote:
> >
> > Thanks for explaining the while loop, but what I was wondering is why
perl
> > printed the happy face and heart in the first place? I was using ASCII
> > Characters and there aren't any like that.
>
> But you weren't using ASCII characters unless your terminal saw them as
such.
> You were using byte values.
>
> Tell us what platform you're on. It sounds a lot like DEC (Compaq) to me.
>
> Rob
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why did it print a happy face?

2004-03-03 Thread Joel
Well, I got interested and changed this code to mess around with unicode
characters. The problem is it still doesnt print what it's supposed to, and
it makes the PC speaker on my computer beep. The simbols were a variety of
musical ones, a happy face, lightning bolt, etc. None of them were card
symbols.

Any ideas?

Joel

#!/usr/bin/perl

use warnings;
use strict;

my $h=15;
my @word = (0x26A1, 0x2622, 0x2672, 0x2623, 0x2669, 0x266A, 0x266B, 0x266C,
0x266D, 0x266E, 0x266F, 0x262E, 0x262D, 0x263B, 0x260D);
while ($h > 0) {
 $h--;
 my $letter=shift @word;
 print chr(@word);
}

- Original Message - 
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 12:46 PM
Subject: Re: Why did it print a happy face?


> Joel wrote:
> >
> > This is a precursor to a real JAPH signeture (I need to learn more perl
> > before I can write a really obfuscated one), and I have already gotten
it to
> > print what it was supposed to, but I changed print chr($letter); to
print
> > chr(@word); to see if it would work, which is when I got the happy face
> > output in perl. Any ideas?
> > (By the way, I haven't fixed the while loop yet so be ready to quit fast
to
> > read the output.)
> >
> > Joel
> >
> > #!usr/bin/perl
> >
> > use Warnings;
> > use Strict;
> >
> > my $h=4;
> > my @word = (0x4E, 0x65, 0x72, 0x64);
> > while ($h > 0) {
> >  $h++;
> >  $letter=shift @word;
> >  print chr(@word);
> > }
>
> Hmm. I'm don't think I should be encouraging anybody to write obfuscated
> Perl. Almost nobody does it well - including me.
>
> Why are you /incrementing/ $h from four until it's greater than zero?
>
> Your bug is that chr() forces its parameter into scalar mode, so that your
> output will be
>
>   "\03\02\01\0\0\0\0\0\0"
>
> Although your capitalised pragma could almost be seen as divisive: there's
> neither a 'Warnings' nor a 'Strict', so you're practising unprotected
> unintentional obfuscation.
>
> Write Perl well first. Please. Then write somthing clever.
>
> Rob
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Why did it print a happy face?

2004-03-03 Thread Joel
Keyboard symbols, greek letters, and weird things that look sort of like
roads. I don't know about the driver or how I would find out.

Joel


- Original Message - 
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 03, 2004 1:02 PM
Subject: Re: Why did it print a happy face?


> Joel wrote:
> >
> > From: "Rob Dixon" <[EMAIL PROTECTED]>
> >
> > > Tell us what platform you're on. It sounds a lot like DEC (Compaq) to
me.
> >
> > I'm running windows XP actually.
>
> I'm surprised! My XP does differently. Do you have an ANSI driver
installed
> for the command prompt? Try something like this:
>
>   use strict;
>   use warnings;
>
>   foreach (map chr, 0x00 .. 0xFF) {
> print unless /[[:cntrl:]]/;
> print "\n" unless ord() % 32;
>   }
>
> What do you see?
>
> Rob
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




perl hex editor

2004-03-03 Thread Joel
I'm trying to write a program in perl that will take a binary file, convert
it to hex, then save it to a text file. So far I'm not having any luck. The
best I've been able to do is copy the file and open it in a text editor.
Here is my code:

#!/usr/bin/perl

use warnings;
use strict;

print "Enter path:\n";
my $filename = <>;
chomp $filename;
print "Save as what?\n";
my $savefile=<>;
chomp $savefile;
open (BINARY, "$filename") || die "Couldn't open file: $!";
binmode BINARY;
my $x=BINARY;
open (SAVE,">$savefile") || die "Unable to save: $!";
print SAVE 0b"$x";
close BINARY;
close SAVE;

Any ideas?

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: perl hex editor

2004-03-04 Thread Joel
Thanks, that works perfectly. Now I just have to figure out how to turn it
back into a valid file. I tried using "pack 'b*'" but I had no luck. Any
suggestions?

Joel

- Original Message - 
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 03, 2004 5:31 PM
Subject: Re: perl hex editor


> Joel wrote:
> >
> > I'm trying to write a program in perl that will take a binary file,
convert
> > it to hex, then save it to a text file. So far I'm not having any luck.
The
> > best I've been able to do is copy the file and open it in a text editor.
> > Here is my code:
> >
> > #!/usr/bin/perl
> >
> > use warnings;
> > use strict;
> >
> > print "Enter path:\n";
> > my $filename = <>;
> > chomp $filename;
> > print "Save as what?\n";
> > my $savefile=<>;
> > chomp $savefile;
> > open (BINARY, "$filename") || die "Couldn't open file: $!";
> > binmode BINARY;
> > my $x=BINARY;
> > open (SAVE,">$savefile") || die "Unable to save: $!";
> > print SAVE 0b"$x";
> > close BINARY;
> > close SAVE;
> >
> > Any ideas?
>
> Perhaps this is what you want:
>
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> print 'Enter path: ';
> chomp( my $filename =  );
>
> print 'Save as what? ';
> chomp( my $savefile =  );
>
> open BINARY, '<', $filename or die "Couldn't open file: $!";
> binmode BINARY;
> open SAVE, '>', $savefile or die "Unable to save: $!";
>
> while (  ) {
> print SAVE unpack( 'H*', $_ ), "\n";
> }
>
> close BINARY;
> close SAVE;
>
> __END__
>
>
>
> John
> -- 
> use Perl;
> program
> fulfillment
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: hi!!

2004-03-05 Thread Joel
This is off topic, but is cygwin just the ports of GNU software for windows,
or is it an actual command line interface that simulates linux?

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




context?

2008-03-18 Thread Joel
 when calling functions, we need not include parantheses, and we're
still able to pass a list..
like for eg:
my_function "foo", "bar";  #this copies foo and bar into @_ of
my_function.

but alternately the same assignment like @_ = "foo", "bar";
will omit "bar" from the list.. why is this?

Thanks,
Joel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: context?

2008-03-20 Thread Joel
> > my_function "foo", "bar";
>
> > my_function is a list operator which has a very low precedence so the
> > parentheses are not required.
>
> Sometimes, i.e. if the sub is not predeclared, they are required.
>

yes this is true, because perl doesn't know that my_function is
actually a function call when it doesn't see it predeclared..

I have another question, why are function calls without parantheses
called list operators, is there no difference between the two?
why isn't a function call with parantheses called a list operator too?

Thanks,
Joel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: context?

2008-03-21 Thread Joel
Can you tell me the sequence of events that happen (internally in perl
during parsing) for the following code:

sub fun
{
print @_;
}

fun fun (1), fun 2, fun (3);

I am particularly interested in the comma operator, in the above code,
as I understand it
(1) first the list operations (which have highest precedence because
of parantheses) will execute first printing "13".
(2) then the comma between fun(1) and fun 2 is evaluated, once this
happens, is the list operation ( fun 2, fun(3) ) evaluated or is the
comma between 2 and fun(3) evaluated?

Thanks,
Joel

On Mar 20, 9:21 pm, [EMAIL PROTECTED] (Chas. Owens) wrote:
> On Thu, Mar 20, 2008 at 11:28 AM, Joel <[EMAIL PROTECTED]> wrote:
> > > > my_function "foo", "bar";
>
> >  > > my_function is a list operator which has a very low precedence so the
> >  > > parentheses are not required.
>
> >  > Sometimes, i.e. if the sub is not predeclared, they are required.
>
> >  yes this is true, because perl doesn't know that my_function is
> >  actually a function call when it doesn't see it predeclared..
>
> >  I have another question, why are function calls without parantheses
> >  called list operators, is there no difference between the two?
> >  why isn't a function call with parantheses called a list operator too?
>
> snip
>
> Not all subroutines are list operators.  For instance,
>
> sub square ($) { $_[0] ** 2 }
>
> is a named unary operator.
>
> from perldoc perlop*
>        Actually, there aren't really functions in this sense, just
> list operators and unary operators
>        behaving as functions because you put parentheses around the arguments.
>
> *http://perldoc.perl.org/perlop.html#Terms-and-List-Operators-(Leftward)
> --
> Chas. Owens
> wonkden.net
> The most important skill a programmer can have is the ability to read.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: context?

2008-03-22 Thread Joel
Thank you Rob.

I am aware of that actually. To state my confusion, I wil get a better
example:

For the following code,

   sub fun {
 print "fun(@_) ";
   }

   fun 1, fun ''b" | "c", 1;

The output looks like:
fun(c,1) fun(1,1)

*but*  the precedence of the operators used is as:  comma operator,
list operator, bitwise string operator.
*so* the commas and list operators should be evaluated before the pipe
gets a chance.
so the right hand side of the pipe is discarded, passing only "b" to
the funciton because the list operator is evaluated before the pipe.
But this doesn't seem to be happening!

like how in code: $a = 1, 2;
2 is discarded because  comma has lower precedence than the assignment
operator.

Thanks,
Joel

On Mar 22, 1:10 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> Joel wrote:
>
>  >
>
>
>
>
>
> > Can you tell me the sequence of events that happen (internally in perl
> > during parsing) for the following code:
>
> > sub fun
> > {
> >    print @_;
> > }
>
> > fun fun (1), fun 2, fun (3);
>
> > I am particularly interested in the comma operator, in the above code,
> > as I understand it
> > (1) first the list operations (which have highest precedence because
> > of parantheses) will execute first printing "13".
> > (2) then the comma between fun(1) and fun 2 is evaluated, once this
> > happens, is the list operation ( fun 2, fun(3) ) evaluated or is the
> > comma between 2 and fun(3) evaluated?
>
> I suspect you are forgetting that fun() itself returns the success
> status of the print() function, introducing additional 1s into the
> output. Look:
>
>    local $" = ',';
>
>    sub fun {
>      print "fun(@_) ";
>    }
>
>    fun fun ('a'), fun 'b', fun ('c');
>
> **OUTPUT**
>
>    fun(a) fun(c) fun(b,1) fun(1,1)
>
> The line
>
>    fun fun ('a'), fun 'b', fun ('c');
>
> parses as
>
>    fun(fun('a'), fun('b', fun('c')));
>
> and each parameter list is evaluated from left to right, hence the order
> shown by the code's output.
>
> HTH,
>
> Rob- Hide quoted text -
>
> - Show quoted text -


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Help with Perl-SDL

2004-03-19 Thread Joel
I seem to be unable to install it. I keep getting this message from
build.pl:
"Base class package "Module::Build" is empty.
(Perhaps you need to 'use' the module which defines that
package first.)
at make/lib/SDL/Build.pm line 4
BEGIN failed--compilation aborted at make/lib/SDL/Build.pm line 4.
Compilation failed in require at
C:\Perl\site\lib\sdll\SDL_Perl-2.0.5\Build.PL l ine 7.
BEGIN failed--compilation aborted at
C:\Perl\site\lib\sdll\SDL_Perl-2.0.5\Build. PL line 7."

Any suggestions?

Thanks

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: search engine for beginners.perl.org

2005-01-26 Thread Andrianoelison Joel
Hey, that's what we call "FAQ", isn't it? :-)

Is there any FAQ for this mailing list?

Thx
Joel

-Message d'origine-
De : Vladimir Lemberg [mailto:[EMAIL PROTECTED]
Envoye : mercredi 26 janvier 2005 01:08
A : Perl Beginners
Objet : search engine for beginners.perl.org


Hi, 

Is there any way so search old posts via web? For example I want to ask some
trivia question and I'm pretty sure that this question has been asked so
many times.
So before posting a new topic, I'd rather search the old ones regarding my
problem.

thanks in advance,
Vladimir


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Send email to microsoft exhange distribution list

2005-02-18 Thread Joel Merrick
On Fri, 2005-02-18 at 06:49 -0500, Chris Devers wrote:
> On Fri, 18 Feb 2005, Hany Nagaty wrote:
> 
> > I have a small question.
> > 
> > Using Perl, I'd like to send an email to an exchange distribution 
> > list. How can it be done. Is there a module that acts like an outlook 
> > client to connect to the exchange server. I've searched a lot on CPAN 
> > but couldn't find anything. I want to use it from Linux and not 
> > Windows.
> 
> Is it not listening to standard SMTP ?
> 
> Can you not just send an email to [EMAIL PROTECTED] ?

Yea, surely that's the easiest way? I don't know if you can do
exchange-like RPC with Perl (probably!) :)

> 
> If you can, you have lots and lots and lots of options.
> 
> If you can't... I'm not even sure where to start with this...
> 
> Please clarify.
> 
>  
> 
> -- 
> Chris Devers
> 
-- 
Joel Merrick



signature.asc
Description: This is a digitally signed message part


Installing Downloaded Modules from CPAN

2005-04-05 Thread Joel Divekar
Hi All

I am using Activestate Perl Ver 5.8.4 under Windows 2k
and due to firewall I am not able to install packages
using ppm / ppm3. I have checked following doc but no
luck. Please advice. I am sorry if this point was
discussed earlier.

http://www.cpan.org/modules/INSTALL.html

Regards

Joel
Mumbai, India
9821421965

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Count special character

2005-05-24 Thread Joel Divekar
Hi All

I want to search a string for a special character and
count the occurance. 

My code is as follows :

--

#!/usr/bin/perl -w

my $a = "a:b:c:d:e:f:\:↔:↔:";

my $count = ($a =~ tr/\chr(29)//);

print $count;

--

Following code works but I prefer to use chr(29)
instead of ↔

my $count = ($a =~ tr/↔//);

Please advice.

Regards

Joel
Mumbai, India
9821421965



__ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




File Management

2005-07-22 Thread Joel Divekar
Hi All

We have a windoz based file server with thousand of
user accounts. Each user is having thousand of files
in his home directory. Most of these files are
duplicate / modified or updated version of the
existing files. These files are either .doc or . xls
or .ppt files which are shared by groups or
departments.

Due to this my server is having terabyte of data, most
of which are redundant and our sysadmin has tough time
maintaining storage space.

For this I though of writing a small program to locate
similar or duplicate files stored on my file server
and delete them with the help of the user. The program
should work very fast and I don't know from where to
start.

Anybody out here to show me a direction to some links
on how to start and from there I shall take up. I
would also like to know long term solution for this
problem if any ? I am comfortable with linux or shell
programming.

Please advice. Thanks a lot.

Regards

Joel
Mumbai, India
9821421965




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Validating Decimal Values

2005-11-30 Thread Joel Divekar
Hi

I am having a small program which parses data file.
The data file contains decimal values and I am not
able to validate the decimal number.

For eg. the decimal number will be as follows

Max Size : 9.99
valid values : 3.00 or 745.15 or 21576.00
invalid values : 3.001 or 745.1555 or 215766.00
also 3..00 should be marked invalid.

I am not good with RE but I tried following code, but
I am not sure if I am in right direction. Can anybody
help or guide me ? 

***
my $a = "3.89011";

if ($a=~/^\d{0,5}\.\d{0,2}/)
{
print "Valid";
}
else
{
print "Invalid";
}
***

or is there any perl module available to do validation
of alpha, numeric and alphanumeric (with decimal) data
type ?

Thanks

Regards

Joel
Mumbai, India
9821421965




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Update All Modules CPAN.pm

2005-12-19 Thread Joel Divekar
Hi

Under CPAN when I run r command, I get the list of
updatable modules. Is there any command to get all
these modules auto updated. Thanks.

Regards

Joel
Mumbai, India
9821421965

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




rss read issue with non-encoded char

2006-03-18 Thread Joel CARNAT
Hi,

I have written a small perl script that reads a few RSS flows and
generate an HTML file. It seems one of them have non-ASCII character not
encoded ; this make the script stop.

*** perl script says 
***
not well-formed (invalid token) at line 90, column 63, byte 3936 at
/usr/pkg/lib/perl5/vendor_perl/5.8.0/sparc64-netbsd-thread-multi/XML/Parser.pm
line 187

if I manually fetch the RSS file and read it, the problem ("at line 90,
column 63") is the "ö" from "... Rainer Brinkmöller, I...".

I don't find which part of my script to modify :(

Any idea ?
TIA,
Jo

PS: my script is :

#!/usr/bin/env perl
#
# Get RSS News and generate HTML files for inclusion
#

use strict;
use XML::RSS;
use LWP::Simple;
use File::Basename;
use URI::Escape;

# List of RSS/News
#
#   "10-hubertf" => "http://www.feyrer.de/NetBSD/blog-rss.xml";,
my %news = (
"05-netbsd" => "http://www.netbsd.org/Changes/rss-netbsd.xml";,
"06-ndigest" => "http://digest.coris.org.uk/feeds/cvs-rss.xml";,
"10-hubertf" => "http://www.feyrer.de/NetBSD/blog-rss.xml";,
"15-undeadly" => "http://undeadly.org/cgi?action=rss";,
"20-afp" => "http://www.afp.com/francais/rss/stories.xml";
);

# For all of the RSS sources listed above
#
foreach my $k (keys(%news)) {
my $rss = new XML::RSS();
my $raw = get($news{$k});
$rss->parse($raw);

my $nonews = @{$rss->{'items'}};
if($nonews > 5) { $nonews = 5 };# Only show the 5 more
recent news ;)

open(FILEWRITE, "> " . dirname($0) . "/" . $k . ".html");
print FILEWRITE "" . $rss->channel('title') . " channel('link') . "\">[+]\n";
print FILEWRITE "\n";
for (my $i=0; $i<$nonews; $i++) {
my $item = @{$rss->{'items'}}[$i];
my $title = $item->{'title'};
my $url = $item->{'link'};
$url =~ s/\&sid/\&sid/;
print FILEWRITE "" . $title
. "\n";
}
print FILEWRITE "\n";
close FILEWRITE;
}


-- 
,- This mail runs --.
`- NetBSD/smtp -'


pgpjZIx6ypdws.pgp
Description: PGP signature


RE: Help!!!

2003-01-07 Thread Joel Biss
In windows you can use

/Start/Programs/Accessories/System Tools/Scheduled Tasks

or 

'at' from the cmd prompt to schedule your perl program to run every minute
or so.


-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
Sent: 06 January 2003 16:46
To: 'George Schlossnagle'; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Help!!!


You could do it with Perl. Dump the output of the system call ping to a
log file. Set it up to run however often you want to check. In Linux you
could do this by setting up cron job. Not sure how you would do it in
windows.

kind of doing this from memory so let me know if I am wrong.

$var=`ping xxx.xxx.xxx.xxx`;
print LOG "$var\n";



> -Original Message-
> From: George Schlossnagle [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, January 06, 2003 11:45 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Help!!!
> 
> 
> Not in Perl (though you can write extensions for it in Perl), but try 
> Netsaint (now Nagios):  http://www.nagios.org/.
> 
> George
> 
> On Monday, January 6, 2003, at 11:55  AM, Jose Vicente Paredes Loor 
> wrote:
> 
> >
> > Hi, friends.
> >
> > I am looking for a script(or a group of them) to monitor my 
> network,i 
> > mean, i want to ping from one server and collect the data 
> in some web 
> > page maybe, and show the ping result from all my servers in 
> only one 
> > page. I have scripts to make ping from the server, but i 
> dont know how 
> > to collect the data to show them after.
> > I need to know when i dont have internet from a specific server.
> >
> > Please help me.
> >
> > Thanks in advance.
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

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




dbmopen problem

2003-12-07 Thread Joel Newkirk
I've run into a problem.  I have been working on a webmin module that,
among other things, maintains a dbm file of regular expressions.  One
subroutine is passed a string, and if any of the regular expressions
matches, it returns the associated explanation text. I can read and
write this dbm with no issues.

Now I'm working on a console command to offer the same functionality
(only needing to read the rules, not write) using the same dbm.  I've
used precisely the same subroutine as in the webmin version, but
whenever I reach:
dbmopen (%PLRULES, "/var/szs/rules.dbm", undef) or die $!;
I die, with "No such file or directory".

Absolute path, world-readable files owned by root, precisely the same
statement in each, the webmin CGI version and the console version.  The
webmin CGI is NOT runnning when I try this from the console, and I'm
root when trying.

What am I doing wrong??

j

-- 
"Not all those who wander are lost."  - JRR Tolkien


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




Re: dbmopen problem

2003-12-10 Thread Joel Newkirk
Well, I guess I'll reply since nobody else has...  Problem is I still
have no clue what's wrong here... :^)

Surely somebody here can offer a hint?  Please?  :^)

j

On Mon, 2003-12-08 at 01:06, Joel Newkirk wrote:
> I've run into a problem.  I have been working on a webmin module that,
> among other things, maintains a dbm file of regular expressions.  One
> subroutine is passed a string, and if any of the regular expressions
> matches, it returns the associated explanation text. I can read and
> write this dbm with no issues.
> 
> Now I'm working on a console command to offer the same functionality
> (only needing to read the rules, not write) using the same dbm.  I've
> used precisely the same subroutine as in the webmin version, but
> whenever I reach:
> dbmopen (%PLRULES, "/var/szs/rules.dbm", undef) or die $!;
> I die, with "No such file or directory".
> 
> Absolute path, world-readable files owned by root, precisely the same
> statement in each, the webmin CGI version and the console version.  The
> webmin CGI is NOT runnning when I try this from the console, and I'm
> root when trying.
> 
> What am I doing wrong??
> 
> j
> 
> -- 
> "Not all those who wander are lost."  - JRR Tolkien
-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: dbmopen problem - solved

2003-12-11 Thread Joel Newkirk
On Wed, 2003-12-10 at 20:58, Joel Newkirk wrote:

> On Mon, 2003-12-08 at 01:06, Joel Newkirk wrote:

> > Now I'm working on a console command to offer the same functionality
> > (only needing to read the rules, not write) using the same dbm.  I've
> > used precisely the same subroutine as in the webmin version, but
> > whenever I reach:
> > dbmopen (%PLRULES, "/var/szs/rules.dbm", undef) or die $!;
> > I die, with "No such file or directory".

> > What am I doing wrong??

I found my problem - apparently webmin was doing "use GDBM_File;" for
me, which is why it worked in the webmin module, and since I wasn't
including either that or the webmin "web-lib.pl" it was defaulting to a
different DB format, hence the "File Not Found" error.  Once I include
"Use GDBM_File;" I can successfully read the DBM written by the webmin
module.  Doh!  Maybe my second week with Perl will be smoother... ;^)

Many thanks to all who offered advice.  Once I get the suite working as 
desired I'll be going through again and optimizing, and during that
phase I plan to change over to using a tie instead, but for now I've got
the functionality I need - remaining work is webmin UI cleanup and
adding further analysis capabilities, and auto-unblock as counterpart
to the autoblock.pl/autoblock.cgi functionality.

Our spam-harried clients thank you as well...  :^)  Now I can get the
autoblock running under cron, instead of only being available manually
from webmin.

FWIW, here's the bigger picture:

Using the ULOG target in iptables, and ulog-acctd, I log a flag (SMTP,
POP3, or FILT) a timestamp and a source IP for every connection to our
mailserver cluster.  (the standard iptables LOG target gives us far more
information than we need, and as a result takes about 5x longer to process
and 10x more disk space) Periodic analysis brings up the top (N) source IPs
with greater than (M) SMTP connections, which we process as follows:

If the IP is already blocked, do nothing.  If the IP is one of our own,
do nothing.  If the IP is the source of authenticated POP3 connections,
do nothing.  If the IP is in /var/szs/whitelist, do nothing.  Otherwise:
Perform a reverse lookup of the IP.  If the reverse record is empty, or
contains all four octets of the IP (decimal or hex) the block it with
iptables from entering the cluster at all.  Then we compare the reverse
record against /var/szs/rules.dbm's regex rules, and if we find a match
we block it.  Those rules are crafted to identify end-user IPs by 
patterns in their naming, IE '$3.$4.{1,20}rr.com' with IP octets being
subbed for $1,$2,$3,$4 before regex evaluation.

The point is this - I'm opposed on principle to using mail-abuse.org's
DUL (dial-up IP pool list) and blocking huge blocks of dynamic IPs, 
since I consider it not unreasonable that someone is (like me) running 
a mailserver at home on a dynamic IP.  However, with the hundreds of
thousands of spam messages hitting the company mailservers each day,
largely from broadband-connected end-user machines infected with
SoBig or similar spam-relay infections, we needed a way to weed them
out.  In the last 24 hours, we've received just over 2 million SMTP
connections, roughly 85% of which are incoming spam.  (logging all of
those with the native iptables LOG target is hopeless, with logfiles
topping 1gb daily, while ULOG with the custom format is about 100mb)

This set of scripts has allowed us to cut our incoming spam by about 80%
while cutting the resource usage on the servers drastically, instead of
boosting it several times by implementing extensive content filtering
on the servers themselves.  The reason for the tremendous cut in resource
requirements is that not only is this crap never reaching the servers,
they don't get bogged down repeatedly trying to send "unknown recipient"
bounces to non-existant sources.  We reached one point where we had over
100,000 bounce messages clogging the outbound message queue...  And that's
with periodic manual flushes.

All of this processing takes place on the Director node of an LVS cluster
running qmail on multiple nodes, handling email for about 50 domains.  (we
are an ISP)  Apart from this processing, the only things the Director node
deals with is routing SMTP/POP3/HTTP(S) to the most-available node, and 
presenting a caching nameserver for use by the clustered servers, so I 
have resources to spare up front, while resources on the mailserver nodes 
themselves are in much higher demand.  And the reverse lookups performed
by the autoblock scripts come at very low cost, since we are performing
them anyway on behalf of the mailserver nodes, and caching the lookups.

Again, thanks for advice and hints.

j

Joel Newkirk
perl at newkirk.us
firewalldude @ dsslink.net

-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: dbmopen problem

2003-12-11 Thread Joel Newkirk
On Wed, 2003-12-10 at 22:07, Owen wrote:
> On Mon, 08 Dec 2003 01:06:04 -0500
> Joel Newkirk <[EMAIL PROTECTED]> wrote:
> 
> > dbmopen (%PLRULES, "/var/szs/rules.dbm", undef) or die $!;
> > I die, with "No such file or directory".
> 
> No idea but;
> 
> I would tend to beleive the "No such file or directory" statement.
> you can do an ls -la /var/szs/rules.dbm ?

Yep, the files are there (actually rules.dbm.dir & rules.dbm.pag, as
created previously with:

dbmopen(%PLRULES "/var/szs/rules.dbm", 0644) or die $!;

I use the precise same command (IE, with the "undef") in the CGI script
with no problems.

> I would have written the "or die $!;" as or die "Can't dbmopen $!\n"; but then maybe 
> you only have one die statement to worry about?
> 
> I have never seen "dbmopen (%PLRULES, "/var/szs/rules.dbm", undef)" normally I see 
>   dbmopen (%PLRULES, "/var/szs/rules.dbm", 0666) or die.
>   %PLRULES=();

Using undef is supposed to open the file for reading only and fail if
it's not found - '0666' will create a new file if one didn't already
exist, and assign it read+write permissions for all, failing only if it
is unable to create the file(s), 

> The syntax for dbmopen is Arrayname DB_filename mode 
> so I just wonder if undef is a mode?
> 
> 
> -- 
> Owen

j

-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: dbmopen problem

2003-12-11 Thread Joel Newkirk
On Wed, 2003-12-10 at 22:11, drieux wrote:
> On Dec 10, 2003, at 5:58 PM, Joel Newkirk wrote:
> [..]
> >> whenever I reach:
> >> dbmopen (%PLRULES, "/var/szs/rules.dbm", undef) or die $!;
> >> I die, with "No such file or directory".
> [..]
> 
> are you sure about that dbmopen() line?
> 
> eg:
> 
>   perldoc -f dbmopen
> 
> seems to suggest that DBNAME shoudl be
> the 'name' without the Suffix,
>   
>   dbmopen (%PLRULES, "/var/szs/rules",0755) or die $!;
> 
> because i'm a bit concerned that your dmbopen is actually
> trying to find the file "/var/szs/rules.dbm.dbm" - depending
> upon the underlying OS it is on.

Underlying OS is Linux, specifically Mandrake 9.2, with perl V5.8.1.  I
named it that way because I was migrating from a textfile named "rules"
that originally held the regex rules.  The actual files used are
"rules.dmb.dir" and "rules.dbm.pag", created when I originally accessed
the nonexistant DBM with:
dbmopen (%PLRULES, "/var/szs/rules.dbm", 0644) or die $!;
and it opens and reads without problems from the webmin CGI, but the
precise dbmopen command that works in the webmin CGI fails in the
console-command version.

> but you might want to actually cross over and
> look at doing a 'tie' - cf
> 
>   perldoc -f tie

I thought that was what 'dbmopen' did for me, in this simplistic case of
'tie'.  This is my first week with Perl, so I've got a way to go
still...

> ciao
> drieux
> 
> ---

j

-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: dbmopen problem - solved

2003-12-11 Thread Joel Newkirk
On Thu, 2003-12-11 at 14:06, drieux wrote:
> On Dec 10, 2003, at 11:34 PM, Joel Newkirk wrote:
> [..]
> > I found my problem - apparently webmin was doing "use GDBM_File;" for
> > me, which is why it worked in the webmin module, and since I wasn't
> > including either that or the webmin "web-lib.pl" it was defaulting to a
> > different DB format, hence the "File Not Found" error.  Once I include
> > "Use GDBM_File;" I can successfully read the DBM written by the webmin
> > module.  Doh!  Maybe my second week with Perl will be smoother... ;^)
> [..]
> 
> p0: if you want to have 'compatibility' with webmin,
> you might work out whether or not you too should be
> 'sourcing in' their web-lib.pl information as a way
> to keep your 'basics' consistent with theirs.

I'd rather not depend on the webmin lib for the console command, I'd
like it to be a 'standalone' tool.  In the webmin module that covers 
similar functionality (albeit interactively) I use "web-lib.pl" in
order to get the HTML and CGI extras, with HTML headers and such 
matched to the current webmin theme, and webmin's access control
system that lets me control which users have access to the module.

> p1: thanks for explaining that you were planning
> on actually using that foo.dbm to create the
> 
>   foo.dbm.pag
>   foo.dbm.dir
> 
> even if that makes me go YIKES! may I recommend
> that you adopt the naming strategy
> 
>   foo_dbm
> 
> so as not to scare 'old guys'

Old Guys... Hah...  :^)  Actually, I've changed it to remove the "dbm"
completely, just calling it "rules" within the program, and thus the
files actually created are "rules.pag" and "rules.dir".

> p2: You might also want to look at
> 
>   use SDBM_File;
> 
> which is a db format that comes with Perl
> and is actually a bit More ubiquitous than
> the GDBM_File format, which assumes that the
> build out of perl already had the underlying
> gdbm libraries.

Well, actually I misspoke, and SDBM is what I've used, and doing so
causes it to create the two files noted when I specify "rules.dbm".

> p3: It all goes down hill from here...
> 
> Since of course I will go back to my
> general recommendation to heed the warning
> and shift to 'tie' . That way of course
> would lead you into creating your own
> stand alone DB Abstraction Layer, where you
> hide from yourself and the rest of the system
> what you are doing with the 'db stuff' - and
> since you will be building that out using
> h2xs to correctly form up your perl modules,
> it will be all so much easier.

I'll probably be doing so sometime early next week.  (IE, you can look
forward to more questions from me around then... [grin])

> p4: and on the 3rd week of perl programming.

I have to get there first.  ;^)

> ciao
> drieux

j

-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: help looping through text file

2003-12-13 Thread Joel Newkirk
On Fri, 2003-12-12 at 15:59, John Fitzgerald wrote:
> I need a list set like this:
> IDdate
> 3008 11/1/03  
> 3008 11/1/03  
> 3008 11/1/03  
> 3010 12/1/03
> 3010 12/1/03
> 
> So I need repeating ID's, with the earliest date for
> each ID. If the order of the data is preserved, I can
> use just those two columns for processing, then
> combine them back with the other columns afterward.

Warning - I've only been working in Perl for just over a week... ;^)

If I understand the unwritten goal correctly, you want to actually
modify the data? Either in the original file or a new file with the
changed dates? Why should it matter if the order is preserved while
processing, as long as the order is preserved in the result?  That also
implies retaining all the data read in during the 'first pass', which
isn't necessary as you can match up IDs trivially.  Largely influenced
by my single 'real' Perl project, (involving multiple 100mb+ logfiles) I
tend to work with the minimum amount of data at a time that is
reasonable.

I would approach it like this:

Loop over the data file once, creating a hash with the IDs as keys and
the earliest date found as the value for each key.  Loop over the data
file a second time and instead of the date field from the file, use the
date field value retrieved from the hash, and write to a file or format
for screen presentation or whatever your goal is for this data.

I'm a rank beginner with Perl, so the following quite likely contains at
least one error, but I'd write it something like this:

my @clientbirth;

open INFILE, "sourcefile" or die "sourcefile open failed - $!";
while ()
{
my ($uid, $birth, undef) = split;
$clientbirth{$uid} = earlierdate($birth,$clientbirth{$uid});
}
close INFILE;

open INFILE, "sourcefile" or die "sourcefile open failed - $!";
open OUTFILE, ">destfile" or die "destfile open failed - $!";
while ()
{
my ($uid, undef, @data) = split;
print OUTFILE, $uid, $clientbirth{$uid}, @data;
}
close OUTFILE;
close INFILE;


With an implicit sub earlierdate() that returns the earlier of the two
dates presented to it, dealing with whatever the date format is. 
Obviously if this all takes place in sequence it's not necessary to
close and reopen INFILE, just rewind the file to the start, like "seek
(INFILE,0,0);".  Just as obviously, if you aren't intending to write the
data out to file, the second half is inappropriate... ;^)  And there's
an implied assumption that sourcefile's contents aren't subject to
change while being processed.

There are ways to accomplish it in a single pass as well, although
unless you're assured that the 'earliest date' is also the first one to
appear for a given ID, it gets complicated pretty quickly unless you
simply read all data in and then work with it.  (Your sample data shows
out-of-order dates, IE for ID=3010.)

j

> --- Rob Dixon <[EMAIL PROTECTED]> wrote:
> > John Fitzgerald wrote:
> > >
> > > Hi, I'm fairly new to Perl, and trying to do a
> > simple
> > > operation on a text file exported from excel.
> > > ID  Enrolled Extraneous Columns
> > > 3008 05-Aug-03
> > > 3008 05-Aug-03
> > > 3008 05-Aug-03
> > > 3008 05-Aug-03
> > > 3008 24-Sep-03
> > > 3009 11-Aug-03
> > > 3010 19-Nov-03
> > > 3010 11-Jul-03
> > > 3010 11-Jul-03
> > > 3010 11-Jul-03
> > > 3011 15-Jul-03
> > >
> > > As you can see, the dates for a given ID are
> > > different. What I need to do, is set the dates all
> > to
> > > the earliest date for that ID (client-birth date).

> > The
> > > other columns are are important, but don't factor
> > in
> > > here.

-- 
"Not all those who wander are lost."  - JRR Tolkien


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




Re: Split question

2003-12-14 Thread Joel Newkirk
On Sun, 2003-12-14 at 14:52, John W. Krahn wrote:
> Josimar Nunes De Oliveira wrote:
> > 
> > From: "Perl" <[EMAIL PROTECTED]>
> > >
> > >   @temp = split(/#/, "abc#def#ghi#jkl") ;
> > >
> > > doesn't seem to work.
> > >
> > > am i doing anything wrong here ?
> > 
> > Try this:
> > 
> > @temp = split('\#', "abc#def#ghi#jkl") ;
> > foreach (@temp){
> >  print "\n", $_;
> > }
> 
> The first argument to split is converted to a regular expression and the
> '#' character is not special in a regular expression so split/#/ and
> split'\#' do exactly the same thing.

Well, actually they don't, since the 'bare' # will be interpreted as
starting a comment, while the one in quotes won't...  ;^)

The op's assignment was assigning 'split(/' to @temp...

j

> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
-- 
"Not all those who wander are lost."  - JRR Tolkien


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




Re: Split question

2003-12-15 Thread Joel Newkirk
On Sun, 2003-12-14 at 18:11, Joel Newkirk wrote:

> > 
> > The first argument to split is converted to a regular expression and the
> > '#' character is not special in a regular expression so split/#/ and
> > split'\#' do exactly the same thing.
> 
> Well, actually they don't, since the 'bare' # will be interpreted as
> starting a comment, while the one in quotes won't...  ;^)
> 
> The op's assignment was assigning 'split(/' to @temp...

Doh, please disregard - just seconds after pressing "Send" I realized my
mistake... 

j

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




double-log-tail

2004-01-12 Thread Joel Newkirk
I'm interested in tailing two logs (qmail) simultaneously, and
interleaving the data in something approaching chronological sequence,
as well as dealing with logfile rotation gracefully.

Any suggestions?

j

-- 
"Not all those who wander are lost."  - JRR Tolkien


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




tai64 timestamp

2004-01-12 Thread Joel Newkirk
I'm trying to convert tai64 timestamps (qmail) to human-readable form. 
I installed DateTime::Format::Epoch::TAI64 and dependancies, and below
is the latest mutation of a test program.  The output lists the tai64
timestamp correctly, and the source IP ($src), but the converted time
($dt->hms) is 00:00:00.  What have I missed?  Do I have to explicitly
invoke a conversion of the data or something?

j

#!/usr/bin/perl
#
#
# [EMAIL PROTECTED]
#

use strict;
use warnings;
use DateTime;
use DateTime::Format::Epoch::TAI64;
my $formatter = DateTime::Format::Epoch::TAI64->new();

open QLOG1, "/home/qlog1/smtpd/current" or die $!;
while ()
{
if (/ ok /)
{
my ($time,undef,undef,undef,undef,$src) = split;
# substr to eliminate the leading '@'
$time = substr $time, 1;
print "$time - ";
my $dt = $formatter->parse_datetime( $time );
$time=$dt->hms;
print "\"$src\" at $time\n";
}
}
-- 
"Not all those who wander are lost."  - JRR Tolkien


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




Re: double-log-tail

2004-01-21 Thread Joel Newkirk
Cool, thanks - both look promising.

j

On Mon, 2004-01-19 at 14:47, Wiggins d'Anconia wrote:
> Joel Newkirk wrote:
> > I'm interested in tailing two logs (qmail) simultaneously, and
> > interleaving the data in something approaching chronological sequence,
> > as well as dealing with logfile rotation gracefully.
> > 
> > Any suggestions?
> > 
> 
> Check out File::Tail on CPAN, particularly the section on 'select' and 
> the mentioned example script, it should get you close.
> 
> http://search.cpan.org/~mgrabnar/File-Tail-0.98/Tail.pm
> 
> And I might as well throw a POE reference in here, as usual this sort of 
> thing is trivial in POE, particularly since there is already a Wheel 
> written to do it, check out the cookbook entry here (not for the faint 
> of heart):
> 
> http://poe.perl.org/?POE_Cookbook/Watching_Logs
> 
> HTH,
> 
> http://danconia.org
-- 
"Not all those who wander are lost."  - JRR Tolkien


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




trying out examples in Oreilly's Perl Graphics Programming

2003-07-16 Thread Joel Lopez
Hi,

I have been trying to get this perl script to work, but I'm can't seem
to figure out why it's not working.  You can see it here:

http://shawn.apocabilly.org/PGP/examples/example2-1.txt

When I run it I get this on my screen:

[EMAIL PROTECTED] imagemagick]# ./helloworld2
Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
Use of uninitialized value in addition (+) at ./helloworld2 line 31.
Use of uninitialized value in addition (+) at ./helloworld2 line 31.
Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
‰PNG

IHDR‘ÉŸåçê   PLTEÈÈÈÿ2   n2IDATxœÕ›]’ä& 
€ñƒÀ}´ûî­29bö”™6Ö
n·f¢ª$6ú„$Ø=
!¥·ÒÊ’┘Ù)ÁñïZ¶³Ë°Ýüêöú'¼(SHÑ/¡çK·Lá&%þ8ʺ{P4)±+\RV┌Û›”CbªbÝü2{E

>+’íƒá¸ äVóæWóB2|+â,
[Ã*ÏÖ½E H   Eê¢ÐM)ûËþþý┴çä┼&…­>έ[“²æÐíìpÊV˜
Š›R^™“)›IQzPhÌ‹T³ò,J8
(8äå
ô”I&[EMAIL 
PROTECTED]@^.ôèðïæÝ.eã'íÕ┬WÙÌ»‘├ód䎚6└┴0ïr$«˜ž┼'?1X│±´·½(—iî
¢
s,O´ ……·ehrZ┼┘¤}áÑ~HT$pK„°ÈQ/šÃÃèÄI\ðTÉÛTëd┐b
º:ûŠÈF#Ÿæ¤ðÏZ9³®òÀ1”P│/R’U¢
=2ÒÀîÌ°-ƒÚÍ+7SÌZC¹oKäÁdzp 
’!┬Ý4°¥ü‚‡bðÇ¢€I鱄¸)äÏÂ▒^+׉»T=·[Ê™B
ë‘yÅòA%‚¥¶KAˆ8Õ<…‚µ¡›
Ó®ìC”└í)r¦2åKe*î¦;ÃZ57þ/”ý’’R¹âþÔ±øQ|rìcóűî?UÇ|┘²Ïúâ³Vú¬û.{Ÿý˜ÏÞÒ±Ÿì²ç·òüÒ
¦<[EMAIL PROTECTED],•\1}Þ7D̍Ƙ+5B┴4‡RéØš©5›óÉÊ,#„g‡s±ùf
´A5MúXXfEßÐ#2þ:_¢xUtx
åâýXѤ*HSVé&ó½Ð!읢©œÇ¶`g¶Œ¯X,k™bõPBÙاÖ6*Ÿª»®c|%:ÔzŒo7²G^+U÷îíƒböÈë¾ê7(8<±GÑ
~š¢Úy'T  Šùe ïÇÞ¦DîG„¬L1¾íðÕ(%=&) 
SÖ^QâeÝó«Kƒ‚*›”\åîPÒE└
=†Æ·Ï/µžOžÅ>r®¬ùœ┐Ÿ│«±äþYÛ²«–(‚▒÷è¥Dÿ=›Rr▒N/'Z^ž—Ž¢‰Œ
 ´±¥¡hb&Q
hËÿ?P•
λë
;&ø>¹.ˆc0®jÁwãç/yÎVWô†ð­nÂ'A¡ú„õ¢±Š³\U¢Sø›EUgÉ%…늬0–1L!ßà,[EMAIL
 PROTECTED] Æ
…{ôßœ§.S¬åŒ‹ÕNŸÅ¤å{3þ]ŠØGœ”í%Ò½h>u†JQèÉk
 Qä7ÚaÊBÑÅ/mŸ
ðW¼>…¬éS¨$R÷ä+A‘{ÕïË·ÆܧxÌŸ¹ïUÇ®±÷€š"þ{žS±"ÔXPbúA”4^Rbª)G—2–ï¤<ŸcÏΟ¹ÿ┤ŒFýPMöY_|ÖJŸ┤ß±ã²óÙ[ú
×tXî¼­›·Ìš‹Ï[v7+§,kΰuÚ²Fµ0~3`Ù,Åš9WyÔŸX
PŒÎ>E‘»®–8ÂÆø;cS"ë8ÞÀëï!-ŠX÷I™užÐlÈ]ÿú  
)…e¨Qä%óÄië’¢¿ i
i;%òÌ¢?Õ$Z†;ÙÒÈÕ*ÉX$Œ
,‚‚ÑRÖ)PåwªOSrÛÏ¢ˆÏSE,Y#ªþ~XRmÁ–×æ?·C®ãÞPxðIEN
[EMAIL PROTECTED] imagemagick]# xtermxtermxtermxtermxtermxtermxtermxtermxterm


I first typed it in, but then after I couldn't get it to work I copied
and pasted it into a file.

I'm using Red Hat 8 and have updated the libgd C library to version
1.8.4 and then used cpan to install GD.

I ran the demo for libgd and it made the graphic it was supposed to so I
think it's working ok.  Is there anyway to find out if everything is
installed correctly?

thanks,
Joel




RE: trying out examples in Oreilly's Perl Graphics Programming

2003-07-16 Thread Joel Lopez
Hi,

using this seems to get rid of the garbled stuff:
./helloworld2 > output.png

Is output.png supposed to be an existing image or is it one that is created
on the fly?

The code refers to the book authors home directory:

my ($x1, $y1, $x2, $y2,
$x3, $y3, $x4, $y4) = $image->stringFT($black,
"/home/shawn/arial.ttf", 48, 0, 40, 120, "Hello World");

Is this where the image is read from or created to?  The book site doesn't
give an image to work with.

thanks for helping a lost man,
Joel

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 12:22 PM
To: Joel Lopez; [EMAIL PROTECTED]
Subject: RE: trying out examples in Oreilly's Perl Graphics Programming




On 16 Jul 2003 11:28:31 -0700, Joel Lopez <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> I have been trying to get this perl script to work, but I'm can't seem
> to figure out why it's not working.  You can see it here:
>
> http://shawn.apocabilly.org/PGP/examples/example2-1.txt
>
> When I run it I get this on my screen:
>
> [EMAIL PROTECTED] imagemagick]# ./helloworld2
> Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
> Use of uninitialized value in addition (+) at ./helloworld2 line 31.
> Use of uninitialized value in addition (+) at ./helloworld2 line 31.
> Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
> ‰PNG



>
> I first typed it in, but then after I couldn't get it to work I copied
> and pasted it into a file.
>
> I'm using Red Hat 8 and have updated the libgd C library to version
> 1.8.4 and then used cpan to install GD.
>
> I ran the demo for libgd and it made the graphic it was supposed to so I
> think it's working ok.  Is there anyway to find out if everything is
> installed correctly?
>

What makes you think it didn't work correctly? The script just prints the
image data to the screen, which is basically what that garbled mess was in
your e-mail.  Try opening a file to write the image to, then print it to the
handle, then open the image in a image viewer

As an option first try to capture the output of the script to a file and
open that in the image viewer:

./helloworld2 > output.png

The other messages are just warnings that we can help you get rid of later.

http://danconia.org


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


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



RE: trying out examples in Oreilly's Perl Graphics Programming

2003-07-17 Thread Joel Lopez
I finally got the script to work!!  Thanks for all your help and
suggestions.
http://shawn.apocabilly.org/PGP/examples/example2-1.txt

I had to add the line:
binmode STDOUT;

right before the last line:
print $image->png;

A friend of mine was able to get it to work without adding that line.  Is
there some setting that I didn't set or is this normal for a default install
of perl on RH 8?

Thanks again,
Joel

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 1:59 PM
To: Joel Lopez; [EMAIL PROTECTED]
Subject: RE: trying out examples in Oreilly's Perl Graphics Programming


Please don't top post...


On Wed, 16 Jul 2003 13:11:57 -0700, "Joel Lopez"
<[EMAIL PROTECTED]> wrote:

> Hi,
>
> using this seems to get rid of the garbled stuff:
>   ./helloworld2 > output.png
>
> Is output.png supposed to be an existing image or is it one that is
created
> on the fly?
>

It is created on the fly.

> The code refers to the book authors home directory:
>
> my ($x1, $y1, $x2, $y2,
> $x3, $y3, $x4, $y4) = $image->stringFT($black,
> "/home/shawn/arial.ttf", 48, 0, 40, 120, "Hello World");
>

arial.ttf is the font that will be used for the words "Hello World" probably
you need to replace that location with the path to a similar (Truetype) font
on your local computer.

> Is this where the image is read from or created to?  The book site doesn't
> give an image to work with.
>

Neither. The image is essentially just a set of properties stored in a Perl
object. Then when you have finished manipulating the object you call the
'png' method on the object to magically transform your Perl object into
image data (a PNG) that can then be used in some way, specifically in the
example it is printed to STDOUT.

That is why I had you redirect the output into a file, namely output.png
which is your newly generated image. If it were a CGI for example, you would
want to print the proper MIME header, and then just print the data to
STDOUT, but from a terminal window that is not terribly helpful.

> thanks for helping a lost man,

You will get there, somewhat complicated at first but once the samples make
sense it is pretty much boundless what you can accomplish.

http://danconia.org

>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2003 12:22 PM
> To: Joel Lopez; [EMAIL PROTECTED]
> Subject: RE: trying out examples in Oreilly's Perl Graphics Programming
>
>
>
> 
> On 16 Jul 2003 11:28:31 -0700, Joel Lopez
<[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > I have been trying to get this perl script to work, but I'm can't seem
> > to figure out why it's not working.  You can see it here:
> >
> > http://shawn.apocabilly.org/PGP/examples/example2-1.txt
> >
> > When I run it I get this on my screen:
> >
> > [EMAIL PROTECTED] imagemagick]# ./helloworld2
> > Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
> > Use of uninitialized value in addition (+) at ./helloworld2 line 31.
> > Use of uninitialized value in addition (+) at ./helloworld2 line 31.
> > Use of uninitialized value in subtraction (-) at ./helloworld2 line 31.
> > ‰PNG
>
> 
>
> >
> > I first typed it in, but then after I couldn't get it to work I copied
> > and pasted it into a file.
> >
> > I'm using Red Hat 8 and have updated the libgd C library to version
> > 1.8.4 and then used cpan to install GD.
> >
> > I ran the demo for libgd and it made the graphic it was supposed to so I
> > think it's working ok.  Is there anyway to find out if everything is
> > installed correctly?
> >
>
> What makes you think it didn't work correctly? The script just prints the
> image data to the screen, which is basically what that garbled mess was in
> your e-mail.  Try opening a file to write the image to, then print it to
the
> handle, then open the image in a image viewer
>
> As an option first try to capture the output of the script to a file and
> open that in the image viewer:
>
> ./helloworld2 > output.png
>
> The other messages are just warnings that we can help you get rid of
later.
>
> http://danconia.org
>
>

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


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



Re: OT:RE: Telnet

2001-06-16 Thread Joel Divekar

Hi

Chas Owens thanks for your reply... but

At 03:10 AM 6/16/2001 -0400, Chas Owens wrote:
>That depends on whether you are running an X server on your machine.

nope... I am using win2k / win9x system and by using telnet app I connect to
Linux server, now I want to run netscape or kde or Xwindows, and so from my
system I get to work on GUI based on the linux server.

Regards

Joel

>See http://www.starnet.com/products/ for an X server for Win32.  If you
>have a X server running on your machine you can do the following:
>
>on the local machine type "xhost +remotehostname"
>telnet to remote machine
>type "DISPLAY=your.machines.ip.address:0.0"
>type "export DISPLAY"
>now try and run an xterm
>
>NOTE: your session is insecure as hell.  You are still better of using
>ssh (and with most setups you don't have to specify the DISPLAY).
>
>On 16 Jun 2001 11:58:39 +0530, Joel Divekar wrote:
> > Hi
> >
> > Hey can we run KDE or Xwindows by telneting to Linux servers ???
> >
> > Regards
> >
> > Joel
> >
> > At 03:26 PM 6/15/2001 +0100, Crowder, Rod wrote:
> > >telnet is not defunct, but is a very basic connection. Normally, 
> connecting
> > >to a unix or other multi-user system, you will have to login/logon with a
> > >name and password in reply to prompts. Usually it comes with a built in
> > >terminal emulator, mostly ansi or vt100, you can get other flavours 
> like IBM
> > >3270 etc. It is useful in setting up  interactive connections for testing,
> > >eg connecting to SMTP servers etc. ssh, rsh, rcp and the like are more
> > >specialized connections.
> > >
> > >
> > >-Original Message-
> > >From: Derek Harding [mailto:[EMAIL PROTECTED]]
> > >Sent: 14 June 2001 16:26
> > >To: Fco. Javier Valladolid Hdez.; Sally
> > >Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > >Subject: Re: Telnet
> > >
> > >
> > >What Javier says is very true about using ssh but if something happens to
> > >lock up at the remote computer it can be hard to get out with ssh without
> > >resorting to killing processes whereas, if the network is secure from
> > >peeking, one can end a telnet session with the "Ctrl-]" combination. 
> I'm not
> > >
> > >sure that telnet is defunct, though. Is it?
> > >
> > >On Friday 15 June 2001 03:43, Fco. Javier Valladolid Hdez. wrote:
> > > > Telnet is a Character based terminal program, you can accessed a remote
> > > > terminal from your PC with your IP, ...
> > > >
> > > > I'm believe that Telnet is now defunct , best use SSH, is a similar
> > > > program, but it is encrypted, as it provides best security...
> > > >
> > > > - Original Message -
> > > > From: Sally <[EMAIL PROTECTED]>
> > > > To: perlcgi <[EMAIL PROTECTED]>
> > > > Sent: Thursday, June 14, 2001 7:52 AM
> > > > Subject: Telnet
> > > >
> > > > > I've seen lots of references to telnet, but I can't find an 
> explanation
> > > > > of what it actually is. Is it similar to FTP?
> > >
> > >--
> > >Best wishes,
> > >Derek Harding, (BA MIAP)
> > >ICT & Network Manager
> > >[EMAIL PROTECTED]
> >
> >
> > --
> > QuantumLink Communications, Bombay, India
> >
> >
> >
>--
>Today is Boomtime, the 21st day of Confusion in the YOLD 3167
>Fnord.


--
QuantumLink Communications, Bombay, India





Re: Simple question...

2001-06-20 Thread Joel Divekar

Hi Jack

Please refer to my program 'Simple Mail Client' under code section
on www.perlmonks.org it will takes care of mail header and will allow you
to work with mail body. Do let me know if it helped you ... I am working
on the update.

Regards

Joel
Jamnet
Monk
www.perlmonks.org

At 02:30 PM 6/19/2001 -0700, Jack Lauman wrote:
>Below is an example of the e-mail message I'm trying to parse,
>manipulate the date, time and timzone and save it as CSV file:
>
>
>Rates as of 2000.12.30 00:16:19 UTC (GMT). Base currency is USD.
>
>Currency Unit   USD/UnitUnits/USD
>   ===
>===
>USD United States Dollars 1.0
>1.0
>EUR Euro  0.941604
>1.06202
>
>Note:
>1. The line: Rates as of . is always at the beginning of the
>message and occurs only once.
>
>2. All other desired lines begin with (3) capital letters.
>
>3. The date manipulation is done only once and is for reporting
>purposes only.
>
>Here's the code I have so far.  It correctly manipulates the date,
>and all desired fields.  The problem is that it parses every line
>in the file, including the e-mail header and footer.
>
>I would appreciate any suggestions
>
>Thanks,
>
>Jack
>
>
>#!/usr/bin/perl
>#
># cur2csv.pl
>#
>
>use strict;
>use vars qw($quote_date $cur_sym $cur_desc $usd_unit $units_usd);
>use vars qw($year $month $mday $hour $minute $second $timezone);
>use vars qw($conv_date $date $time $tz);
>
>
>use Date::Manip;
>use String::Strip;
>
>use DBI;
>use DBD::Pg;
>
>open (OUTFILE, ">", "currency.csv") || die "Can not open currency.csv
>for writing";
>
>printf STDERR "Reading currency file...";
>open (INFILE, "curtest") || die "Can not open /var/spool/mail/currency
>for reading";
>
>while () {
>
>
> # Extract date and time of Currency Rate Quotation
>
> ($year, $month, $mday, $hour, $minute, $second, $timezone) =
> $quote_date = /^Rates as of (\d+).(\d+).(\d+) (\d+):(\d+):(\d+) (\w+)
>(.*)$/;
> $year   = $1;
> $month  = $2;
> $mday   = $3;
> $hour   = $4;
> $minute = $5;
> $second = $6;
> $timezone   = $7;
>
> # Convert date from UTC (GMT) to PST and adjust date and time
>accordingly.
>
> $tz = &Date_TimeZone;
> $conv_date = "$year-$month-$mday $hour:$minute:$second";
> $conv_date = &ParseDate($conv_date);
> $conv_date = &Date_ConvTZ($conv_date, $timezone, $tz);
> $date  = &UnixDate($conv_date,"%Y-%m-%d");
> $time  = &UnixDate($conv_date,"%H:%M:%S");
> $tz= &UnixDate($conv_date,"%Z");
>
> }
>
> # Extract the ISO 4217 Code for Currencies and Funds (1995)
>
> $cur_sym  = substr($_, 0, 3);
>
> # Extract the Currency Description, and trim the trailing spaces
>
> $cur_desc = substr($_, 4, 28);
> StripTSpace($cur_desc);
>
> # Extract US Dollars to Units rate, and trim the leading/trailing
>spaces
>
> $usd_unit = substr($_, 35, 19);
> StripLTSpace($usd_unit);
>
> # Extract Units to US Dollars rate, and trim the leading/trailing
>spaces
>
> $units_usd = substr($_, 57, 19);
> StripLTSpace($units_usd);
>
> {
>
> printf OUTFILE "%s\,%s\,%s\,%s\,%s\,%s\,%s\n",
> $date, $time, $tz, $cur_sym, $cur_desc, $usd_unit, 
> $units_usd;
>
>
>}
>
>close(INFILE);
>close(OUTFILE);
>print STDERR "\n";
>
>1;


--
QuantumLink Communications, Bombay, India





Re: Telnet

2001-06-20 Thread Joel Divekar

Thanks Derek

Regards

Joel

At 03:01 PM 6/20/2001 +0100, Derek Harding wrote:
>On Saturday 16 June 2001 07:28, Joel Divekar wrote:
> > Hi
> >
> > Hey can we run KDE or Xwindows by telneting to Linux servers ???
> >
> > Regards
>
>Not by telnet but certainly it is possible to run "dumb" terminals onto a
>Linux server (Linux Terminal Server Project) so that 486/25 SX processors
>with 8MB RAM and no hard disk will run XWindows. In fact, they boot directly
>from the server so no rapscallion can change the configuration, they are
>ready to log in in about 30 seconds, they can be powered off "live" without
>effect etc.
>
>Not so easy with SuSE but RedHat do an special server install and SuSE 7.1
>has the required packages.
>
>How about a specific preconfigured load version to select at the beginning of
>yast Roger?
>
>--
>Best wishes,
>Derek Harding, (BA MIAP)
>ICT & Network Manager
>[EMAIL PROTECTED]


--
QuantumLink Communications, Bombay, India





Re: Telnet

2001-06-20 Thread Joel Divekar

Thanks SAWMaster (Not your real name I suppose)

Will surely give it a try but I am looking for a free software

Regards

Joel


At 09:25 AM 6/20/2001 -0500, SAWMaster wrote:
>Yes and no.  You cannot do it with telnet, but you can get what you want by
>using an x-term client and setting up the server box to allow x connections.
>One commercial example of an X-Term client for a windows box would be
>X-Win32.  Do a search on the net for "X-Win32" and you'll find plenty of
>information.  I'm not sure if there's any public domain freeware X-Term
>clients.  If anyone knows of one please let me know.
>
>
> > Hi
> >
> > Hey can we run KDE or Xwindows by telneting to Linux servers ???
> >
> > Regards
> >
> > Joel


--
QuantumLink Communications, Bombay, India





Re: Telnet

2001-06-20 Thread Joel Divekar

Thanks Brett

Will surely download CygWin32... anyway I wanted to install it for Perl

Regards

Joel

At 10:44 AM 6/20/2001 -0400, Brett W. McCoy wrote:
>On Wed, 20 Jun 2001, SAWMaster wrote:
>
> > Yes and no.  You cannot do it with telnet, but you can get what you want by
> > using an x-term client and setting up the server box to allow x 
> connections.
> > One commercial example of an X-Term client for a windows box would be
> > X-Win32.  Do a search on the net for "X-Win32" and you'll find plenty of
> > information.  I'm not sure if there's any public domain freeware X-Term
> > clients.  If anyone knows of one please let me know.
>
>XFree86 now runs under CygWin32, and is open source.  It works quite well,
>although the number of window managers is supports is limited.
>
>-- Brett
>http://www.chapelperilous.net/btfwk/
>
>Der Horizont vieler Menschen ist ein Kreis mit Radius Null --
>und das nennen sie ihren Standpunkt.


--
QuantumLink Communications, Bombay, India





How to start

2001-06-22 Thread Joel Divekar

Hi There

I have been asked to write a program to check if links on our website are 
live. I have never tried it and I don't know how to start. I am looking for 
some guidelines.

Thanks

Regards

Joel 


--
QuantumLink Communications, Bombay, India





Re: ActivePerl PPM Question

2001-07-03 Thread Joel Divekar

Hi Bill

I had faced this problem earlier I don't know why it is not installing the 
module if downloaded to the local machine but when you are connected to 
internet and when you try installing, it works properly. I have installed 
modules from behind proxy / firewall.
If you find the solution please let me know.

Regards

Joel

At 10:05 AM 7/3/2001 -0400, Conrad, Bill (ThomasTech) wrote:
>Hi All
>
> Has anyone used ActivePerl's Perl Package Manager to install CPAN
>packages? I down loaded the Tk package and I am trying to install it locally
>with the following command
>
> ppm install Tk.ppd
>
>and I get the following error:
>
> Failed to load PPM_DAT file
>
>Can someone tell me what I need to do to correct this error.
>
>Thanks
>
>Bill Conrad


--
QuantumLink Communications, Bombay, India





mod_perl

2001-07-05 Thread Joel Divekar

Hi All

Today I installed Indigo Perl on my system and when I tried the sample code 
which came along with the installation to test mod_perl it gave an error as 
"Page not found"

I checked the following before posting
a) I found that the file exists
b) path in the html page is also correct.
c) Apache which came along with the installation is running and displays
 "Apache/1.3.19 (Win32) mod_perl/1.24_01 running..."
d) When I tried checking the $ENV if 'MOD_PERL' exist but failed 

Can you all help me in the following

a) I stared Perl programming with Activestate and today also I am using
 Activestate Perl on Win2k system but mod_perl from active state
 comes with a price tag Any suggestions ?

c) Is IndigoPerl right option for mod_perl programming

d) One important thing with Activestate, I never had any problem adding 
additional
 modules (Well not tried from CPAN). And I am loyal to Activestate only 
because of
 the simplicity and easy managebility.

e) I am looking for a Perl distribution which is simple to install and 
manage. I should be
 able to add modules without compiling (I don't have any C++ compiler). 
I want to
 do web programming using mod_perl on Win32 environment.

Please help me  this problem has been troubling me for months ... and 
for few day I have some time to shift to another distribution if required.

Regards

Joel


--
QuantumLink Communications, Bombay, India





Re: ActivePerl - how does one configure for HTML

2001-07-17 Thread Joel Divekar

Hi Scott

I was having sleepless nights because of the same problem I tried whatever 
I could, tried configuring PWS it didn't work  surely will check 
the link. One right solution can help many more lives

Thanks a lot

Regards

Joel

At 08:09 PM 7/17/2001 +1000, you wrote:
> > > WinNT comes with "Personal Web Server" (PWS) which is how I'm learning
>Perl
> > > CGI.  You can put your scripts in C:\Inetpub\wwwroot\cgi-bin.  You can
>then
> > > run them by going to:
> > > your_homepage\cgi-bin\your_script.pl.  I'm not sure if Windows 98 comes
>with
> > > PWS.  Sorry I couldn't be of more help - just learning myself.
> >
> > Depending on what version of Windows NT you have, you may even have IIS as
> > part of your system (I think you need the server version with SP 4 and
> > higher).  There's also Apache, which can be built on NT and Win2K.
> > Again, though, don't know what things Windows 98 will support.  I think
> > Personal Web server may be the only thing.
>
>I too had the same problem of tring to run CGI scripts under Windows 98. I
>tried running them from the command line and they worked fine, but I wanted
>to get a feel for them in the browser.
>I thought I was doomed until I discovered the wonders of Apache. Go here
>http://httpd.apache.org/docs/windows.html for instructions on using and
>downloadin Apache for Win32 (You will also need the Microsoft Installer, but
>the page contains information on getting it).
>Instead of the normal shebang line, have "#!PERL" at the top of your script
>and plop the script in C:\Program Files\Apache Group\Apache\cgi-bin\ (Or
>what ever directory you installed Apache in), and you should get normal
>output to the browser (Remember to include the MIME content line though).
>
>Hope this helps.
>-Cheers, Scott.


--
QuantumLink Communications, Bombay, India



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




Re: PARSING

2001-07-17 Thread Joel Divekar

Hi Rahul

Show what attempts you have done before asking for help ok ... how do you 
plan to grow. Anyway this is what you are looking for


$string ="rahul;john;hary;brian;raj;dolly;jim;";

my @a = split(/;/, $string);

foreach $item (@a)
{
 print "$item\n";
}

Regards

Joel

At 01:18 PM 7/17/2001 +0530, Rahul Garg wrote:
>Hello Everybody,
>
>$string ="rahul;john;hary;brian;raj;dolly;jim;
>
>What i want to do is parse the string and put different names in a 
>separate variable..How!
>
>Thanx in advance,
>Waiting for Reply


--
QuantumLink Communications, Bombay, India



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




Re: Activestate installation

2001-07-17 Thread Joel Divekar

Hi Debashis

I have a same setup at home. Add perl installation path in your 
autoexec.bat file if not done automatically.

I don't think you need to configure anything more if you are using new perl 
releases

Regards

Joel

At 03:45 PM 7/17/2001 +0100, debashis rana (JIC) wrote:
>Hi,
>
>I attempted to install activestate perl in my WinME system. While
>installing, it asked me if I want to put the bin directory in the PATH. I
>answered yes. But at the end, I dont get 'perl -v' working at the c:\
>prompt. perl -v works ok if I change directory to c:\perl\bin. Sould I put
>the path directory manually to my autoexec.bat file? Is there anything else
>that I will have to configure to get activestate perl running.
>
>Will appreciate your response.
>
>Cheers,
>Debashis Rana
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--
QuantumLink Communications, Bombay, India



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




Re: is it possible?

2001-07-31 Thread Joel Divekar

Hi Rahul

I am sorry to say that we always see you coming up with questions and no 
efforts from you end. Either you are used to spoon feeding or just want to 
get things done for free. This will not help you as well as the list in the 
long run.

Thanks for your co-operation

Regards

Joel

Jamnet
Software Consultant

At 10:40 AM 8/1/2001 +0530, Rahul Garg wrote:
>How can we disable the hyperlink?
>
> > What i mean is that on certain condition if true the hyperlink to a
> > particular perl script  can be activated but if false cannot be
> > activated(ie though the hyperlink is shown it doesnt work)just like there
>is
> > a DISABLE option in Button.
> >
> >  >
> > > > >
> > > Waiting for Reply,
> > > Thanx in advance,
> > > Rahul
> > >
> > >
> >
> >
> > --
> > 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]


--
QuantumLink Communications, Bombay, India



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




SMTO Socket Connection

2001-08-12 Thread Joel Divekar

Hi Friends

Friday evening I heard a New that there is a change of MTA on our 
WebServer. And then all my Perl scripts running on our WebServer refuse to 
send me any stats / logs by email. And this gave me a jolt on Saturday 
morning. I requested our Admin to send me docs related to our new MTA and 
got the copy odf the same immediately. I opened my general purpose 
sub-routine file modified mail sending part accordingly and again all my 
scripts started sending me mails again. WOW but what happens if there is 
change of MTA again and again and again.
So I decided to write a simple SMTP program which makes a socket connection 
to the specified port and send mail irrespective of a MTA.

I started with the following code.

===
# Please note my system runs Win2k + Activestate Perl
# And My Server Red Hat 6.2
===

#!/usr/bin/perl -w

# use packages
use strict;
use IO::Socket;

# Data Variables
my ($SMTP_Server) = "10.10.10.10";
my ($SMTP_Port) = "25";
my ($CR) = "\r\n";
my $Socket;

# Mail Related Data
my $from = "joel\@testlinux.net";
my $to = "joel\@testlinux.net";

# Open Socket - SMTP Connection
$Socket = IO::Socket::INET->new(PeerAddr => "$SMTP_Server",
 PeerPort => "smtp($SMTP_Port)",
 Proto=> "tcp",
 Type => "SOCK_STREAM")
   or die "Error : Cannot Open SMTP Socket. Reason : $!";

# set buffering off or autoflush
$|=1;

# say hello the mail host
# print $Socket "HELO $SMTP_Server" . $CR;

# Send Mail Command

# mail from
print $Socket "MAIL FROM: $from" . $CR;

# mail to
print $Socket "RCPT TO: $to" . $CR;

# Data command
print $Socket "DATA" . $CR;

# test message
print $Socket "Test Message" . $CR;
print $Socket "." . $CR;

#quit SMTP Session
print $Socket "QUIT" . $CR;

# Close Connection
close $Socket;

# Print Socket Close
print "SMTP Socket Closed" . $CR;

===

Problem : and the mail is received by me immediately
but it gives To: as undisclosed-recipients

Help : a) Where did I go wrong in my code ?
   b) Any guideline on how to improve my code
   c) Any guidelines on attaching file(s)

===

Date: Sat, 11 Aug 2001 12:24:00 + (/etc/localtime)
From: [EMAIL PROTECTED]
To: undisclosed-recipients:  ;

Test Message
===


Thanks & Regards

Joel



!- PostMaster AvAc Certified Virus Free Mail -!
Command Engine Ver :14 4.073 Updated Until 03-Aug-2001 
 



Re: Where does Makefile.PL pick up include paths from?

2001-09-19 Thread Joel Divekar

Hi Reg

Read you posting on the mailing list. Even I am behind firewall but still I 
am able to install
packages without downloading them individually.

ok put this into a batch file  and run or run each command 
individually
before installing new packages

set HTTP_proxy=http://10.1.1.1:   # IP of proxy server along with the 
port no
set HTTP_proxy_user=joel   # Login name if required
set HTTP_proxy_pass=a  # password

then run PPM

This should solve your problem

Hey Reg do let me know if it helped you  OK

Regards

Joel

At 11:48 AM 9/19/2001 +0100, you wrote:
>Hello
>
>I'm tying to install the tk module on my NT4/perl 5.6.1 installation, as
>a pre-requesite to using ptkdb as a visual debugger. I can't use PPM as
>it can't get through our firewall, so I downloaded Tk800.023.tar.gz, and
>unpacked it.
>
>Then I ran "perl Makefile.pl", which created a makefile as expected. To
>make it, I have MSVC 6.0 professional edition installed so used nmake
>next. However, when I run "nmake" it gets so far and falls over
>complaining it can't find some standard headers files;
>
>nmake
>
>Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
>Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>
> cd pTk && NMAKE DEFINE=""
>
>Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
>Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>
> cl.exe -c -I.. -I../pTk/mTk/xlib -I. -Ibitmaps -I../pTk/mTk/xlib
>-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DN
>O_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
>-DPERL_MSVCRT_READFIX -O1 -MD -DNDEBUG-DVERSI
>ON=\"800.023\"  -DXS_VERSION=\"800.023\"  -IC:\Perl\lib\CORE
>ClientWin.c
>ClientWin.c
>.../pTk/mTk/xlib\X11/Xlib.h(52) : fatal error C1083: Cannot open include
>file: 'stddef.h': No such file or directory
>NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
>Stop.
>NMAKE : fatal error U1077: 'cd' : return code '0x2'
>Stop.
>
>I can find stddef.h in "C:\Program Files\Microsoft Visual
>Studio\VC98\Include" and if I manually run the "cl.exe -c -I..
>-I../pTk/mTk/xlib -I. -Ibitmaps -I../pTk/mTk/xlib " line again with
>an extra -I pointing to this location it gets past ClientWin.c, but
>fails on the next target. Obviously I'd rather not have to do this for
>every target!
>
>I can't see anywhere particularly obvious to put the extra include path
>in either makefile.pl or makefile.
>
>My question is - where does Makefile.pl pick up include paths from when
>it generated the makefile that nmake uses, and can I add "C:\Program
>Files\Microsoft Visual Studio\VC98\Include" to a config file somewhere
>so it gets included in the makefile? Or is there anything in my
>environment I can set?
>
>Many thanks
>
>Reg Smith
>
>
>
>-
>
>  E-mail Confidentiality Notice and Disclaimer
>
>   This email and any files transmitted with it are confidential and are 
> intended solely for the use of the individual or entity to which they are 
> addressed. Access to this e-mail by anyone else is unauthorised. If you 
> are not the intended recipient, any disclosure, copying, distribution or 
> any action taken or omitted to be taken in reliance on it, is prohibited.
>   E-mail messages are not necessarily secure.  Hitachi does not accept 
> responsibility for any changes made to this message after it was sent.
>   Please note that Hitachi checks outgoing e-mail messages for the 
> presence of computer viruses.
>
>-
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>!- PostMaster AvAc Certified Virus Free Mail -!
>Command Engine Ver :17 4.083 Updated Until 22-Aug-2001
>


--
QuantumLink Communications, Mumbai, India



--
QuantumLink Communications, Bombay, India



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




RE: Firewall

2002-04-18 Thread Joel Hughes

hmmm

we'llyou can't tell anything from port 80 (http) coz (by the sounds of
things) the firewall is configured to let that traffic thru (probably).

now, you could sniff to see what other connections you can make (21 etc)
but, if you make a connection or get some sorta reading back on a port then
this doesn't prove or deny the existance of a firewall (coz the firewall
could be configured to let those pckts thru).

A better approach would be to fingerprint the os of the webserver (from info
from port 80) and then compare that to the finger print your getting back
from responses from other ports (e.g. an os has its on peculiar quirks in
handshaking tcp/ip - its these quirks which all OSs to be fingerprinted
based on tcp/ip behaviour). If the finger print for all ports (including odd
ones which a firewall wont be configured to allow thru) match then might be
able to say there is no firewall.

NMAP would probably be a better option

joel

-Original Message-
From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
Sent: 17 April 2002 20:37
To: >; >
Subject: Firewall


Anyone know of a perl script that can determine if a website is actually
behind a firewall?

thanks!


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




RE: http headers

2002-04-23 Thread Joel Hughes

Conan,
HTTP::Headers I think is what your after

http://search.cpan.org/search?mode=module&query=http


regards

Joel

-Original Message-
From: Conan Chai [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2002 05:08
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: http headers


hi,

are there any perl modules that splits the http request headers into
name/value pairs?

Conan
It Will Come To Us !!!
[EMAIL PROTECTED]


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




Re: DBD and DBI::Pg

2001-04-15 Thread Joel Burton

On Sun, 15 Apr 2001, N@ta$ wrote:

> -A Quake3Arena server
> HAVE IT
> 
> -An SQL database compatable with Perl:DBI:DBD and PHP4
> CURRENTLY RUNNING PostgreSQL, but HAVE NOT INSTALLED DBI::DBD
> 
> -Perl
>RUNNING PERL 5
> 
> -DBI:DBD Mod for Perl
> I'M LOST ON THIS ONE
> 
> -A web server that works with PHP
> HAVE IT
> 
> -PHP4
> HAVE IT
> 
> Graphinat0r requires:
> -GD.pm
> LOST ON THIS AS WELL

DBI (which includes DBD::Pg, the DBI module for PostgreSQL) and GD.pm
are both Perl modules. You can find them at www.perl.com.

Alternatively, you can use the CPAN module (which should have come with
your installation of Perl) to install them:

shell$ perl -MCPAN -eshell

and "install DBD::Pg" and so on.

Lots of info on the Perl web pages, or in "Programming the Perl
DBI" (O'Reilly).


-- 
Joel Burton   <[EMAIL PROTECTED]>
Director of Information Systems, Support Center of Washington




Re: help ma as i am new commer

2001-04-16 Thread Joel Divekar

Hi Arfan

Search www.perl.com

At 10:44 PM 4/15/2001 +0500, arfan wrote:
>hi to all
>i am  very new in perl world pls tell me the site from where i can get
>all perl documentation and notes
>hoping reply
>arfan hmad rana

Arfan you are from where ?

Joel
Mumbai, India 


--
QuantumLink Communications, Bombay, India





Re: DBD and DBI::Pg

2001-04-16 Thread Joel Divekar

Hi

At 09:19 PM 4/15/2001 -0400, Joel Burton wrote:
>On Sun, 15 Apr 2001, N@ta$ wrote:
>
> > -A Quake3Arena server
> > HAVE IT
> >
> > -An SQL database compatable with Perl:DBI:DBD and PHP4
> > CURRENTLY RUNNING PostgreSQL, but HAVE NOT INSTALLED DBI::DBD
> >
> > -Perl
> >RUNNING PERL 5
> >
> > -DBI:DBD Mod for Perl
> > I'M LOST ON THIS ONE
> >
> > -A web server that works with PHP
> > HAVE IT
> >
> > -PHP4
> > HAVE IT
> >
> > Graphinat0r requires:
> > -GD.pm
> > LOST ON THIS AS WELL
>
>DBI (which includes DBD::Pg, the DBI module for PostgreSQL) and GD.pm
>are both Perl modules. You can find them at www.perl.com.
>
>Alternatively, you can use the CPAN module (which should have come with
>your installation of Perl) to install them:
>
>shell$ perl -MCPAN -eshell
>
>and "install DBD::Pg" and so on.
>
>Lots of info on the Perl web pages, or in "Programming the Perl
>DBI" (O'Reilly).
>
>
>--
>Joel Burton   <[EMAIL PROTECTED]>
>Director of Information Systems, Support Center of Washington

Also there is lot of info on www.perl.com.

Regards

Joel


--
QuantumLink Communications, Bombay, India





Re: Perl Man Pages

2001-04-19 Thread Joel Divekar

Hi Ray

At 09:54 AM 4/19/2001 -0600, Ray Calkins 100660207 wrote:
>Hi All:
>
>I'm very much a beginning perl programmer, and I just discovered that perl 
>has a
>huge manpage presence.
>
>Perl Man Pages
>http://www.aisd.com/technology/perl/man/
>Overview and listing on the web.
>
>I understand how to use them on Unix systems "man perl" or "man perlop", etc,
>but is there something similar for Windows versions of Perl?

yes,

perldoc -h

  this will surely help you.

>Ray Calkins
>[EMAIL PROTECTED]   [EMAIL PROTECTED]
>"My opinions are my own, and do not reflect those of my employer."

Regards

Joel


mod_perl

2001-04-24 Thread Joel Divekar

Hi There

What is mod_perl ? I have Apache Server installed on my system. Please can 
anybody mail me windows installable and its tutorials and other docs directly.

Thanks

Regards

Joel 


--
QuantumLink Communications, Bombay, India





Re: Error: Runtime Exception

2001-04-27 Thread Joel Divekar

Hi

At 12:16 PM 4/27/2001 -0400, David H. Adler wrote:
>On Thu, Apr 26, 2001 at 06:43:37PM -0500, Arante, Susan wrote:
> > This used to be working but after my very adventurous fiasco (deleting
> > perl5, installing perl6, deleting perl6, installing perl5 - yes i deleted
> > not uninstalled), it's not working anymore.  I'm running perl5 on NT.
>
>Given that there *is* no perl6 (yet), I'm guessing you don't really mean
>that, right?

Yes I was also surprised about Perl 6, is it out yet ?

Regards

Joel


>dha
>--
>David H. Adler - <[EMAIL PROTECTED]> - http://www.panix.com/~dha/
>however, if people don't like Perl, they don't have to use it.  they
>can stay at the office solving their problems while the Perl Mongers
>go out and drink. ;)- brian d foy in c.l.p.misc


--
QuantumLink Communications, Bombay, India





Mailing List

2001-04-29 Thread Joel Divekar

Hi There

Can anybody give me mailing list address for

1) Linux Administration
2) Linux Administration with Perl
3) Linux Security

Urgent, I have been asked to take up additional responsibility of System 
Administration at the earliest

Regards

Joel


--
QuantumLink Communications, Bombay, India





Perl - Cryptography

2001-05-17 Thread Joel Divekar

Hi

Please I am looking for tutorials and mailing list on cryptography and also 
on Hacking (to make our site secure)

Regards

Joel 


--
QuantumLink Communications, Bombay, India





Cryptography

2001-05-17 Thread Joel Divekar

Hi

Please I am looking for tutorials and mailing list on cryptography and also 
on Hacking (to make our site secure)

Regards

Joel 


--
QuantumLink Communications, Bombay, India





Perl - Cryptography

2001-05-17 Thread Joel Divekar

Hi

Please I am looking for tutorials and mailing list on cryptography and also 
on Hacking (to make our site secure)

Regards

Joel 


--
QuantumLink Communications, Bombay, India





Re: useful scripts

2001-05-22 Thread Joel Divekar

Hi

why don't you check my perl program on www.perlmonks.org by the name 
'Simple Mail Client' - user name - Jamnet

Regards

Joel
At 10:59 AM 5/22/2001 -0700, Dan Brown wrote:
>Richard KHOO Guan Chen wrote:
> >
> > Sorry if this is a stupid question
> >
> > Just wondering if there is a site which have useful simple perl scripts
> > for totally clueless people like me to look at? I am actually interested
> > in trimming mail headers (save subject, from etc) for storage
> >
>
>I found http://www.perlmonks.org/ to be invaluable.


--
QuantumLink Communications, Bombay, India





Different releases of Perl for Win

2001-05-29 Thread Joel Divekar

Hi All

I have been using Activestate Perl and I am very happy with it, but from 
the time I read that there are different releases of perl I want to try 
them. Actually I do all the development on my system (win2k) using 
Activestate Perl and then run them on our Linux servers.

Can any body give me URLs of the different sites where I can get different 
flavours of Perl and their speciality.

Thanks

Regards

Joel
=0]


--
QuantumLink Communications, Bombay, India





Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Joel Divekar

Hi

I am from Mumbai, India

Working for a software firm.

God only knows how long my company will survive ...

Feeling the pain of recession ...

Perl Monk on www.perlmonk.org (Jamnet)

Have a 9+ years experience

Looking for a good job...

Ready to relocate 

Regards

Joel

At 03:56 PM 11/9/2001 -0800, Bruce Ferrell wrote:
>Alameda California
>
>
>--
>Bruce
>
>One day at a time... One second if that's what it takes
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--
QuantumLink Communications, Bombay, India



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




Re: Converting numbers into date format

2001-12-04 Thread Joel Divekar

Hi

use POSIX

Regards

Joel

At 11:54 AM 12/4/2001 +0330, nafiseh saberi wrote:
>hi
>you can do it with
>gmtime
>localtime
>and many time function in...
>http://www.perldoc.com/perl5.6/pod/func/gmtime.html
>http://www.perldoc.com/perl5.6/pod/func/localtime.html
>be successful.
>your problem will solve.
>_
>   Best regards.
>   Nafiseh Saberi
>   www.iraninfocenter.net
>   www.sorna.net
>  ___
>- Original Message -
>From: "Sandeep Pathare" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, December 04, 2001 08:12 AM
>Subject: Converting numbers into date format
>
>
> > I am a beginner of Perl.  How do I convert and print the following strings
> > into a date format so that either the date is returned or "date not valid"
> > is printed.
> > Input data is:
> >
> > 792910171010163200
> > 552910171010163200
> > 552913171010163200
> > 552910171010163200
> > 552909171010163200
> > 552909171010163200
> >
> > For each of the data value, the output should like:
> >
> > 552910171010163200  Sat Nov 17 10:29:55 2001
> >
> > Here is some hint I read in the documentation, but still can't figure out
> > how to use it:
> >
> > The 552910171010163200 which is Sat Nov 17 10:29:55 2001,
> > (HINT: localtime) should be parsed into HH:MM:SS (Zero padded) and
> > WDay MMM DD,  - which should look like Sat Nov 17, 2001
> > 55: 29:  10: 17:10:  101: 6:
>320:0
> > HH:MM:SS:17:Nov: year (1900 +101= 2001):Sat:  320thday of the year
> >
> > Thank you very much in advance.
> >
> > Sandeep
> >
> > _
> > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
> >
> >
> > --
> > 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]


--
QuantumLink Communications, Bombay, India



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




RE: Trouble with compound regular expression matching

2004-12-07 Thread Stout, Joel R
I replied directly too - sorry.  Why not use a module to help out?  I
think it's easier to read - but then again I'm no perl expert...

use File::Basename;
$fullname = "/usr/local/pics/sample.tiff"; #for example

($file,$dir,$_) = fileparse($fullname, qr/\..*/); 

if (/\.(tif|tiff|jpg|jpeg)$/) {
print "This is an image file.\n";
};
 

-Original Message-
From: Paul Ohashi [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 06, 2004 4:24 PM
To: [EMAIL PROTECTED]
Subject: FW: Trouble with compound regular expression matching

Hmmm.. I'm new to this list and I just replied to the message and it
seems to have gone directly to Jeffrey, sorry 'bout that...

I did need to add the case-insensitivity to the regex:

/^.*\.[tj][pi][gfe].*$/i

That's better, I think.

-Paul

-Original Message-
From: Paul Ohashi
Sent: Monday, December 06, 2004 4:19 PM
To: 'Jeffrey Paul Burger'
Subject: RE: Trouble with compound regular expression matching


This one worked for me:

/^.*\.[tj][pi][gfe].*$/

Hope this helps
- Paul

-Original Message-
From: Jeffrey Paul Burger [mailto:[EMAIL PROTECTED]
Sent: Monday, December 06, 2004 4:06 PM
To: [EMAIL PROTECTED]
Subject: Trouble with compound regular expression matching


I tried everything I could think of to get this to work before pleading
for
help!

I need to check if a file is either a TIFF or JPEG graphics file.
(Case-insensitive variations of qualifying suffixes would be .tif,
.tiff,
.jpg and .jpeg.) So far I have three difference versions of what seem to
be
a valid line of code to test a single pattern. ($file_name holds the
name of
the file. Also, for logic reasons, I'm testing that it's NOT one of
these
types):

if ($file_name !~ /tif$/i) {}
 
if ($file_name !~ m/tif\b/i) {}

if ($file_name !~ m/.*.tif/i) {}

But I can't for the life of me figure out how to structure a working
version
of a more complex variation on any of the these that test all four cases
(or
even a second one, for that matter). From my reading, I would expect the
following to work, but it doesn't:

if ($file_name !~ /tif$/i | /jpg$/i) {}

Any help would be greatly appreciated.

Thanks!

Jeffrey Paul Burger
2675 W. Hwy. 89A - PMB 455
Sedona, AZ 86336
928-203-0170

"There are only two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is."
--Albert Einstein




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



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



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




RE: replacing special chars

2005-02-03 Thread Stout, Joel R
Try this, and remember - with XML there are more than one you have to
change:

sub xc {
#returns text free of XML baddies - xc = xml clean
my $data = $_[0];
$data =~ s/&/&/g;
$data =~ s//>/g;
$data =~ s/'/'/g;
$data =~ s/"/"/g;
return $data;
} 

-Original Message-
From: John [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 03, 2005 9:36 AM
To: Perl Beginners
Subject: replacing special chars

Hello to all

I want to replace the & with the &

I use the command s/\&/\&/; with no luck

Does anybody know what am i missing here?

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




RE: Microsoft Word Creation

2003-10-07 Thread Stout, Joel R
Good place to ask.  Jenda and some others are great with perl and M$.  One
thing I've done in the past is to write HTML but save it as a *.doc.
Example:

Open a file and write:
testtest test test

Save it as test.doc.

Open it in Word.  It show the formatting.  The user can then edit and save
as a doc file (though the first option will be to save it as a htm file).

Joel


-Original Message-
From: John [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 8:16 AM
To: Perl Beginners
Subject: Microsoft Word Creation


I want to create a doc file that will contain my text, fonts, sizes as if i
wrote manually.

Can i do that thing?

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



(OT) RE: Microsoft Word Creation // CSS

2003-10-07 Thread Stout, Joel R
>:) The problem is that i want to use Fonts and Different Sizes, bold,italic
>in my text. Not just a simple text.

Rob's answer may be better for you but remember - HTML can handle your
fonts, sizes, yada, yada.  Google "CSS".  

Using perl, write the text below to a file, name it test2.doc and then open
in Word.  You'll see the formatting.  I don't know about you but I'd rather
send time learning CSS than learning to drive M$ Word programmatically (not
that there's anything wrong with that).  One advantage to doing it this way
is that you can save it as .doc and Word can play with it or you can save as
.html, you only need to change the extension.  HTH. 



<!--
H1
   {
   color:yellow;
   font-family:Verdana;
   font-size:50pt;
   font-style:italic;
   }
H2
   {
   color:green;
   font-family:Courier;
   font-size:40pt;
   font-style:italic;
   }
H3
   {
   color:blue;
   font-family:Garamond;
   font-size:30pt;
   font-style:italic;
   }
-->

Help
Help
Help


-Original Message-
From: John [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 8:53 AM
To: Stout, Joel R; Perl Beginners
Subject: Re: Microsoft Word Creation


Have you got the code to test if you concept is what i need?


- Original Message -
From: "Stout, Joel R" <[EMAIL PROTECTED]>
To: "'John'" <[EMAIL PROTECTED]>; "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 6:32 PM
Subject: RE: Microsoft Word Creation


> Good place to ask.  Jenda and some others are great with perl and M$.  One
> thing I've done in the past is to write HTML but save it as a *.doc.
> Example:
>
> Open a file and write:
> testtest test test
>
> Save it as test.doc.
>
> Open it in Word.  It show the formatting.  The user can then edit and save
> as a doc file (though the first option will be to save it as a htm file).
>
> Joel
>
>
> -Original Message-
> From: John [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 07, 2003 8:16 AM
> To: Perl Beginners
> Subject: Microsoft Word Creation
>
>
> I want to create a doc file that will contain my text, fonts, sizes as if
i
> wrote manually.
>
> Can i do that thing?
>
> --
> 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]



LWP

2001-06-07 Thread Stout, Joel R

Hiya,

I just started running some CGI scripts.  Very cool.  But I'm running into a
problem both with an example in the CookBook and with a script given to me.
Both use LWP so I'm thinking that I'm missing a module or something.  I have
the basic Active State install loaded on a WinNT book.  I see a LWP folder
under Perl\site\lib. 

The script (> >see below) given to me seems to be returning bad data:
Error in CGI Application
CGI ErrorThe specified CGI application misbehaved by not
returning a complete set of HTTP headers.  The headers it did return
are:

The example from the book "times out" each time I run it.  Here it is:

perl -MLWP::Simple -e "getprint 'http://www.perl.org/press/fast_facts.html'"

Any clues as the problem would be much appreciated.

Script notes:

> >Bruno,
> >   I used CGI and LWP::Simple to get ESPN's AL East baseball standings
table
> >and then rewrite that table into a format that I wanted. You can see it
at
> >http://jasper.cs.yale.edu if you're curious (insert shameless plug for
the Red
> >Sox here). But that sort of thing might help you to grab the source for
an
> >HTML page. Here's the snippet that's the critical part, and if you want
my
> >whole script, let me know and I'll send it to you.
> >
> >#!/usr/bin/perl
> >
> >use CGI;
> >use LWP::Simple;
> >use strict;
> >
> >open OUTFILE, ">/var/www/html/baseball.html";
> >my $content = get("http://sports.espn.go.com/mlb/standings";);
> >my @lines=split(/\n/,$content);
> >
> >Obviously it may not be necessary for you to split the content up into an
> >array, but I found it useful for what I was doing.
> >As far as checking to see if a page is available for browsing, you might
just
> >check the contents for any one of , , , or  or
> > >that if a page is live you'll hit one of those on any page. There's gotta
be a
> >better solution, though.
> >
> >Pete





XML::Parser XML::SimpleObject -> First XML parsing pls help

2001-06-13 Thread Stout, Joel R

I took the example from
http://www.xml.com/pub/a/2001/04/18/perlxmlqstart1.html
I wanted something really simple for XML parsing that basically just reads
values.  But I'm stuck (again).

#Here's what I'm trying to run:

#!c:\perl\perl.exe 

use XML::Parser;
use XML::SimpleObject;
use strict;

my $file = 'c:\perl\work\job001_card.xml';

my $parser = XML::Parser->new(ErrorContext => 2, Style => "Tree");
my $xso = XML::SimpleObject->new( $parser->parsefile($file) );

foreach my $mail ($xso->child('job_card')->children('email')) {
print "SMTP server: ";
print $mail->child('smtp_server')->{VALUE};
print "\n";
}

#and I get 
'SMTP server: '

#Here's an excerpt of the file I've been given:

xx

ftp.xxx.com
px
fx
.



c:\test
.xxx

c:\perl\log

mx.ex.com
...

...


#I think I'm close.  When I add -w I get:
'use of uninitialized value in print at line 14 ...'
#but I know there's a value for that tag. ??? 



RE: Windows Background Process

2001-06-28 Thread Stout, Joel R

I've tried what you are talking about.  Specifically I wanted to run a Perl
program from NT Task Scheduler in the background.  The mentioned
Win32::Process works (http://www.xav.com/perl/site/lib/Win32/Process.html)
but... if you are trying to do it through Scheduler who'll always have at
least one window pop up(for MSTask.exe).  

If someone knows something different please pass it on.  This window is very
annoying 8^)

Here's a practice script to chew on (stolen from someone else):

#!c:\perl\perl.exe  -w 
use Win32::Process; 
use Win32;
my $ProcessObj;
my $notepath = 'C:\winnt\system32\notepad.exe';
use strict;


Win32::Process::Create($ProcessObj,
$notepath,
"notepad",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();

$ProcessObj->Suspend();
$ProcessObj->Resume();
$ProcessObj->Wait(INFINITE);



sub ErrorReport{

print Win32::FormatMessage( Win32::GetLastError() );
}

JS
  

-Original Message-
From: murphy, daniel (BMC Eng) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 1:59 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Windows Background Process


I have this snippet of code that I picked up from "Learning Perl on Win32
Systems" (O'Reilly) that may be helpful. For more info, check the
Win32::Process module. As a Perl rookie myself, I really can't explain it -
I just know it works. ;-)


use Win32::Process;

Win32::Process::Create($Process,
"c:\\program files\\ultraedit\\uedit32.exe",
"uedit32 $alljobs_list" ,
0,
DETACHED_PROCESS,
".")||  die "Creating UltraEdit process: $!";






Dan Murphy   [EMAIL PROTECTED]   
EMC Corp.508-435-1000 x14559
Hopkinton, MA  01748

EMC2
where information lives




-Original Message-
From: C.Ouellette [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 6:17 AM
To: [EMAIL PROTECTED]
Subject: Windows Background Process


Hello,

I need to start an external program from my perl
script.  This program will need to run in the
background so my script can continue doing other
things.  It also still needs to notify the program
when it terminates.

I would appreciate any help on how I would do this. 
My environment is Windows NT 4.0, with Activestate
perl 5.6.1.  I'm also not sure how Windows runs a
background process, so any tips there would be
appreciated.

Lastly, I've been monitoring this list for a few weeks
now. It has been extremely helpful in getting me
started with Perl. Thank you to everyone involved.

Tina Ouellette

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



RE: Beginning

2001-06-29 Thread Stout, Joel R

Learning languages by reverse engineering does not work for most people.
Try Learning Perl and the Perl Cookbook for starters.  Also go to
http://learn.perl.org/ 

Cheers,

Joel 

-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 12:16 PM
To: Scott Dortch
Cc: [EMAIL PROTECTED]
Subject: Re: Beginning


Scott,

I knew nothing when I started.  I found a copy of a program and dug out
every word until it I understood it and the flow from top to bottom.  I have
found this a good way to learn any language.  

Jerry

Scott Dortch wrote:
> 
> Where should I begin?  I would like to get to know perl but do not know
> where to start.  Are there recommended books/websites etc. for in depth
> documentation?
> 
> Any suggestions would be greatly appreciated.
> 
> Scott Dortch
> Director of Operations
> The Order Fulfillment Group



RE: Beginning

2001-06-29 Thread Stout, Joel R

One more note for beginners (like myself) buying Perl books - 

The Perl CD Bookshelf is $71.96 (USD) at Amazon and $47.97 (USD) at
FatBrain.com.  Shop around.   

(I have any no financial ties to FatBrain just looking to help the end user)

-Original Message-
From: Stout, Joel R [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 4:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Beginning


Learning languages by reverse engineering does not work for most people.
Try Learning Perl and the Perl Cookbook for starters.  Also go to
http://learn.perl.org/ 

Cheers,

Joel 

-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 12:16 PM
To: Scott Dortch
Cc: [EMAIL PROTECTED]
Subject: Re: Beginning


Scott,

I knew nothing when I started.  I found a copy of a program and dug out
every word until it I understood it and the flow from top to bottom.  I have
found this a good way to learn any language.  

Jerry

Scott Dortch wrote:
> 
> Where should I begin?  I would like to get to know perl but do not know
> where to start.  Are there recommended books/websites etc. for in depth
> documentation?
> 
> Any suggestions would be greatly appreciated.
> 
> Scott Dortch
> Director of Operations
> The Order Fulfillment Group



Perl 2 EXE or other problem?

2001-07-03 Thread Stout, Joel R

I have the following in my script:

use Mail::Sender;

When using Perl2Exe I get the following error:

Warning: module Mail/Sender.config.pm not found

After install of Perl2Exe I ran the sample and it did fine.  The Perl script
runs without warnings and I use (-w; use strict;).  I am using Win32.

Any clues?



RE: perl as win32exe

2001-07-12 Thread Stout, Joel R

Active State has an exe-maker in their Dev Kit.  I had problems with
Perl2Exe, but that was probably because of my inexperience with it.  I did
find that their support help (at Perl2Exe) was very lacking.

-Original Message-
From: pete [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 6:25 AM
To: Stefan Oswald; [EMAIL PROTECTED]
Subject: Re: perl as win32exe


Stefan Oswald wrote:
> 
> I sometimes hear there is a compiler avalaible which produces win32exes
out
> of perl scripts ...
> Has anybody further information ??
> 
I think that the perl script is converted to a bat file , and is loaded
as such .
Anybody cares to correct me on this .

Regards Pete



  1   2   >