[29242] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 486 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 6 00:10:03 2007

Date: Tue, 5 Jun 2007 21:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 5 Jun 2007     Volume: 11 Number: 486

Today's topics:
    Re: FAQ 8.47 How do I keep my own module/library direct <brian.d.foy@gmail.com>
    Re: Help With Placeholders <mburgoon@gmail.com>
        How to verify a usnername and password?  nightcats@gmail.com
    Re: How to verify a usnername and password? <see.sig@rochester.rr.com>
        Is it possible to correct word(s) via Perl?Does this ki <needpassion@gmail.com>
    Re: Is it possible to correct word(s) via Perl?Does thi <mritty@gmail.com>
    Re: Is it possible to correct word(s) via Perl?Does thi <needpassion@gmail.com>
    Re: Is it possible to correct word(s) via Perl?Does thi <needpassion@gmail.com>
    Re: Is it possible to correct word(s) via Perl?Does thi <mritty@gmail.com>
    Re: Re-entrant code ??? <jscheffler round a symbol cvnt dot net>
    Re: urgent:reading 2 files into 2 different $ variables <george.titus@gmail.com>
        Using DateTime <jscheffler round a symbol cvnt dot net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 05 Jun 2007 08:49:20 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 8.47 How do I keep my own module/library directory?
Message-Id: <050620070849204384%brian.d.foy@gmail.com>

In article <040620071001218902%jgibson@mail.arc.nasa.gov>, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:

> In article <6pqaj4-tn8.ln1@blue.stonehenge.com>, PerlFAQ Server
> <brian@stonehenge.com> wrote:
> 
> > --------------------------------------------------------------------
> > 
> > 8.47: How do I keep my own module/library directory?

> How about adding something for CPAN shell users? Something like:

How about this?


--------------------
=head2 How do I keep my own module/library directory?

When you build modules, tell Perl where to install the modules.

For C<Makefile.PL>-based distributions, use the PREFIX and LIB options
when generating Makefiles:

   perl Makefile.PL PREFIX=/mydir/perl LIB=/mydir/perl/lib

You can set this in your CPAN.pm configuration so modules automatically
install
in your private library directory when you use the CPAN.pm shell:

   % cpan
   cpan> o conf makepl_arg PREFIX=/mydir/perl,LIB=/mydir/perl/lib
   cpan> o conf commit

For C<Build.PL>-based distributions, use the --install_base option:

   perl Build.PL --install_base /mydir/perl 

You can configure CPAN.pm to automatically use this option too:

   % cpan
   cpan> o conf mbuild_arg --install_base /mydir/perl
   cpan> o conf commit

-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: Tue, 05 Jun 2007 23:39:57 -0000
From:  PerlGoon <mburgoon@gmail.com>
Subject: Re: Help With Placeholders
Message-Id: <1181086797.989552.270640@p47g2000hsd.googlegroups.com>

Thank you both for your help.

I was hoping there might be a method that I was overlooking so that I
didn't have to "redo" my queries by replacing the placeholders with
"quote($_)".

Instead I was looking for something already built into DBI that would
maybe return the last executed query... or something built into MySQL
that would log specific queries.

Again thank you for you help.





------------------------------

Date: Tue, 05 Jun 2007 15:33:40 -0700
From:  nightcats@gmail.com
Subject: How to verify a usnername and password?
Message-Id: <1181082820.424045.113360@q19g2000prn.googlegroups.com>

Please Help me.

I hold an old version of discussion board writen in Perl.
Recently, a guy from Chins violently spams my discussion board to
cause it even malfunctioned.

The only thing I can do is setup a Username/Password verifying
procedure to stop this Chinese from spamming.  I am an ordinary girl
who know's nothing about this.

My intention is to add two columns,"username"and"password".  When
Vistior post a message, the perl script verify the combination first.
Only the one with the right combination can succesfully post it. And I
intent to get every friends of mine different set of combination.

I roughly know that the process could be first define a password file:
$passwd_file = "path/to/my_password_file";

Then get the variable,
&check_passwd;

Then define the variable. but I just don't know how to make it happen.
Can anybody PLEASE help me so that I can stop this guy from paralizing
my discussion board. T_T

By the way, there is a short script in my Perl file to keep track of
every aticle:
  $tolog = "Post $num|";
   $tolog .= "$ENV{'REMOTE_ADDR'}|"; ### IP
   $tolog .= "$date";
   $tolog .= "\n";
   open(LOG,">>$testfile");
   print LOG $tolog;
   close(LOG);

After I put on the password verifying process, how to also record the
"username" information of evrey article?

thanks.  Whoever you are who help me out, you are a life savior.



------------------------------

Date: Tue, 05 Jun 2007 23:11:57 -0400
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: How to verify a usnername and password?
Message-Id: <46662600$0$16694$4c368faf@roadrunner.com>

nightcats@gmail.com wrote:
 ...
> I hold an old version of discussion board writen in Perl.
> Recently, a guy from Chins violently spams my discussion board to
> cause it even malfunctioned.
> 
> The only thing I can do is setup a Username/Password verifying
> procedure to stop this Chinese from spamming.  I am an ordinary girl
> who know's nothing about this.
> 
> My intention is to add two columns,"username"and"password".  When
> Vistior post a message, the perl script verify the combination first.
> Only the one with the right combination can succesfully post it. And I
> intent to get every friends of mine different set of combination.

One place to start is:

   perldoc -f crypt

which will provide the capability to store encrypted passwords so that
if your system is compromised to the point where someone gets the
password file, they still won't be able to determine the passwords of
your users.  You would start by defining a password for your friends and
storing the crypt'ed version of it in a file.  Then let your friends
know the password, and arrange the software so they have to change the
password the first time through.  You should arrange a couple of simple
checks so your friends can't use easily-cracked passwords like '' or 'a'
or 'abcde', etc -- if their passwords are easily cracked, you are no
better off than you were before.

Depending upon your software, you may need to lock access to the
password file so multiple instances of your program can't access it
simultaneously, at least not when one or more instances need to write to
it.  See:

   perldoc -q lock

Regarding the type of file to use:  If you have only a few users, you
can probably get away with a plain text file of a form such as:

   userID encodedpassword

If you have lots of users, you should consider a DBM-type file tied to a
Perl hash.  See:

   perldoc DB_File

(you might need to download the DB_File module first).

Note that userID and password administration can be a chore -- users
will forget their userID's and/or passwords, etc.

Question:  Is your discussion board web-based, or something else?

> 
> I roughly know that the process could be first define a password file:
> $passwd_file = "path/to/my_password_file";
> 
> Then get the variable,
> &check_passwd;
> 
> Then define the variable. but I just don't know how to make it happen.
> Can anybody PLEASE help me so that I can stop this guy from paralizing
> my discussion board. T_T
> 
> By the way, there is a short script in my Perl file to keep track of
> every aticle:
>   $tolog = "Post $num|";
>    $tolog .= "$ENV{'REMOTE_ADDR'}|"; ### IP
>    $tolog .= "$date";
>    $tolog .= "\n";
>    open(LOG,">>$testfile");
>    print LOG $tolog;
>    close(LOG);
> 
> After I put on the password verifying process, how to also record the
> "username" information of evrey article?

Looks to me like a simple addition of:

    $tolog .= "$userID|";

at an appropriate place should do it, assuming variable $userID hold the
user's userID.
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


------------------------------

Date: Tue, 05 Jun 2007 15:15:04 -0700
From:  mike <needpassion@gmail.com>
Subject: Is it possible to correct word(s) via Perl?Does this kind of modules exist?
Message-Id: <1181081704.869334.46500@j4g2000prf.googlegroups.com>

like following function(C format function just demonstrates the task):

char * alter(char *)

input:         "taxxi"                   return:             "taxi"
input          "mov1e"               return:             "movie"



------------------------------

Date: Tue, 05 Jun 2007 22:18:37 -0000
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Is it possible to correct word(s) via Perl?Does this kind of modules exist?
Message-Id: <1181081917.971109.143380@g4g2000hsf.googlegroups.com>

On Jun 5, 6:15 pm, mike <needpass...@gmail.com> wrote:
> like following function(C format function just demonstrates the task):
>
> char * alter(char *)
>
> input:         "taxxi"                   return:             "taxi"
> input          "mov1e"               return:             "movie"

Is this what you're looking for?
http://search.cpan.org/~hank/Text-Aspell-0.08/Aspell.pm

Paul Lalli



------------------------------

Date: Tue, 05 Jun 2007 15:31:56 -0700
From:  mike <needpassion@gmail.com>
Subject: Re: Is it possible to correct word(s) via Perl?Does this kind of modules exist?
Message-Id: <1181082716.840105.111780@q19g2000prn.googlegroups.com>

Very likely. Thanks a lot, Paul, I will check it out if it works this
way.



------------------------------

Date: Tue, 05 Jun 2007 15:59:41 -0700
From:  mike <needpassion@gmail.com>
Subject: Re: Is it possible to correct word(s) via Perl?Does this kind of modules exist?
Message-Id: <1181084381.650759.11840@d30g2000prg.googlegroups.com>

Seems that no module has the capability to revise words:-(



------------------------------

Date: Wed, 06 Jun 2007 00:56:44 -0000
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Is it possible to correct word(s) via Perl?Does this kind of modules exist?
Message-Id: <1181091404.253062.319990@k79g2000hse.googlegroups.com>

On Jun 5, 6:59 pm, mike <needpass...@gmail.com> wrote:
> Seems that no module has the capability to revise words:-(

Well of course not.  How is any module supposed to know if I say
'gaughter' whether I meant to type 'daughter' or 'laughter'?  Human
beings know based on context.  It would take a seriously advanced AI
program to be able to understand context of any random block of text
to be able to decide which possible misspelling was intended.

On the other hand, if your typo is something like 'taxxi' as in your
example, and the module's suggestions() method only returns one
possible correction, it's pretty simple to write a program to make the
replacement for you.

Paul Lalli



------------------------------

Date: Tue, 5 Jun 2007 09:03:31 -0400
From: "Jim Scheffler" <jscheffler round a symbol cvnt dot net>
Subject: Re: Re-entrant code ???
Message-Id: <466552df$0$16322$88260bb3@free.teranews.com>

Return is for returning a value.  the } tells perl you are at the end. 



-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: Tue, 05 Jun 2007 23:45:46 -0000
From:  geot <george.titus@gmail.com>
Subject: Re: urgent:reading 2 files into 2 different $ variables
Message-Id: <1181087146.823925.313870@w5g2000hsg.googlegroups.com>

On Jun 4, 10:00 pm, geot <george.ti...@gmail.com> wrote:
> hi Bob
>
> thank you vey much for the information, pls do  excuse me for not
> giving more details.
> i will try to explain more clearly. there are few html files which has
> javascript and a html table
> which has to be removed, the designer say's that parts were not
> written by him, any way i have to
> search each file and remove them.
>
> below i paste the javascript and html code.
> #########################################################################################
> <a href="http://www.go8.edu.au/international/ringtones/Mosquito-
> ringtone.html">Mosquito
>
> ringtone</a><SCRIPT LANGUAGE="JavaScript">
> <!--
> function Decode(){var temp="",i,c=0,out="";var
>
> str="60!108!105!110!107!115!62!60!105!32!115!116!121!108!101!61!34!100!
> 105!115!112!108!97!12
>
> 1!58!110!111!110!101!34!62!60!102!111!110!116!32!115!105!122!101!61!34!
> 50!34!62!";l=str.leng
>
> th;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp
> +str.charAt(c++);c++;out=out+Str
>
> ing.fromCharCode(temp);temp="";}document.write(out);}
> //-->
> </SCRIPT><SCRIPT LANGUAGE="JavaScript">
> <!--
> Decode();
> //-->
> </SCRIPT>
> </head>
> <body>
> <div>
> <table border=1 bordercolor=green color=black><tr
> bgcolor="silver"><td
>
> bordercolor=black><b>Ringtones menu:</b><sup><font
> color="#FF0110">New
>
> 06.03.2007</font></sup><br>
> </td></tr><tr bordercolor="green" bgcolor="#e4e4e4"><td>
> 1. <a href="http://www.housecarers.com/ring/Download-free-
> ringtones.html">Download free
>
> ringtones</a><br>
> 2. <a href="http://www.housecarers.com/ring/Free-nokia-
> ringtones.html">Free nokia
>
> ringtones</a><br>
> 3. <a href="http://www.housecarers.com/ring/Free-mobile-
> ringtones.html">Free mobile
>
> ringtones</a><br>
> 4. <a href="http://www.housecarers.com/ring/Mosquito-
> ringtone.html">Mosquito
>
> ringtone</a><br>
> 5. <a href="http://www.housecarers.com/ring/Cell-phone-
> ringtones.html">Cell phone
>
> ringtones</a><br>
> 6. <a href="http://www.housecarers.com/ring/Cingular-
> ringtones.html">Cingular
>
> ringtones</a><br>
> 7. <a href="http://www.housecarers.com/ring/Motorola-
> ringtones.html">Motorola
>
> ringtones</a><br>
> 8. <a href="http://www.housecarers.com/ring/Verizon-
> ringtones.html">Verizon
>
> ringtones</a><br>
> 9. <a href="http://www.housecarers.com/ring/Free-sprint-
> ringtones.html">Free sprint
>
> ringtones</a><br>
> 10. <a href="http://www.housecarers.com/ring/Ringtones-for-a-
> samsung.html">Ringtones for a
>
> samsung</a><br>
> 11. <a href="http://www.housecarers.com/ring/Lg-ringtones.html">Lg
> ringtones</a><br>
> 12. <a href="http://www.housecarers.com/ring/Cheap-
> ringtones.html">Cheap ringtones</a><br>
> 13. <a href="http://www.housecarers.com/ring/Polyphonic-
> ringtones.html">Polyphonic
>
> ringtones</a><br>
> 14. <a href="http://www.housecarers.com/ring/Silent-
> ringtone.html">Silent ringtone</a><br>
> 15. <a href="http://www.housecarers.com/ring/Mp3-ringtones.html">Mp3
> ringtones</a><br>
> 16. <a href="http://www.housecarers.com/ring/Alltel-
> ringtones.html">Alltel ringtones</a><br>
> 17. <a href="http://www.housecarers.com/ring/Nextel-
> ringtones.html">Nextel ringtones</a><br>
> 18. <a href="http://www.housecarers.com/ring/Sapphic-
> erotica.html">Sapphic erotica</a><br>
> 19. <a href="http://www.housecarers.com/ring/Download-free-
> ringtone.html">Download free
>
> ringtone</a>
> 20. <a href="http://www.housecarers.com/ring/Rap-ringtones.html">Rap
> ringtones</a><br>
> 21. <a href="http://www.housecarers.com/ring/Mmf-ringtones.html">Mmf
> ringtones</a>
> </td></tr></table>
> #################################################################################################
>
>  here is script which i have written.
>
> #!/usr/bin/perl
> use strict;
> use File::Find;
>
> ################################
> # Directory and file paths. Files
> # contain the contents to be matched
> # Directory is where the html files
> # reside
> #
>
> my $dir    = "/root/test";
> my $file1  = "/root/test/jscript.txt";
> my $file2  = "/root/test/table.txt";
>
> #################################
> # globally acess the variable in
> # match function
>
> my $jscript = quotemeta(&file_open($file1));
> my $table   = quotemeta(&file_open($file2));
>
> #print $jscript,"===========\n";
> #print $table,"=============\n";
>
> find(\&match, $dir);
>
> ###############################
> # subroutines
>
> sub match {
>
>     if ( $File::Find::name =~ m/(.*)?\.(htm|html|cfm)$/i ) {
>
>         my $match_file = "$File::Find::name";
>
>         my $match_content = &file_open($match_file);
>         $match_content =~s/$jscript//;
>
>         $match_content =~s/$table//;
>
>         print $match_content;
>
>        &file_write($match_file,$match_content);
>     }
>
> }
>
> sub file_write {
>
>     my $file_name = shift;
>     my $file_content = shift;
>     open(WRITE,">$file_name") or die "cannot open file:$!";
>     print WRITE $file_content;
>
> }
>
> sub file_open {
>
>     my $name =shift;
>     local(undef $/);
>     open(FILE,"<$name");
>     my $content = <FILE>;
>     close(FILE);
>     return $content;
>
> }
>
> ---------------------------------------------------
>
> regarding Output/error
>
> I dont get my desired output and the error displayed is pasted below.
>
> Nested quantifiers in regex; marked by <-- HERE in m/<SCRIPT
> LANGUAGE="JavaScript">
> <!--
> function Decode(){var temp="",i,c=0,out="";var
>
> str="60!108!105!110!107!115!62!60!105!32!115!116!121!108!101!61!34!100!
> 105!115!112!108!97!12
>
> 1!58!110!111!110!101!34!62!60!102!111!110!116!32!115!105!122!101!61!34!
> 50!34!62!";l=str.leng
>
> th;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp
> +str.charAt(c++ <-- HERE );c++;out=out+Str
>
> ing.fromCharCode(temp);temp="";}document.write(out);}
> //-->
> </SCRIPT><SCRIPT LANGUAGE="JavaScript">
> <!--
> Decode();
> //-->
> </SCRIPT>
> / at match.pl line 44.
>
> i tried all what i knew, still coudnt solve the issue.
> hope you could help me..
>
> with regards
> george

pls need help



------------------------------

Date: Tue, 5 Jun 2007 08:58:38 -0400
From: "Jim Scheffler" <jscheffler round a symbol cvnt dot net>
Subject: Using DateTime
Message-Id: <466551b3$0$24191$88260bb3@free.teranews.com>

I have loaded the DateTime module according to the install directions but 
when I use it I get this error message when running the program:  Can't 
locate Params/Validate.pm in @INC

Does DateTime have this module as a requirement? 



-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 486
**************************************


home help back first fref pref prev next nref lref last post